assertEquals(ex, exception);
}
}
public void testReturnVolume() throws Exception {
JAXBParser xmlParser = new JAXBParser("false");
MovedVolume function = new MovedVolume(new ReturnMoveVolumeReference(new JAXBParser("false"),
TypeLiteral.get(MovedVolumeDto.class)));
VolumeManagementDto volume = new VolumeManagementDto();
volume.setName("Test volume");
MovedVolumeDto movedRef = new MovedVolumeDto();
movedRef.setVolume(volume);
HttpResponse response = EasyMock.createMock(HttpResponse.class);
HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(xmlParser.toXML(movedRef).getBytes()));
// Status code is called once
expect(response.getStatusCode()).andReturn(Status.MOVED_PERMANENTLY.getStatusCode());
// Get response gets called twice
expect(exception.getResponse()).andReturn(response);