### Question:
SchemaController { @RequestMapping(value = "/interactionFields", method = RequestMethod.GET) @ResponseBody public String getInteractionFields(HttpServletRequest request) throws IOException { return "csv".equals(getRequestType(request)) ? csvFields() : jsonFields(); }  @RequestMapping(value = "/interactionTypes", method = RequestMethod.GET) @ResponseBody String getInteractionTypes(HttpServletRequest request); @RequestMapping(value = "/interactionFields", method = RequestMethod.GET) @ResponseBody String getInteractionFields(HttpServletRequest request); @RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody String getPrefixes(HttpServletRequest request);  }### Answer:
@Test public void interactionFieldsJson() throws IOException { String interactionFields = new SchemaController().getInteractionFields(null); JsonNode jsonNode = new ObjectMapper().readTree(interactionFields); assertThat(jsonNode.get(ResultField.TAXON_NAME.getLabel()).get("description").asText(), is(notNullValue())); }
@Test public void interactionFieldsCSV() throws IOException { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); when(request.getParameter("type")).thenReturn("csv"); String interactionFields = new SchemaController().getInteractionFields(request); assertThat(interactionFields, CoreMatchers.containsString("name,description")); }