1

I am getting error "The method when(BasePersistenceImpl) is undefined for the type BusinessServiceImplTest"

here is my code sample

when(PersistenceFactory.getService(RecordTypeEnum.CANDIDATERESPONSE, mockEntityManager)).thenReturn(mockCandidateResponsePersistenceImpl);

public static BasePersistenceImpl getService( RecordTypeEnum eNum, EntityManager entityMgr) throws ADRDataAccessException {}

Please let me know if I missing syntax

thanks

user3123934
  • 1,001
  • 3
  • 12
  • 19
  • Do you `import static org.mockito.Mockito.when` with the rest of your imports? – Jeff Bowman Sep 01 '15 at 15:17
  • Yes I did PowerMockito.mockStatic(PersistenceFactory.class); – user3123934 Sep 01 '15 at 15:20
  • That's not the same thing: I'm referring specifically to the _imports_. It looks like you're missing the `import static` line above. See also [this SO question](http://stackoverflow.com/q/14089770/1426891), which describes a similar problem. – Jeff Bowman Sep 01 '15 at 15:23
  • thanks that's resolved now with import. Some thing the error should tell missing import... – user3123934 Sep 01 '15 at 15:43

0 Answers0