use of org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse in project so by onap.
the class VnfVolumeAdapterClientIT method updateVolumeGroupTest.
@Test
public void updateVolumeGroupTest() throws VnfAdapterClientException {
UpdateVolumeGroupRequest request = new UpdateVolumeGroupRequest();
UpdateVolumeGroupResponse mockResponse = new UpdateVolumeGroupResponse();
mockResponse.setVolumeGroupId(AAI_VOLUME_GROUP_ID);
VnfVolumeAdapterClientImpl client = spy(VnfVolumeAdapterClientImpl.class);
AdapterRestClient mockClient = mock(AdapterRestClient.class);
doReturn(mockClient).when(client).getAdapterRestClient("/" + AAI_VOLUME_GROUP_ID);
when(mockClient.put(request, UpdateVolumeGroupResponse.class)).thenReturn(mockResponse);
MockitoAnnotations.initMocks(this);
UpdateVolumeGroupResponse response = client.updateVNFVolumes(AAI_VOLUME_GROUP_ID, request);
assertEquals("Testing DeleteVfModule response", mockResponse.getVolumeGroupId(), response.getVolumeGroupId());
}
use of org.onap.so.adapters.vnfrest.UpdateVolumeGroupResponse in project so by onap.
the class VnfVolumeAdapterClientIT method updateVolumeGroupTestThrowException.
@Test(expected = VnfAdapterClientException.class)
public void updateVolumeGroupTestThrowException() throws VnfAdapterClientException {
UpdateVolumeGroupRequest request = new UpdateVolumeGroupRequest();
UpdateVolumeGroupResponse mockResponse = new UpdateVolumeGroupResponse();
mockResponse.setVolumeGroupId(AAI_VOLUME_GROUP_ID);
VnfVolumeAdapterClientImpl client = spy(VnfVolumeAdapterClientImpl.class);
AdapterRestClient mockClient = mock(AdapterRestClient.class);
doReturn(mockClient).when(client).getAdapterRestClient("/" + AAI_VOLUME_GROUP_ID);
when(mockClient.put(request, UpdateVolumeGroupResponse.class)).thenThrow(new InternalServerErrorException("Error in update volume group"));
MockitoAnnotations.initMocks(this);
client.updateVNFVolumes(AAI_VOLUME_GROUP_ID, request);
}
Aggregations