use of org.onap.so.adapters.vnfrest.UpdateVfModuleRequest 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.UpdateVfModuleRequest in project so by onap.
the class VnfAdapterClientIT method updateVfModuleTest.
@Test
public void updateVfModuleTest() throws JsonProcessingException, VnfAdapterClientException {
UpdateVfModuleRequest request = new UpdateVfModuleRequest();
request.setCloudSiteId(TESTING_ID);
request.setVfModuleId("test1");
UpdateVfModuleResponse mockResponse = new UpdateVfModuleResponse();
mockResponse.setVfModuleId("test1");
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(200)));
UpdateVfModuleResponse response = client.updateVfModule(AAI_VNF_ID, AAI_VF_MODULE_ID, request);
assertEquals("Testing UpdateVfModule response", "test1", response.getVfModuleId());
}
Aggregations