Mockito.when(image.getPrimaryDataStore()).thenReturn(primaryStore);
ImageDataStoreTO imageStore = Mockito.mock(ImageDataStoreTO.class);
Mockito.when(imageStore.getType()).thenReturn("http");
TemplateTO template = Mockito.mock(TemplateTO.class);
Mockito.when(template.getPath()).thenReturn(this.getTemplateUrl());
Mockito.when(template.getImageDataStore()).thenReturn(imageStore);
Mockito.when(image.getTemplate()).thenReturn(template);
//CopyTemplateToPrimaryStorageCmd cmd = new CopyTemplateToPrimaryStorageCmd(image);
Command cmd = null;
try {