Search in sources :

Example 1 with DeleteNetworkError

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

the class NetworkAdapterClientIT method deleteNetworkTestThrowException.

@Test(expected = NetworkAdapterClientException.class)
public void deleteNetworkTestThrowException() throws NetworkAdapterClientException, JsonProcessingException {
    DeleteNetworkRequest request = new DeleteNetworkRequest();
    request.setCloudSiteId(TESTING_ID);
    DeleteNetworkError mockResponse = new DeleteNetworkError();
    mockResponse.setMessage("Error in delete network");
    wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_NETWORK_ID)).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
    client.deleteNetwork(AAI_NETWORK_ID, request);
}
Also used : DeleteNetworkRequest(org.onap.so.adapters.nwrest.DeleteNetworkRequest) DeleteNetworkError(org.onap.so.adapters.nwrest.DeleteNetworkError) BaseIntegrationTest(org.onap.so.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BaseIntegrationTest (org.onap.so.BaseIntegrationTest)1 DeleteNetworkError (org.onap.so.adapters.nwrest.DeleteNetworkError)1 DeleteNetworkRequest (org.onap.so.adapters.nwrest.DeleteNetworkRequest)1