Clean up of Pair classes - models
[policy/models.git] / models-interactions / model-simulators / src / test / java / org / onap / policy / simulators / GuardSimulatorTest.java
index 7a83778..e553636 100644 (file)
@@ -3,7 +3,7 @@
  * simulators
  * ================================================================================
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import static org.junit.Assert.fail;
 
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.commons.lang3.tuple.Pair;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -36,7 +37,6 @@ import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.models.decisions.concepts.DecisionRequest;
 import org.onap.policy.models.decisions.concepts.DecisionResponse;
 import org.onap.policy.rest.RestManager;
-import org.onap.policy.rest.RestManager.Pair;
 
 public class GuardSimulatorTest {
     private static final StandardCoder coder = new StandardCoder();
@@ -65,18 +65,18 @@ public class GuardSimulatorTest {
         Pair<Integer, String> response =
                 new RestManager().post(url, "testUname", "testPass", null, "application/json", request);
         assertNotNull(response);
-        assertNotNull(response.first);
-        assertNotNull(response.second);
+        assertNotNull(response.getLeft());
+        assertNotNull(response.getRight());
 
-        DecisionResponse decision = coder.decode(response.second, DecisionResponse.class);
+        DecisionResponse decision = coder.decode(response.getRight(), DecisionResponse.class);
         assertEquals("Permit", decision.getStatus());
 
         request = makeRequest("test_actor_id", "test_op_id", "test_target", "denyGuard");
         response = new RestManager().post(url, "testUname", "testPass", null, "application/json", request);
         assertNotNull(response);
-        assertNotNull(response.first);
-        assertNotNull(response.second);
-        decision = coder.decode(response.second, DecisionResponse.class);
+        assertNotNull(response.getLeft());
+        assertNotNull(response.getRight());
+        decision = coder.decode(response.getRight(), DecisionResponse.class);
         assertEquals("Deny", decision.getStatus());
     }