|
61 | 61 | import com.cloud.storage.VMTemplateVO; |
62 | 62 | import com.cloud.storage.dao.VMTemplateDao; |
63 | 63 | import com.cloud.template.TemplateApiService; |
64 | | -import com.cloud.template.VirtualMachineTemplate; |
65 | 64 | import com.cloud.user.Account; |
66 | 65 | import com.cloud.user.AccountManager; |
67 | 66 | import com.cloud.user.AccountVO; |
@@ -213,17 +212,13 @@ public void addKubernetesSupportedVersionIsoUrlTest() throws ResourceAllocationE |
213 | 212 | when(cmd.getChecksum()).thenReturn(null); |
214 | 213 | when(cmd.getMinimumCpu()).thenReturn(KubernetesClusterService.MIN_KUBERNETES_CLUSTER_NODE_CPU); |
215 | 214 | when(cmd.getMinimumRamSize()).thenReturn(KubernetesClusterService.MIN_KUBERNETES_CLUSTER_NODE_RAM_SIZE); |
216 | | - Account systemAccount = new AccountVO("system", 1L, "", Account.Type.ADMIN, "uuid"); |
217 | | - when(accountManager.getSystemAccount()).thenReturn(systemAccount); |
218 | 215 | CallContext callContext = Mockito.mock(CallContext.class); |
219 | 216 | try (MockedStatic<ComponentContext> mockedComponentContext = Mockito.mockStatic(ComponentContext.class); |
220 | 217 | MockedStatic<CallContext> mockedCallContext = Mockito.mockStatic(CallContext.class)) { |
221 | 218 | mockedComponentContext.when(() -> ComponentContext.inject(Mockito.any(RegisterIsoCmd.class))).thenReturn( |
222 | 219 | new RegisterIsoCmd()); |
223 | 220 | mockedCallContext.when(CallContext::current).thenReturn(callContext); |
224 | 221 |
|
225 | | - when(templateService.registerIso(Mockito.any(RegisterIsoCmd.class))).thenReturn( |
226 | | - Mockito.mock(VirtualMachineTemplate.class)); |
227 | 222 | VMTemplateVO templateVO = Mockito.mock(VMTemplateVO.class); |
228 | 223 | when(templateVO.getId()).thenReturn(1L); |
229 | 224 | when(templateDao.findById(Mockito.anyLong())).thenReturn(templateVO); |
|
0 commit comments