@Test public void testFindByClusterName(){ RegisterInstanceRequest registerInstanceRequest = RegisterInstanceUtil.setRegisterInstanceRequest(); RegisterInstanceResponse response = instanceService.registerInstance(registerInstanceRequest); InstanceEntity testInstanceEntity = RegisterInstanceUtil.createTestInstanceEntity(); Map<String, Object> parameterMap = new LinkedHashMap<String, Object>(); parameterMap.put("clusterName", "wCluster"); AppClusterEntity appClusterEntity=(AppClusterEntity) uiAppClusterService.findByClusterName(parameterMap).getData().get(0); Assert.assertEquals("wCluster", appClusterEntity.getClusterName()); }
public UiResponse findByClusterName(Map parameterMap) { UiResponse uiResponse = new UiResponse(); Long count; List<AppClusterEntity> appClusterList; count = uiAppClusterRepository.countByAppIdOrClusterName(parameterMap); appClusterList = uiAppClusterRepository.findByAppIdOrClusterName(parameterMap); return UiResponseHelper.setUiResponse(uiResponse, count, appClusterList); }
UiAppClusterService { public UiResponse findByClusterName(Map parameterMap) { UiResponse uiResponse = new UiResponse(); Long count; List<AppClusterEntity> appClusterList; count = uiAppClusterRepository.countByAppIdOrClusterName(parameterMap); appClusterList = uiAppClusterRepository.findByAppIdOrClusterName(parameterMap); return UiResponseHelper.setUiResponse(uiResponse, count, appClusterList); } }
UiAppClusterService { public UiResponse findByClusterName(Map parameterMap) { UiResponse uiResponse = new UiResponse(); Long count; List<AppClusterEntity> appClusterList; count = uiAppClusterRepository.countByAppIdOrClusterName(parameterMap); appClusterList = uiAppClusterRepository.findByAppIdOrClusterName(parameterMap); return UiResponseHelper.setUiResponse(uiResponse, count, appClusterList); }  }
UiAppClusterService { public UiResponse findByClusterName(Map parameterMap) { UiResponse uiResponse = new UiResponse(); Long count; List<AppClusterEntity> appClusterList; count = uiAppClusterRepository.countByAppIdOrClusterName(parameterMap); appClusterList = uiAppClusterRepository.findByAppIdOrClusterName(parameterMap); return UiResponseHelper.setUiResponse(uiResponse, count, appClusterList); }  UiResponse findByInstanceId(String instanceId); UiResponse findByClusterName(Map parameterMap); }
UiAppClusterService { public UiResponse findByClusterName(Map parameterMap) { UiResponse uiResponse = new UiResponse(); Long count; List<AppClusterEntity> appClusterList; count = uiAppClusterRepository.countByAppIdOrClusterName(parameterMap); appClusterList = uiAppClusterRepository.findByAppIdOrClusterName(parameterMap); return UiResponseHelper.setUiResponse(uiResponse, count, appClusterList); }  UiResponse findByInstanceId(String instanceId); UiResponse findByClusterName(Map parameterMap);  }