Search in sources :

Example 1 with UpdateVfModuleRequest

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);
}
Also used : UpdateVfModuleRequest(org.onap.so.adapters.vnfrest.UpdateVfModuleRequest) VfModuleExceptionResponse(org.onap.so.adapters.vnfrest.VfModuleExceptionResponse) BaseIntegrationTest(org.onap.so.BaseIntegrationTest) Test(org.junit.Test)

Example 2 with UpdateVfModuleRequest

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());
}
Also used : UpdateVfModuleRequest(org.onap.so.adapters.vnfrest.UpdateVfModuleRequest) UpdateVfModuleResponse(org.onap.so.adapters.vnfrest.UpdateVfModuleResponse) BaseIntegrationTest(org.onap.so.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 BaseIntegrationTest (org.onap.so.BaseIntegrationTest)2 UpdateVfModuleRequest (org.onap.so.adapters.vnfrest.UpdateVfModuleRequest)2 UpdateVfModuleResponse (org.onap.so.adapters.vnfrest.UpdateVfModuleResponse)1 VfModuleExceptionResponse (org.onap.so.adapters.vnfrest.VfModuleExceptionResponse)1