Search in sources :

Example 1 with RollbackNetworkError

use of org.onap.so.adapters.nwrest.RollbackNetworkError in project so by onap.

the class NetworkAdapterClientIT method rollbackNetworkTestThrowException.

@Test(expected = NetworkAdapterClientException.class)
public void rollbackNetworkTestThrowException() throws NetworkAdapterClientException, JsonProcessingException {
    RollbackNetworkRequest request = new RollbackNetworkRequest();
    NetworkRollback rollback = new NetworkRollback();
    rollback.setCloudId(TESTING_ID);
    request.setNetworkRollback(rollback);
    RollbackNetworkError mockResponse = new RollbackNetworkError();
    mockResponse.setMessage("Error in rollback network");
    wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
    client.rollbackNetwork(AAI_NETWORK_ID, request);
}
Also used : NetworkRollback(org.onap.so.openstack.beans.NetworkRollback) RollbackNetworkRequest(org.onap.so.adapters.nwrest.RollbackNetworkRequest) RollbackNetworkError(org.onap.so.adapters.nwrest.RollbackNetworkError) BaseIntegrationTest(org.onap.so.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseIntegrationTest (org.onap.so.BaseIntegrationTest)1 RollbackNetworkError (org.onap.so.adapters.nwrest.RollbackNetworkError)1 RollbackNetworkRequest (org.onap.so.adapters.nwrest.RollbackNetworkRequest)1 NetworkRollback (org.onap.so.openstack.beans.NetworkRollback)1