* simulators
* ================================================================================
* Copyright (C) 2017-2020 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.UUID;
+import org.apache.commons.lang3.tuple.Pair;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.rest.RestManager;
-import org.onap.policy.rest.RestManager.Pair;
import org.onap.policy.so.SoCloudConfiguration;
import org.onap.policy.so.SoModelInfo;
import org.onap.policy.so.SoRelatedInstance;
"username",
"password", new HashMap<>(), "application/json", request);
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"COMPLETE\"").contains("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"COMPLETE\"").contains("requestSelfLink");
/*
* Repeat, but set the flag indicating that the request should yield incomplete.
"username",
"password", new HashMap<>(), "application/json", request);
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("requestSelfLink").doesNotContain("\"COMPLETE\"");
+ assertThat(httpDetails.getRight()).contains("requestSelfLink").doesNotContain("\"COMPLETE\"");
// now poll for the response
- String uri = extractUri(httpDetails.second);
+ String uri = extractUri(httpDetails.getRight());
httpDetails = new RestManager().get(
"http://localhost:6667/orchestrationRequests/v5/" + uri,
"username",
"password", new HashMap<>());
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"IN_PROGRESS\"").doesNotContain("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"IN_PROGRESS\"").doesNotContain("requestSelfLink");
// poll again
httpDetails = new RestManager().get(
"username",
"password", new HashMap<>());
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"COMPLETE\"").doesNotContain("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"COMPLETE\"").doesNotContain("requestSelfLink");
}
@Test
"username",
"password", new HashMap<>(), "application/json", request);
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"COMPLETE\"").contains("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"COMPLETE\"").contains("requestSelfLink");
/*
* Repeat, but set the flag indicating that the request should yield incomplete.
"username",
"password", new HashMap<>(), "application/json", request);
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("requestSelfLink").doesNotContain("\"COMPLETE\"");
+ assertThat(httpDetails.getRight()).contains("requestSelfLink").doesNotContain("\"COMPLETE\"");
// now poll for the response
- String uri = extractUri(httpDetails.second);
+ String uri = extractUri(httpDetails.getRight());
httpDetails = new RestManager().get(
"http://localhost:6667/orchestrationRequests/v5/" + uri,
"username",
"password", new HashMap<>());
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"IN_PROGRESS\"").doesNotContain("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"IN_PROGRESS\"").doesNotContain("requestSelfLink");
// poll again
httpDetails = new RestManager().get(
"username",
"password", new HashMap<>());
assertNotNull(httpDetails);
- assertThat(httpDetails.second).contains("\"COMPLETE\"").doesNotContain("requestSelfLink");
+ assertThat(httpDetails.getRight()).contains("\"COMPLETE\"").doesNotContain("requestSelfLink");
}
private String extractUri(String response) {