@Test public void prefixesTSV() throws IOException { HttpServletRequest request = Mockito.mock(HttpServletRequest.class); when(request.getParameter("type")).thenReturn("tsv"); String prefixes = new SchemaController().getPrefixes(request); assertThat(prefixes, containsString("id_prefix\turl_prefix\turl_suffix")); assertThat(prefixes, containsString("EOL:\thttp: }
@RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody public String getPrefixes(HttpServletRequest request) { String prefixes; if ("csv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes(","); } else if ("tsv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes("\t"); } else { prefixes = jsonPrefixes(); } return prefixes; }
SchemaController { @RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody public String getPrefixes(HttpServletRequest request) { String prefixes; if ("csv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes(","); } else if ("tsv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes("\t"); } else { prefixes = jsonPrefixes(); } return prefixes; } }
SchemaController { @RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody public String getPrefixes(HttpServletRequest request) { String prefixes; if ("csv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes(","); } else if ("tsv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes("\t"); } else { prefixes = jsonPrefixes(); } return prefixes; }  }
SchemaController { @RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody public String getPrefixes(HttpServletRequest request) { String prefixes; if ("csv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes(","); } else if ("tsv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes("\t"); } else { prefixes = jsonPrefixes(); } return prefixes; }  @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); }
SchemaController { @RequestMapping(value = "/prefixes", method = RequestMethod.GET) @ResponseBody public String getPrefixes(HttpServletRequest request) { String prefixes; if ("csv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes(","); } else if ("tsv".equalsIgnoreCase(getRequestType(request))) { prefixes = tabularPrefixes("\t"); } else { prefixes = jsonPrefixes(); } return prefixes; }  @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);  }