org.mockito.exceptions.misusing.NotAMockException: Argument should be a mock, but is: class com.sun.proxy.$Proxy36

petrikainulainen.net | 3 months ago
  1. 0

    Unit Testing of Spring MVC Controllers: REST API

    petrikainulainen.net | 5 months ago
    org.mockito.exceptions.misusing.NotAMockException: Argument should be a mock, but is: class com.sun.proxy.$Proxy36
  2. 0

    Unit Testing of Spring MVC Controllers: REST API

    petrikainulainen.net | 3 months ago
    org.mockito.exceptions.misusing.NotAMockException: Argument should be a mock, but is: class com.sun.proxy.$Proxy36
  3. 0

    Automatic mocking of interface fails!

    Google Groups | 5 years ago | laolaoyu
    org.mockito.exceptions.misusing.NotAMockException: >> Argument(s) passed is not a mock! >> Pass mocks that require verification in order. >> For example: >> InOrder inOrder = inOrder(mockOne, mockTwo);
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Mockito: NotAMockException: Argument passed to verify() is of type MockHttpServletResponse and is not a mock

    Stack Overflow | 1 month ago | Amadeu Cabanilles
    org.mockito.exceptions.misusing.NotAMockException: Argument passed to verify() is of type MockHttpServletResponse 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()).someMethod();
  6. 0

    Cannot instantiate mock objects using InjectMocks-Mockito

    Stack Overflow | 12 months ago | Bambi Yang
    org.mockito.exceptions.misusing.NotAMockException: Argument passed to verify() is of type Integer 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()).someMethod();

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.mockito.exceptions.misusing.NotAMockException

      Argument should be a mock, but is: class com.sun.proxy.$Proxy36

      at com.travenion.controllers.customer.CustomerControllerTest.setup()
    2. com.travenion.controllers
      CustomerControllerTest.setup
      1. com.travenion.controllers.customer.CustomerControllerTest.setup(CustomerControllerTest.java:50)
      1 frame