* 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.
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;
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();
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());
}