use of org.onap.so.openstack.beans.NetworkRollback in project so by onap.
the class NetworkAdapterClientIT method rollbackNetworkTest.
@Test
public void rollbackNetworkTest() throws NetworkAdapterClientException, JsonProcessingException {
RollbackNetworkRequest request = new RollbackNetworkRequest();
NetworkRollback rollback = new NetworkRollback();
rollback.setCloudId(TESTING_ID);
request.setNetworkRollback(rollback);
RollbackNetworkResponse mockResponse = new RollbackNetworkResponse();
mockResponse.setNetworkRolledBack(true);
wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(200)));
RollbackNetworkResponse response = client.rollbackNetwork(AAI_NETWORK_ID, request);
assertEquals("Testing DeleteVfModule response", true, response.getNetworkRolledBack());
}
use of org.onap.so.openstack.beans.NetworkRollback in project so by onap.
the class NetworkAdapterObjectMapper method buildNetworkRollback.
private NetworkRollback buildNetworkRollback(L3Network l3Network, CloudRegion cloudRegion, String cloudRegionPo, CreateNetworkResponse createNetworkResponse) {
NetworkRollback networkRollback = new NetworkRollback();
networkRollback.setNetworkId(l3Network.getNetworkId());
networkRollback.setNeutronNetworkId(createNetworkResponse.getMessageId());
networkRollback.setNetworkStackId(createNetworkResponse.getNetworkStackId());
networkRollback.setTenantId(cloudRegion.getTenantId());
networkRollback.setCloudId(cloudRegionPo);
networkRollback.setNetworkType(l3Network.getNetworkType());
ModelInfoNetwork modelInfoNetwork = l3Network.getModelInfoNetwork();
if (modelInfoNetwork != null) {
networkRollback.setModelCustomizationUuid(modelInfoNetwork.getModelCustomizationUUID());
}
// rollback will only be called when network was actually created
networkRollback.setNetworkCreated(createNetworkResponse.getNetworkCreated());
// msoRequest
return networkRollback;
}
Aggregations