SoftwareManagementClient implements SoftwareManagement.Iface { @Override public OperationStatusWithDetail getOperationStatusWithDetail( String targetName) { try { return managementClient.getOperationStatusWithDetail(targetName); } catch (ClusterOperationException e) { logger.error("Failed to get operation status for target: " + targetName); throw SoftwareManagementException.GET_OPERATIOIN_STATUS_FAILURE(e, targetName, e.getMessage()); } catch (Throwable t) { throw SoftwareManagementException.GET_OPERATIOIN_STATUS_UNKNOWN_ERROR( t, targetName); } }  void init(); void close(); @Override int runClusterOperation(ClusterOperation clusterOperation); @Override OperationStatusWithDetail getOperationStatusWithDetail(
         String targetName); @Override void resetNodeProvisionAttribute(String targetName);  }
@Test(groups = { "software-management" }) public void getOperationStatusWithDetail() { ClusterData serverClusterData = new ClusterData(); serverClusterData.setClusterName(clusterName); Map<String, GroupData> serverGroups = new HashMap<String, GroupData>(); GroupData serverGroup1 = new GroupData(); serverGroup1.setGroupName("group1"); serverGroups.put("group1", serverGroup1); serverClusterData.setGroups(serverGroups); OperationStatusWithDetail serverStatus = new OperationStatusWithDetail(); serverStatus.setClusterData(serverClusterData); try { when(handler.getOperationStatusWithDetail(clusterName)).thenReturn(serverStatus); } catch (TException e) { fail("Exception when calling getOperationStatusWithDetail", e); } OperationStatusWithDetail status = client.getOperationStatusWithDetail(clusterName); assertNotNull(status); ClusterData clientClusterData = status.getClusterData(); assertEquals(serverClusterData.getClusterName(), clientClusterData.getClusterName()); Map<String, GroupData> clientGroups = clientClusterData.getGroups(); assertNotNull(clientGroups); assertEquals(serverGroups.size(), clientGroups.size()); for (String groupName : clientGroups.keySet()) { GroupData clientGroupData = clientGroups.get(groupName); GroupData serverGroupData = serverGroups.get(groupName); assertEquals(serverGroupData.getGroupName(), clientGroupData.getGroupName()); } }