# powermock/powermock

PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Repository: https://github.com/powermock/powermock
Canonical: https://ross.abutalabs.com/products/powermock
Language: Java
License: Apache-2.0
License Family: permissive
Topics: java, testability, testing, mocking, mocking-framework
Last push: 2024-01-03T18:46:42+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4480, "days_push": 973, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4170, forks 572 (observed 2026-08-28T04:08:38.013762+00:00)

## What it is
PowerMock is a Java framework that extends mocking libraries like EasyMock and Mockito to enable unit testing of code normally regarded as untestable. It uses a custom classloader and bytecode manipulation to mock static methods, constructors, final classes and methods, private methods, and static initializers.

## Use cases
- mock static methods in java unit tests
- mock final classes and methods
- suppress static initializer blocks in tests
- test legacy code with private method mocking
- extend mockito tests to untestable code
- bypass encapsulation to access internal state in tests

## When to choose
- you need to unit test legacy Java code with static methods, final classes, or private methods
- you already use Mockito or EasyMock and need more powerful mocking capabilities
- you cannot refactor production code for testability

## When to avoid
- you are starting a new project and can design for testability with plain Mockito
- your team includes junior developers, as PowerMock can encourage poor design
- you need a actively developed tool with modern JDK support

## Facets
- artifact type: framework
- maturity: maintenance
- function: testing, mocking
- domain: testing, developer-tools
- platform: jvm
- tags: java, mockito, easymock, bytecode-manipulation, unit-testing

## Member repositories
- powermock/powermock (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:38.013762+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:45.191372+00:00, confidence not recorded.
  - readme: https://github.com/powermock/powermock (fetched 2026-08-28T04:08:38.013762+00:00, sha 3af26970ee37)
- Data as of 2026-08-30T08:39:29.467469+00:00.
