private static VdcQueryReturnValue createGetDeviceListReturnValue(List<LUNs> luns) {
    VdcQueryReturnValue returnValue = new VdcQueryReturnValue();
    returnValue.setSucceeded(true);
    returnValue.setReturnValue(luns);

    return returnValue;
  }
 private VdcQueryReturnValue createVmQueryResult() {
   final VdcQueryReturnValue v = new VdcQueryReturnValue();
   List<VM> list = new ArrayList<VM>();
   list.add(createVM());
   v.setReturnValue(list);
   v.setSucceeded(true);
   return v;
 }
 /**
  * Run the following test case.
  *
  * <ol>
  *   <li>Run a search query, with *win* as the parameter, searching for VMs
  *   <li>Return success, the success status is succeeded
  *   <li>A success converter defined
  *   <li>Check that the converted value is returned to the callback
  *   <li>Check to make sure the appropriate query start and query complete events are fired
  * </ol>
  */
 @Test
 public void testRunQuery_success_succeeded_eventshandler_converter() {
   Object mockModel = new Object();
   Object mockResultModel = new Object();
   Object mockConvertedModel = new Object();
   when(mockAsyncQuery.getModel()).thenReturn(mockModel);
   when(mockAsyncQuery.getConverter()).thenReturn(mockConverter);
   VdcQueryParametersBase testParameters =
       new SearchParameters("*win*", SearchType.VM); // $NON-NLS-1$
   frontend.runQuery(VdcQueryType.Search, testParameters, mockAsyncQuery, false);
   verify(mockService).RunQuery(eq(VdcQueryType.Search), eq(testParameters), callback.capture());
   VdcQueryReturnValue mockReturnValue = new VdcQueryReturnValue();
   mockReturnValue.setReturnValue(mockResultModel);
   mockReturnValue.setExceptionString("USER_IS_NOT_LOGGED_IN"); // $NON-NLS-1$
   when(mockConverter.Convert(mockResultModel, mockAsyncQuery)).thenReturn(mockConvertedModel);
   // Return value set to success
   mockReturnValue.setSucceeded(true);
   callback.getValue().onSuccess(mockReturnValue);
   verify(mockAsyncQuery).setOriginalReturnValue(mockReturnValue);
   verify(mockAsyncCallback).onSuccess(mockModel, mockConvertedModel);
 }
 @Override
 public void setReturnValue(Object value) {
   returnValue.setReturnValue(value);
 }
 private VdcQueryReturnValue createDuplicateResult() {
   final VdcQueryReturnValue v = new VdcQueryReturnValue();
   v.setReturnValue(Boolean.FALSE);
   v.setSucceeded(true);
   return v;
 }
 private VdcQueryReturnValue getVdcReturnValue() {
   VdcQueryReturnValue retValue = new VdcQueryReturnValue();
   retValue.setSucceeded(true);
   retValue.setReturnValue(serverKeyFingerprint);
   return retValue;
 }