awesome-repositories.com
Blog
MCP
awesome-repositories.com

Descubre los mejores repositorios open-source con nuestra búsqueda potenciada por IA.

ExplorarBúsquedas curadasAlternativas open-sourceSoftware autohospedableBlogMapa del sitio
ProyectoServidor MCPAcerca deCómo clasificamosPrensa
Aviso legalPrivacidadTérminos
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
powermock avatar

powermock/powermock

0
View on GitHub↗
4,174 estrellas·575 forks·Java·Apache-2.0·14 vistas

Powermock

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.

El proyecto se distingue por proporcionar la capacidad de interceptar la instanciación de objetos mediante la palabra clave new y simular el comportamiento de clases del sistema Java central y métodos nativos. Puede anular modificadores finales en clases y métodos y eludir restricciones de firma para clases contenidas dentro de archivos firmados.

El conjunto de herramientas cubre amplias áreas de capacidad, incluyendo el mocking de miembros privados, la verificación de construcción de objetos y la supresión de inicializadores estáticos y constructores. También proporciona utilidades de reflexión para la gestión de estado privado y se integra con JUnit a través de reglas y runners especializados.

La integración es compatible con arquitecturas modulares como OSGi y varios frameworks de ejecución de pruebas externos.

Features

  • Java Unit Testing - Implements a specialized unit testing framework for Java that isolates code by mocking static methods and final classes.
  • Bytecode Instrumentation Agents - Includes a runtime agent that injects bytecode transformations to modify system classes and bypass runtime environment locks.
  • Runtime Instrumentation Agents - Injects bytecode transformations at runtime to modify system classes and bypass restricted environment locks.
  • Bytecode Manipulation - Rewrites class bytes during loading to remove modifiers and intercept static or private method calls.
  • Java Bytecode Manipulation - Provides advanced capabilities to modify compiled Java class bytes at runtime to override language restrictions and bypass encapsulation.
  • Method Interception Proxies - Implements a mocking engine that reroutes method calls to a proxy handler to return predefined values.
  • Constructor Interception - Intercepts the Java 'new' keyword to return mock instances instead of real objects during class instantiation.
  • Mocking Frameworks - Provides a comprehensive Java mocking framework utilizing bytecode manipulation to isolate static methods, final classes, and private constructors.
  • Partial Mocks - Implements test doubles that selectively execute original class logic while overriding specific methods.
  • Private Member Mocks - Overrides private or final methods to verify internal behavior without altering source code visibility.
  • Private Constructor Mocks - Bypasses private constructor restrictions to enable the creation of mock objects for classes with limited instantiation.
  • Static Member Mocks - Uses bytecode instrumentation to mock static methods and object instances to isolate tests from real implementations.
  • Private Method Stubs - Intercepts calls to private methods to isolate the unit under test from its internal dependencies.
  • System Class Mocking - Intercepts calls to core runtime system classes and native methods typically locked by the JVM.
  • Legacy Code Testing - Enables testing of old Java codebases by suppressing static initializers and intercepting internal object construction without source changes.
  • Private Member Access - Provides utilities to retrieve or modify private fields and methods from external classes via reflection.
  • Startup Agent Bootstrapping - Loads the project environment as a system agent to resolve classloading conflicts during JVM startup.
  • Private Constructor Invocations - Creates instances of classes with private constructors by invoking them through reflection.
  • Reflection-Based State Inspection - Uses language reflection to get or set private field values and verify object state.
  • Reflection Utilities - Includes reflection-based utilities for invoking private methods and accessing internal object state.
  • System Class Mocking - Simulates the behavior of core Java system classes and native methods typically locked by the JVM runtime.
  • Encapsulation Bypasses - Uses reflection to access and modify private members of a class without changing source code visibility.
  • Field Initialization Suppressions - Prevents specific member fields from being initialized during object instantiation.
  • JUnit Rule Integrations - Provides specialized JUnit rules and runners to integrate advanced bytecode mocking into standard Java test suites.
  • Member Field Resets - Restores member field values to their defaults after execution to ensure a clean state between tests.
  • Method Executions Suppressions - Disables specific method calls or code blocks during tests to avoid side effects and external dependencies.
  • Method Execution Suppressions - Blocks specific methods from executing and returns default values to bypass logic hindering unit tests.
  • Initializer Suppressions - Prevents the execution of static initializers and constructors during object creation to avoid side effects.
  • Construction Verification - Provides capabilities to verify that a specific class was instantiated with the expected arguments during test execution.
  • Private Method Invocations - Provides the ability to execute and verify logic within private methods and fields using Java reflection.
  • Signed Class Mocking - Bypasses signature verification to mock classes contained within signed archives.
  • Final Member Mocks - Overrides final modifiers on classes and methods to control their behavior during test execution.
  • Method Interception Spies - Creates spies of existing objects to mock specific methods while preserving the original behavior of others.
  • Frameworks de pruebas - Mocks static methods, constructors, and private methods.

Historial de estrellas

Gráfico del historial de estrellas de powermock/powermockGráfico del historial de estrellas de powermock/powermock

Búsqueda con IA

Explora más repositorios increíbles

Describe lo que necesitas en lenguaje sencillo: la IA clasifica miles de proyectos open-source curados por relevancia.

Start searching with AI

Preguntas frecuentes

¿Qué hace powermock/powermock?

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.

¿Cuáles son las características principales de powermock/powermock?

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.

¿Qué alternativas de código abierto existen para powermock/powermock?

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…

Alternativas open-source a Powermock

Proyectos open-source similares, clasificados según cuántas características comparten con Powermock.
  • mockk/mockkAvatar de mockk

    mockk/mockk

    5,747Ver en GitHub↗

    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

    Kotlinargument-matcherschain-callshacktoberfest
    Ver en GitHub↗5,747
  • mockito/mockitoAvatar de mockito

    mockito/mockito

    15,432Ver en GitHub↗

    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

    Java
    Ver en GitHub↗15,432
  • raphw/byte-buddyAvatar de raphw

    raphw/byte-buddy

    6,856Ver en GitHub↗

    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

    Javabyte-codedynamic-proxyinstrumentation
    Ver en GitHub↗6,856
  • sinonjs/sinonAvatar de sinonjs

    sinonjs/sinon

    9,753Ver en GitHub↗

    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

    JavaScript
    Ver en GitHub↗9,753
Ver las 30 alternativas a Powermock→