KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am using mockito for mock the unit test cases and am getting the following exception org.mockito.exceptions.misusing.NotAMockException: Argument passed to verify() is of type ConsumerImpl and is not a mock! Make sure you place the parenthesis correctly! See the examples of correct verifications: verify(mock).someMethod(); verify(mock, times(10)).someMethod(); verify(mock, atLeastOnce()).someMetenter code herehod(); and my code is MessageConsumer mConsumer = Mockito.mock(MessageConsumer.class); String data = "new Message for Testing"; Message message = new Message(data.getBytes()); Mockito.when(mConsumer.next(10, TimeUnit.SECONDS)).thenReturn(message); StringParserTest parserTest = new StringParserTest(); ConsumerImpl<String> consumer = new ConsumerImpl<String>(mConsumer, parserTest); String mes=Mockito.verify(consumer,VerificationModeFactory.times(3)).consumeMessage(10,TimeUnit.SECONDS); Please some one help me to solve this problem Thanks in Advance SRN
Tags (comma-separated)
Save Edits
Cancel