@Test public void testGetInfo() { String version = "version"; String buildDate = "buildDate"; boolean devMode = true; when(configurationService.getVersion()).thenReturn(version); when(configurationService.getBuildDate()).thenReturn(buildDate); when(configurationService.isDevMode()).thenReturn(devMode); infoResource = new InfoResourceImpl(configurationService); Response response = infoResource.getInfo(); assertThat(response.getStatus()) .isEqualTo(Response.Status.OK.getStatusCode()); ApplicationInfo info = (ApplicationInfo)response.getEntity(); assertThat(info.getName()).isEqualTo(MTStartup.APPLICATION_NAME); assertThat(info.getVersion()).isEqualTo(version); assertThat(info.getBuildDate()).isEqualTo(buildDate); assertThat(info.isDevMode()).isEqualTo(devMode); }
@Override public Response getInfo() { ApplicationInfo info = new ApplicationInfo(MTStartup.APPLICATION_NAME, configurationService.getVersion(), configurationService.getBuildDate(), configurationService.isDevMode()); return Response.ok().entity(info).build(); }
InfoResourceImpl implements InfoResource { @Override public Response getInfo() { ApplicationInfo info = new ApplicationInfo(MTStartup.APPLICATION_NAME, configurationService.getVersion(), configurationService.getBuildDate(), configurationService.isDevMode()); return Response.ok().entity(info).build(); } }
InfoResourceImpl implements InfoResource { @Override public Response getInfo() { ApplicationInfo info = new ApplicationInfo(MTStartup.APPLICATION_NAME, configurationService.getVersion(), configurationService.getBuildDate(), configurationService.isDevMode()); return Response.ok().entity(info).build(); } @SuppressWarnings("unused")  InfoResourceImpl(); @Inject  InfoResourceImpl(ConfigurationService configurationService); }
InfoResourceImpl implements InfoResource { @Override public Response getInfo() { ApplicationInfo info = new ApplicationInfo(MTStartup.APPLICATION_NAME, configurationService.getVersion(), configurationService.getBuildDate(), configurationService.isDevMode()); return Response.ok().entity(info).build(); } @SuppressWarnings("unused")  InfoResourceImpl(); @Inject  InfoResourceImpl(ConfigurationService configurationService); @Override Response getInfo(); }
InfoResourceImpl implements InfoResource { @Override public Response getInfo() { ApplicationInfo info = new ApplicationInfo(MTStartup.APPLICATION_NAME, configurationService.getVersion(), configurationService.getBuildDate(), configurationService.isDevMode()); return Response.ok().entity(info).build(); } @SuppressWarnings("unused")  InfoResourceImpl(); @Inject  InfoResourceImpl(ConfigurationService configurationService); @Override Response getInfo();  }