title: java.lang.AssertionError: Status expected:<200> but was:<400> in junit
body: <p>it's my controller...</p>
  
  <pre><code>@GET
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
      @Path("/categories")
      public POSResponse getAllCategories() {
          String countryCode="1";
          return infoService.getAllCategories(countryCode);
      }
  </code></pre>
  
  <p>it's my testController....</p>
  
  <pre><code>  @Mock
      InfoService infoService;
      @InjectMocks
      private InfoController infoController;
  
      private MockMvc mockMvc;
      @Before
      public void setUp() {
          MockitoAnnotations.initMocks(this);
          mockMvc = MockMvcBuilders.standaloneSetup(infoController).build();
      }
  
      @Test
      public void getAllCategoriesTest() throws Exception {
          POSResponse response=new POSResponse();
          Category category=new Category();
          category.setCountryCode(1);
          category.setDescription("Mother Dairy");
          response.setResponse(category);
  
          when(infoService.getAllCategories("1")).thenReturn(response);
  
          mockMvc.perform(get("/categories"))
                  .andExpect(status().isOk())
                  .andExpect(content().contentType(APPLICATION_JSON_UTF8))
                  .andExpect(jsonPath("$.id", is(1)))
                  .andExpect(jsonPath("$.description", is("Mother Dairy")));
  
          verify(infoService, times(1)).getAllCategories("1");
          verifyNoMoreInteractions(infoService);
      }
  </code></pre>
  
  <p>i am using jersey controller. 
  when i call the method i got error msg"java.lang.AssertionError: Status expected:&lt;200> but was:&lt;400>"</p>