This is a well-known limitation of PowerMockito with TestNG's @BeforeTest lifecycle method. The issue occurs because PowerMockito's bytecode manipulation and plugin initialization happens at a specific point in the test lifecycle, and @BeforeTest runs too early.
You should use @BeforeMethod instead of @BeforeTest.
@BeforeMethod
public void setUp() {
PowerMockito.mockStatic(TestStatic.class);
}