Powermock es un framework de mocking para Java y herramienta de pruebas unitarias que utiliza manipulación de bytecode para simular métodos estáticos, clases finales y constructores privados. Incluye una herramienta de instrumentación de agente Java y una utilidad de pruebas basada en reflexión para eludir la encapsulación y modificar el comportamiento de las clases en tiempo de ejecución.
Las características principales de powermock/powermock son: Java Unit Testing, Bytecode Instrumentation Agents, Runtime Instrumentation Agents, Bytecode Manipulation, Java Bytecode Manipulation, Method Interception Proxies, Constructor Interception, Mocking Frameworks.
Las alternativas de código abierto para powermock/powermock incluyen: mockk/mockk — MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support… mockito/mockito — Mockito is a Java mocking framework and JUnit testing library used to create simulated objects and stub method calls… raphw/byte-buddy — Byte Buddy is a runtime code generation and bytecode manipulation library for Java. It provides a fluent API for… sinonjs/sinon — Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit… btraceio/btrace — btrace is a JVM dynamic tracing tool and performance profiler used for injecting safe instrumentation scripts into a… rspec/rspec-mocks — This project is a Ruby unit testing tool designed for dependency isolation and behavioral contract verification. It…
MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support for final classes, static methods, and coroutines. It functions as a bytecode instrumentation library that modifies compiled class files at load time to intercept constructors, final methods, and static functions without source changes, and also provides dedicated libraries for constructor mocking and coroutine mocking. The framework is designed specifically for Kotlin, handling Kotlin-specific constructs like extension functions, singletons, and suspend functions. MockK disting
Mockito is a Java mocking framework and JUnit testing library used to create simulated objects and stub method calls to isolate components during unit tests. It functions as a dynamic proxy generator and bytecode instrumentation tool, allowing for the creation of runtime substitutes that mimic the behavior of real classes. The framework distinguishes itself by providing the ability to mock final classes and methods, bypassing standard language restrictions through bytecode modification. This capability enables the testing of legacy code that lacks interfaces. The toolset covers behavioral mo
Byte Buddy is a runtime code generation and bytecode manipulation library for Java. It provides a fluent API for creating and modifying Java classes during execution, enabling developers to define class structures, methods, and fields programmatically without requiring a compiler or direct bytecode assembly. The library supports agent-based class transformation, allowing loaded classes to be modified during JVM startup or runtime through a Java agent that intercepts class loading. It offers bytecode-level method interception for fine-grained control over method behavior, annotation-based code
Sinon is a JavaScript test double library and mocking framework used to isolate code and verify behavior during unit testing. It provides a collection of spies, stubs, and mocks that replace real function implementations and object methods with controlled substitutes. The project includes a specialized fake timer library for overriding the system clock, allowing the simulation of time progression to trigger timeouts and intervals without waiting for real-time delays. It also features a test sandbox mechanism to group multiple fakes together, ensuring the original state is restored between tes