aboutsummaryrefslogtreecommitdiffstats
path: root/feature-healthcheck/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'feature-healthcheck/src/test/java')
-rw-r--r--feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckFeatureTest.java26
-rw-r--r--feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckTest.java10
2 files changed, 19 insertions, 17 deletions
diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckFeatureTest.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckFeatureTest.java
index 42d77f26..4d93af23 100644
--- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckFeatureTest.java
+++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckFeatureTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* feature-healthcheck
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@ import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.drools.healthcheck.HealthCheck.Report;
import org.onap.policy.drools.healthcheck.HealthCheck.Reports;
-import org.onap.policy.drools.persistence.SystemPersistence;
-import org.onap.policy.drools.system.PolicyEngine;
+import org.onap.policy.drools.persistence.SystemPersistenceConstants;
+import org.onap.policy.drools.system.PolicyEngineConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,11 +54,13 @@ public class HealthCheckFeatureTest {
*/
private static final String HEALTH_CHECK_PROPERTIES_FILE = "feature-healthcheck.properties";
- private static final Path healthCheckPropsPath = Paths
- .get(SystemPersistence.manager.getConfigurationPath().toString(), HEALTH_CHECK_PROPERTIES_FILE);
+ private static final Path healthCheckPropsPath =
+ Paths.get(SystemPersistenceConstants.getManager().getConfigurationPath().toString(),
+ HEALTH_CHECK_PROPERTIES_FILE);
- private static final Path healthCheckPropsBackupPath = Paths.get(
- SystemPersistence.manager.getConfigurationPath().toString(), HEALTH_CHECK_PROPERTIES_FILE + ".bak");
+ private static final Path healthCheckPropsBackupPath =
+ Paths.get(SystemPersistenceConstants.getManager().getConfigurationPath().toString(),
+ HEALTH_CHECK_PROPERTIES_FILE + ".bak");
private static final String EXPECTED = "expected exception";
@@ -131,13 +133,13 @@ public class HealthCheckFeatureTest {
public void test() throws IOException, InterruptedException {
HealthCheckFeature feature = new HealthCheckFeature();
- feature.afterStart(PolicyEngine.manager);
+ feature.afterStart(PolicyEngineConstants.getManager());
if (!NetworkUtil.isTcpPortOpen("localhost", 7777, 5, 10000L)) {
throw new IllegalStateException("cannot connect to port " + 7777);
}
- Reports reports = HealthCheck.monitor.healthCheck();
+ Reports reports = HealthCheckConstants.getManager().healthCheck();
assertTrue(reports.getDetails().size() > 0);
@@ -150,7 +152,7 @@ public class HealthCheckFeatureTest {
}
}
- feature.afterShutdown(PolicyEngine.manager);
+ feature.afterShutdown(PolicyEngineConstants.getManager());
}
@@ -197,7 +199,7 @@ public class HealthCheckFeatureTest {
File origPropsFile = new File(healthCheckPropsPath.toString());
File backupPropsFile = new File(healthCheckPropsBackupPath.toString());
- Path configDir = Paths.get(SystemPersistence.DEFAULT_CONFIGURATION_DIR);
+ Path configDir = Paths.get(SystemPersistenceConstants.DEFAULT_CONFIGURATION_DIR);
try {
@@ -243,7 +245,7 @@ public class HealthCheckFeatureTest {
}
@Override
- public HealthCheck getMonitor() {
+ public HealthCheck getManager() {
return checker;
}
diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckTest.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckTest.java
index 2bf1cca5..62c6c951 100644
--- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckTest.java
+++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckTest.java
@@ -70,7 +70,7 @@ public class HealthCheckTest {
private List<HttpServletServer> servers;
private List<HttpClient> clients;
private PolicyEngine engineMgr;
- private HealthCheckMonitor monitor;
+ private HealthCheckManager monitor;
/**
* Initializes the object to be tested.
@@ -310,23 +310,23 @@ public class HealthCheckTest {
@Test
public void testHealthCheckMonitor_GetEngineManager() {
- assertNotNull(new HealthCheckMonitor().getEngineManager());
+ assertNotNull(new HealthCheckManager().getEngineManager());
}
@Test
public void testHealthCheckMonitor_GetServerFactory() {
- assertNotNull(new HealthCheckMonitor().getServerFactory());
+ assertNotNull(new HealthCheckManager().getServerFactory());
}
@Test
public void testHealthCheckMonitor_GetClientFactory() {
- assertNotNull(new HealthCheckMonitor().getClientFactory());
+ assertNotNull(new HealthCheckManager().getClientFactory());
}
/**
* Monitor with overrides.
*/
- private class HealthCheckMonitorImpl extends HealthCheckMonitor {
+ private class HealthCheckMonitorImpl extends HealthCheckManager {
@Override
protected PolicyEngine getEngineManager() {