use of org.onap.so.db.catalog.beans.CloudSite in project so by onap.
the class MsoHeatUtilsITTest method getHeatClientOpenStackConnectExceptionTest.
@Test(expected = MsoOpenstackException.class)
public final void getHeatClientOpenStackConnectExceptionTest() throws MsoException, IOException {
CloudIdentity identity = getCloudIdentity();
identity.setIdentityUrl("http://unreachable");
CloudSite cloudSite = getCloudSite(identity);
// mo mocks setup will cause 404 response from wiremock
heatUtils.getHeatClient("MTN13", "TEST-tenant");
}
use of org.onap.so.db.catalog.beans.CloudSite in project so by onap.
the class MsoHeatUtilsITTest method createStackSuccessTest.
@Test
public final void createStackSuccessTest() throws MsoException, IOException {
CloudSite cloudSite = getCloudSite(getCloudIdentity());
StubOpenStack.mockOpenStackResponseAccess(wireMockServer, wireMockPort);
StubOpenStack.mockOpenStackPostStack_200(wireMockServer, "OpenstackResponse_Stack_Created.json");
StubOpenStack.mockOpenStackGet(wireMockServer, "TEST-stack/stackId");
StackInfo stackInfo = heatUtils.createStack(cloudSite.getId(), "CloudOwner", "tenantId", "TEST-stack", null, "TEST-heat", new HashMap<>(), false, 1, "TEST-env", new HashMap<>(), new HashMap<>(), false, false);
assertNotNull(stackInfo);
}
use of org.onap.so.db.catalog.beans.CloudSite in project so by onap.
the class MsoHeatUtilsITTest method getHeatClientSuccessTest.
@Test
public final void getHeatClientSuccessTest() throws MsoException, IOException {
CloudSite cloudSite = getCloudSite(getCloudIdentity());
StubOpenStack.mockOpenStackResponseAccess(wireMockServer, wireMockPort);
Heat heatClient = heatUtils.getHeatClient("MTN13", "TEST-tenant");
assertNotNull(heatClient);
}
use of org.onap.so.db.catalog.beans.CloudSite in project so by onap.
the class MsoHeatUtilsITTest method getHeatClientOpenStackResponseException401Test.
@Test(expected = MsoAdapterException.class)
public final void getHeatClientOpenStackResponseException401Test() throws MsoException, IOException {
CloudSite cloudSite = getCloudSite(getCloudIdentity());
StubOpenStack.mockOpenStackResponseUnauthorized(wireMockServer, wireMockPort);
heatUtils.getHeatClient("MTN13", "TEST-tenant");
}
use of org.onap.so.db.catalog.beans.CloudSite in project so by onap.
the class BaseTest method getCloudSite.
protected CloudSite getCloudSite(CloudIdentity identity) {
CloudSite cloudSite = new CloudSite();
cloudSite.setId("MTN13");
cloudSite.setCloudVersion("3.0");
cloudSite.setClli("MDT13");
cloudSite.setRegionId("mtn13");
cloudSite.setIdentityService(identity);
return cloudSite;
}
Aggregations