use of org.onap.so.adapters.vnfrest.VfModuleExceptionResponse in project so by onap.
the class VnfAdapterClientIT method updateVfModuleTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void updateVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
UpdateVfModuleRequest request = new UpdateVfModuleRequest();
request.setCloudSiteId(TESTING_ID);
request.setVfModuleId("test1");
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in update Vf module");
wireMockServer.stubFor(put(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID)).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
client.updateVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
}
use of org.onap.so.adapters.vnfrest.VfModuleExceptionResponse in project so by onap.
the class VnfAdapterClientIT method rollbackVfModuleTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void rollbackVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
RollbackVfModuleRequest request = new RollbackVfModuleRequest();
VfModuleRollback rollback = new VfModuleRollback();
rollback.setCloudSiteId(TESTING_ID);
request.setVfModuleRollback(rollback);
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in rollback Vf module");
wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID + "/rollback")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
client.rollbackVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
}
use of org.onap.so.adapters.vnfrest.VfModuleExceptionResponse in project so by onap.
the class VnfAdapterClientIT method queryVfModuleTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void queryVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in update Vf module");
wireMockServer.stubFor(get(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID)).withQueryParam("cloudSiteId", equalTo(TESTING_ID)).withQueryParam("tenantId", equalTo(TESTING_ID)).withQueryParam("vfModuleName", equalTo("someName")).withQueryParam("skipAAI", equalTo("true")).withQueryParam("msoRequest.requestId", equalTo("testRequestId")).withQueryParam("msoRequest.serviceInstanceId", equalTo("serviceInstanceId")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
client.queryVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, TESTING_ID, TESTING_ID, "someName", true, "testRequestId", "serviceInstanceId");
}
use of org.onap.so.adapters.vnfrest.VfModuleExceptionResponse in project so by onap.
the class VnfAdapterClientIT method createVfModuleTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void createVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
CreateVfModuleRequest request = new CreateVfModuleRequest();
request.setCloudSiteId(TESTING_ID);
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in create Vf module");
wireMockServer.stubFor(post(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
client.createVfModule(AAI_VNF_ID, request);
}
use of org.onap.so.adapters.vnfrest.VfModuleExceptionResponse in project so by onap.
the class VnfAdapterClientIT method deleteVfModuleTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void deleteVfModuleTestThrowException() throws JsonProcessingException, VnfAdapterClientException {
DeleteVfModuleRequest request = new DeleteVfModuleRequest();
request.setCloudSiteId(TESTING_ID);
VfModuleExceptionResponse mockResponse = new VfModuleExceptionResponse();
mockResponse.setMessage("Error in delete Vf module");
wireMockServer.stubFor(delete(urlPathEqualTo(REST_ENDPOINT + "/" + AAI_VNF_ID + "/vf-modules/" + AAI_VF_MODULE_ID)).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(mapper.writeValueAsString(mockResponse)).withStatus(500)));
client.deleteVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
}
Aggregations