Search in sources :

Example 11 with ClassWithInternalState

use of org.powermock.reflect.testclasses.ClassWithInternalState in project powermock by powermock.

the class WhiteBoxTest method testSetInternalState.

@Test
public void testSetInternalState() throws Exception {
    ClassWithInternalState tested = new ClassWithInternalState();
    tested.increaseInteralState();
    Whitebox.setInternalState(tested, "anotherInternalState", 2);
    assertEquals(2, tested.getAnotherInternalState());
}
Also used : ClassWithInternalState(org.powermock.reflect.testclasses.ClassWithInternalState) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 ClassWithInternalState (org.powermock.reflect.testclasses.ClassWithInternalState)11 Ignore (org.junit.Ignore)1 FieldNotFoundException (org.powermock.reflect.exceptions.FieldNotFoundException)1 TooManyFieldsFoundException (org.powermock.reflect.exceptions.TooManyFieldsFoundException)1 ClassWithPrivateMethods (org.powermock.reflect.testclasses.ClassWithPrivateMethods)1