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);
}
Aggregations