@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")); }
@RequestMapping(value = "/interactionFields", method = RequestMethod.GET) @ResponseBody public String getInteractionFields(HttpServletRequest request) throws IOException { return "csv".equals(getRequestType(request)) ? csvFields() : jsonFields(); }
SchemaController { @RequestMapping(value = "/interactionFields", method = RequestMethod.GET) @ResponseBody public String getInteractionFields(HttpServletRequest request) throws IOException { return "csv".equals(getRequestType(request)) ? csvFields() : jsonFields(); } }
SchemaController { @RequestMapping(value = "/interactionFields", method = RequestMethod.GET) @ResponseBody public String getInteractionFields(HttpServletRequest request) throws IOException { return "csv".equals(getRequestType(request)) ? csvFields() : jsonFields(); }  }
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); }
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);  }