### Question:
GetComplaintListOfValuesAPIController { @RequestMapping(value = "types", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody List<String> getComplaintTypes() { List<StandardLookupEntry> lookupEntries = (List<StandardLookupEntry>) getLookupDao().getLookupByName("complaintTypes").getEntries(); return lookupEntries.stream().map(StandardLookupEntry::getKey).collect(Collectors.toList()); }  @RequestMapping(value = "priorities", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_XML_VALUE }) @ResponseBody List<String> getComplaintPriorities(); @RequestMapping(value = "types", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody List<String> getComplaintTypes(); LookupDao getLookupDao(); void setLookupDao(LookupDao lookupDao);  }### Answer:
@Test public void getComplaintTypes() throws Exception { String[] typeList = { "A", "B", "C", "D" }; expect(mockAuthentication.getName()).andReturn("user"); expect((StandardLookup) mockLookupDao.getLookupByName("complaintTypes")).andReturn(complaintTypesLookup); replayAll(); MvcResult result = mockMvc.perform(get("/api/latest/plugin/complaint/types") .accept(MediaType.parseMediaType("application/json;charset=UTF-8")).principal(mockAuthentication)).andReturn(); verifyAll(); assertEquals(HttpStatus.OK.value(), result.getResponse().getStatus()); assertTrue(result.getResponse().getContentType().startsWith(MediaType.APPLICATION_JSON_VALUE)); String returned = result.getResponse().getContentAsString(); log.info("results: " + returned); ObjectMapper objectMapper = new ObjectMapper(); String types[] = objectMapper.readValue(returned, String[].class); assertEquals(4, types.length); assertArrayEquals(typeList, types); }