### Question:
SchemaController { @RequestMapping(value = "/interactionTypes", method = RequestMethod.GET) @ResponseBody public String getInteractionTypes(HttpServletRequest request) throws IOException { Collection<InteractionTypeExternal> availableTypes = Arrays.asList(InteractionTypeExternal.values()); if (request != null) { if (StringUtils.isNotBlank(request.getParameter(ParamName.TAXON.getName()))) { CypherQuery cypherQuery = CypherQueryBuilder.buildInteractionTypeQuery(request.getParameterMap()); String interactionTypes = new ResultFormatterCSV().format(CypherUtil.executeRemote(cypherQuery)); String[] interactionType = StringUtils.replace(interactionTypes, "\"", "").split("\n"); availableTypes = new HashSet<InteractionTypeExternal>(); for (String type : interactionType) { InteractionTypeExternal value = CypherQueryBuilder.INTERACTION_TYPE_INTERNAL_EXTERNAL_MAP.get(type); if (value != null) { availableTypes.add(value); } } } } return "csv".equals(getRequestType(request)) ? interactionMapCsv(availableTypes) : interactionMapJson(availableTypes); }  @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 interactionTypes() throws IOException { String interactionTypes = new SchemaController().getInteractionTypes(null); assertThat(interactionTypes, is(notNullValue())); }
@Test public void interactionTypesCSV() throws IOException { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); when(request.getParameter("type")).thenReturn("csv"); String interactionTypes = new SchemaController().getInteractionTypes(request); LabeledCSVParser parser = CSVTSVUtil.createLabeledCSVParser(IOUtils.toInputStream(interactionTypes, StandardCharsets.UTF_8)); assertThat(parser.getLabels(), is(new String[]{"interaction", "source", "target", "termIRI"})); while (parser.getLine() != null) { assertThat(parser.getValueByLabel("interaction"), is(notNullValue())); assertThat(parser.getValueByLabel("source"), is(notNullValue())); assertThat(parser.getValueByLabel("target"), is(notNullValue())); assertThat(parser.getValueByLabel("termIRI"), is(notNullValue())); } }
@Test public void findSupportedInteractionTypes() throws IOException { String interactionTypes = new SchemaController().getInteractionTypes(null); ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = mapper.readTree(interactionTypes); for (JsonNode interactionType : jsonNode) { assertThat(interactionType.has("source"), is(true)); assertThat(interactionType.has("target"), is(true)); assertThat(interactionType.has("termIRI"), is(true)); } assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_HAS_PARASITE), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_PARASITE_OF), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_PREYED_UPON_BY), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_PREYS_ON), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_HAS_PATHOGEN), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_SYMBIONT_OF), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_INTERACTS_WITH), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_KILLS), is(true)); assertThat(jsonNode.has(CypherQueryBuilder.INTERACTION_KILLED_BY), is(true)); }