}
@Test
public void throwsDeltaCloudClientExceptionOnUnknownResource() {
try {
DeltaCloudClientImpl errorClient = new DeltaCloudClientImpl(MockIntegrationTestContext.DELTACLOUD_URL) {
@Override
public List<Image> listImages() throws DeltaCloudClientException {
request(new DeltaCloudRequest() {
@Override
public URL getUrl() throws MalformedURLException {
return new URL(MockIntegrationTestContext.DELTACLOUD_URL + "/DUMMY");
}
@Override
public HttpMethod getHttpMethod() {
return HttpMethod.GET;
}
@Override
public String getUrlString() {
return null;
}
}
);
return Collections.emptyList();
}
};
errorClient.listImages();
fail("no exception catched");
} catch (Exception e) {
assertEquals(DeltaCloudNotFoundClientException.class, e.getClass());
}
}