### Question:
ImageManager { public String createVmImage(ImageToUpload imageToUpload) throws CloudMiddlewareException { log.debug("CreateVMImage: " + imageToUpload.getName()); return cloudMiddleware.createVmImage(imageToUpload); } ImageManager(CloudMiddleware cloudMiddleware); List<ImageUploaded> getVmImages(); String createVmImage(ImageToUpload imageToUpload); ImageUploaded getVmImage(String imageId); void deleteVmImage(String id); List<String> getVmImagesIds();  }### Answer:
@Test public void createVmImage() throws Exception { String mockedCloudMiddlewareResponse = "NewImageId"; ImageToUpload imageToBeCreated = new ImageToUpload("newImageName", "http: Mockito.when(mockedCloudMiddleware.createVmImage(imageToBeCreated)).thenReturn(mockedCloudMiddlewareResponse); assertEquals(mockedCloudMiddlewareResponse, imageManager.createVmImage(imageToBeCreated)); }