I want to test a method domainService class, in which used a constantClass.someConstant as a filter condition, like someList.stream.filter(e -> constantClass.someConstant.equals(e.getSomeProperty))
. Also in the test class, I addedPowerMockito.when(constantClass.someConstant).thenReturn("0")
but when I debug the
test method and run to the equals line in domainService, variables list shows constantClass.someConstant is null.
I'm new to powerMockito and I've read How do I get Mockito to mock a constant from another file?, but it can't solve my problem. Any suggestions will be appreciated.