SenderController { @RequestMapping("/{payloadType}/count") public SendCount findSendCount(@PathVariable("payloadType") PayloadType payloadType) { return sendCountService.findSendCount(payloadType); }  @RequestMapping("/{payloadType}/send") SendCount sendPayload(@PathVariable("payloadType") PayloadType payloadType); @RequestMapping("/{payloadType}/count") SendCount findSendCount(@PathVariable("payloadType") PayloadType payloadType);  }
@Test public void testFindSendCount() throws Exception { ResultActions actions = mockMvc.perform( get("/" + PayloadType.TEST1 + "/count")); MvcResult result = actions.andExpect( status().isOk()) .andReturn(); String sendCountJson = result.getResponse().getContentAsString(); SendCount sendCount = deserializeSendCount(sendCountJson); assertEquals(PayloadType.TEST1, sendCount.getPayloadType()); assertEquals(1, sendCount.getTimesSent()); }