/** Test query execution */ private void internalExecuteQuery() { // Run 'GetDeviceList' command VDSReturnValue returnValue = new VDSReturnValue(); returnValue.setSucceeded(true); returnValue.setReturnValue(lunsInput); when(vdsBrokerFrontendMock.RunVdsCommand( eq(VDSCommandType.GetDeviceList), any(GetDeviceListVDSCommandParameters.class))) .thenReturn(returnValue); // Return 'lunsFromDb' when(lunDaoMock.getAll()).thenReturn(lunsFromDb); // Execute command getQuery().executeQueryCommand(); // Assert the query's results List<LUNs> lunsActual = getQuery().getQueryReturnValue().getReturnValue(); assertEquals(lunsExpected, lunsActual); }
private void expectGetLunsForVg(String vgId, boolean withDummyLun) { when(lunDao.getAllForVolumeGroup(vgId)).thenReturn(setUpLuns(withDummyLun)); }