@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)); }
public String createVmImage(ImageToUpload imageToUpload) throws CloudMiddlewareException { log.debug("CreateVMImage: " + imageToUpload.getName()); return cloudMiddleware.createVmImage(imageToUpload); }
ImageManager { public String createVmImage(ImageToUpload imageToUpload) throws CloudMiddlewareException { log.debug("CreateVMImage: " + imageToUpload.getName()); return cloudMiddleware.createVmImage(imageToUpload); } }
ImageManager { public String createVmImage(ImageToUpload imageToUpload) throws CloudMiddlewareException { log.debug("CreateVMImage: " + imageToUpload.getName()); return cloudMiddleware.createVmImage(imageToUpload); } ImageManager(CloudMiddleware cloudMiddleware); }
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(); }
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();  }