summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main
diff options
context:
space:
mode:
authorJoanna Jeremicz <joanna.jeremicz@nokia.com>2018-09-19 10:33:39 +0200
committerJoanna Jeremicz <joanna.jeremicz@nokia.com>2018-09-25 07:43:45 +0200
commitf24045484892ec59f5aff1c42252ae0ec10e2f66 (patch)
tree990d3605bffbe7e7facf3101aff6ca5929204a7e /vid-app-common/src/main
parente40ad0f69d7e1241dbb0fd17412067353c44eb85 (diff)
Add junits to commit info endpoint
Change-Id: I0a904ba7259bee2c10cde0a3c6be0552b03cfeb2 Issue-ID: VID-311 Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
Diffstat (limited to 'vid-app-common/src/main')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controllers/HealthCheckController.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/HealthCheckController.java b/vid-app-common/src/main/java/org/onap/vid/controllers/HealthCheckController.java
index 03dc8083..12cc68e6 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controllers/HealthCheckController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controllers/HealthCheckController.java
@@ -25,6 +25,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.util.SystemProperties;
import org.onap.vid.dao.FnAppDoaImpl;
import org.onap.vid.model.GitRepositoryState;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -46,7 +47,6 @@ import java.util.Properties;
@RequestMapping("/")
public class HealthCheckController extends UnRestrictedBaseController {
-
/**
* The logger.
*/
@@ -58,6 +58,7 @@ public class HealthCheckController extends UnRestrictedBaseController {
final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
private static final String HEALTH_CHECK_PATH = "/healthCheck";
+ private static final String GIT_PROPERTIES_FILENAME = "git.properties";
/**
* Model for JSON response with health-check results.
@@ -193,10 +194,10 @@ public class HealthCheckController extends UnRestrictedBaseController {
return healthStatus;
}
- @RequestMapping(value = "/version", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ @RequestMapping(value = "/commitInfo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public GitRepositoryState getCommitInfo() throws IOException {
Properties properties = new Properties();
- properties.load(getClass().getClassLoader().getResourceAsStream("git.properties"));
+ properties.load(getClass().getClassLoader().getResourceAsStream(GIT_PROPERTIES_FILENAME));
return new GitRepositoryState(properties);
}
}