aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/test/java')
-rw-r--r--main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java11
-rw-r--r--main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java5
2 files changed, 8 insertions, 8 deletions
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
index 43ccab04..5ff3d5c7 100644
--- a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
+++ b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java
@@ -35,7 +35,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
@@ -59,7 +58,7 @@ public class XacmlStateTest {
@Mock
private XacmlPdpActivator act;
- private String hostName;
+ private String pdpName;
private XacmlState state;
@@ -68,7 +67,7 @@ public class XacmlStateTest {
*/
@Before
public void setUp() {
- hostName = NetworkUtil.getHostname();
+ pdpName = XacmlState.PDP_NAME;
XacmlPdpActivator.setCurrent(act);
@@ -85,7 +84,7 @@ public class XacmlStateTest {
PdpUpdate msg = new PdpUpdate();
assertFalse(state.shouldHandle(msg));
- msg.setName(NetworkUtil.getHostname());
+ msg.setName(XacmlState.PDP_NAME);
assertTrue(state.shouldHandle(msg));
}
@@ -94,7 +93,7 @@ public class XacmlStateTest {
// not healthy
PdpStatus status = state.genHeartbeat();
assertEquals(PdpHealthStatus.NOT_HEALTHY, status.getHealthy());
- assertEquals(hostName, status.getName());
+ assertEquals(pdpName, status.getName());
assertEquals(GROUP, status.getPdpGroup());
assertEquals(PDP_TYPE, status.getPdpType());
assertEquals(PdpState.PASSIVE, status.getState());
@@ -110,7 +109,7 @@ public class XacmlStateTest {
@Test
public void testUpdateInternalStatePdpStateChange() {
PdpStateChange req = new PdpStateChange();
- req.setName(hostName);
+ req.setName(pdpName);
req.setPdpGroup("wrong-pdp-group");
req.setPdpSubgroup(SUBGROUP);
req.setState(STATE);
diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java
index 7865851d..a8a7b84d 100644
--- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java
+++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019, 2021 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.
@@ -26,6 +26,7 @@ import javax.ws.rs.client.Invocation;
import org.junit.Test;
import org.onap.policy.common.endpoints.report.HealthCheckReport;
import org.onap.policy.pdpx.main.CommonRest;
+import org.onap.policy.pdpx.main.XacmlState;
import org.onap.policy.pdpx.main.rest.model.StatisticsReport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,7 +41,7 @@ public class TestXacmlPdpRestServer extends CommonRest {
private static final String NOT_ALIVE = "not alive";
private static final String ALIVE = "alive";
private static final String SELF = "self";
- private static final String NAME = "Policy Xacml PDP";
+ private static final String NAME = XacmlState.PDP_NAME;
private static final String HEALTHCHECK_ENDPOINT = "healthcheck";
private static final String STATISTICS_ENDPOINT = "statistics";