I tried to follow the example offered in the answer to this very similar question, but it does not work for me. I get the following error message:
java.lang.
Hi guys, to me worked as below:
First add power mockito on pom.xml:
org.powermock
powermock-module-junit4
2.0.4
test
and then on my class:
@RunWith(PowerMockRunner.class)
@PrepareForTest({EnumClass.class})
public class EnumClassTest{
private EnumClassTest enumClassTest;
@Before
public void setUp() {
enumClassTest = mock(EnumClassTest.class);
}
@Test
public void someMethod() {
//My code test here
}