@Test void testGetVersion() throws Exception { MvcResult result = mockMvc .perform(options("/api").contentType(APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andReturn(); String actual = result.getResponse().getContentAsString(); String expected = "{\"app\":{\"version\":\"versionString\",\"buildDate\":{\"seconds\":1558434720,\"nanos\":0}}}"; assertEquals(expected, actual); }
@ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) public OptionsResponse getVersion() throws ParseException { Instant date; if (molgenisBuildDate.equals("${maven.build.timestamp}")) { date = now().toInstant(); } else { date = new SimpleDateFormat(VERSION_DATE_FORMAT).parse(molgenisBuildDate).toInstant(); } AppVersionResponse appVersionResponse = AppVersionResponse.create(molgenisVersion, date); return OptionsResponse.create(appVersionResponse); }
RootApiController extends ApiController { @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) public OptionsResponse getVersion() throws ParseException { Instant date; if (molgenisBuildDate.equals("${maven.build.timestamp}")) { date = now().toInstant(); } else { date = new SimpleDateFormat(VERSION_DATE_FORMAT).parse(molgenisBuildDate).toInstant(); } AppVersionResponse appVersionResponse = AppVersionResponse.create(molgenisVersion, date); return OptionsResponse.create(appVersionResponse); } }
RootApiController extends ApiController { @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) public OptionsResponse getVersion() throws ParseException { Instant date; if (molgenisBuildDate.equals("${maven.build.timestamp}")) { date = now().toInstant(); } else { date = new SimpleDateFormat(VERSION_DATE_FORMAT).parse(molgenisBuildDate).toInstant(); } AppVersionResponse appVersionResponse = AppVersionResponse.create(molgenisVersion, date); return OptionsResponse.create(appVersionResponse); } RootApiController(
      @Value("${molgenis.version:@null}") String molgenisVersion,
      @Value("${molgenis.build.date:@null}") String molgenisBuildDate); }
RootApiController extends ApiController { @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) public OptionsResponse getVersion() throws ParseException { Instant date; if (molgenisBuildDate.equals("${maven.build.timestamp}")) { date = now().toInstant(); } else { date = new SimpleDateFormat(VERSION_DATE_FORMAT).parse(molgenisBuildDate).toInstant(); } AppVersionResponse appVersionResponse = AppVersionResponse.create(molgenisVersion, date); return OptionsResponse.create(appVersionResponse); } RootApiController(
      @Value("${molgenis.version:@null}") String molgenisVersion,
      @Value("${molgenis.build.date:@null}") String molgenisBuildDate); @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) OptionsResponse getVersion(); }
RootApiController extends ApiController { @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) public OptionsResponse getVersion() throws ParseException { Instant date; if (molgenisBuildDate.equals("${maven.build.timestamp}")) { date = now().toInstant(); } else { date = new SimpleDateFormat(VERSION_DATE_FORMAT).parse(molgenisBuildDate).toInstant(); } AppVersionResponse appVersionResponse = AppVersionResponse.create(molgenisVersion, date); return OptionsResponse.create(appVersionResponse); } RootApiController(
      @Value("${molgenis.version:@null}") String molgenisVersion,
      @Value("${molgenis.build.date:@null}") String molgenisBuildDate); @ApiOperation( value = "Get the current version and build date of the application.", response = OptionsResponse.class) @RequestMapping(method = OPTIONS) OptionsResponse getVersion(); static final String VERSION_DATE_FORMAT; }