@Test public void testFindByInstanceId(){ RegisterInstanceRequest registerInstanceRequest = RegisterInstanceUtil.setRegisterInstanceRequest(); RegisterInstanceResponse response = instanceService.registerInstance(registerInstanceRequest); InstanceEntity testInstanceEntity = RegisterInstanceUtil.createTestInstanceEntity(); InstanceEntity instanceEntity = instanceService.findByCandInstanceId("w545878765"); AppEntity appEntity=(AppEntity) uiAppService.findByInstanceId(Long.toString(instanceEntity.getId())).getData().get(0); Assert.assertEquals("wApp", appEntity.getAppName()); }
public UiResponse findByInstanceId(String instanceId) { UiResponse uiResponse = new UiResponse(); Long count; List<AppEntity> appList; List<AppEntityVo> appEntityVoList=new ArrayList<>(); count = appRepository.appCount(instanceId); appList = appRepository.findByInstanceId(instanceId); for(AppEntity appEntity:appList){ AppEntityVo appEntityVo=new AppEntityVo(appEntity); appEntityVo.setRole(roleService.getRole(appEntity)); appEntityVoList.add(appEntityVo); } return UiResponseHelper.setUiResponse(uiResponse, count, appEntityVoList); }
UiAppService { public UiResponse findByInstanceId(String instanceId) { UiResponse uiResponse = new UiResponse(); Long count; List<AppEntity> appList; List<AppEntityVo> appEntityVoList=new ArrayList<>(); count = appRepository.appCount(instanceId); appList = appRepository.findByInstanceId(instanceId); for(AppEntity appEntity:appList){ AppEntityVo appEntityVo=new AppEntityVo(appEntity); appEntityVo.setRole(roleService.getRole(appEntity)); appEntityVoList.add(appEntityVo); } return UiResponseHelper.setUiResponse(uiResponse, count, appEntityVoList); } }
UiAppService { public UiResponse findByInstanceId(String instanceId) { UiResponse uiResponse = new UiResponse(); Long count; List<AppEntity> appList; List<AppEntityVo> appEntityVoList=new ArrayList<>(); count = appRepository.appCount(instanceId); appList = appRepository.findByInstanceId(instanceId); for(AppEntity appEntity:appList){ AppEntityVo appEntityVo=new AppEntityVo(appEntity); appEntityVo.setRole(roleService.getRole(appEntity)); appEntityVoList.add(appEntityVo); } return UiResponseHelper.setUiResponse(uiResponse, count, appEntityVoList); }  }
UiAppService { public UiResponse findByInstanceId(String instanceId) { UiResponse uiResponse = new UiResponse(); Long count; List<AppEntity> appList; List<AppEntityVo> appEntityVoList=new ArrayList<>(); count = appRepository.appCount(instanceId); appList = appRepository.findByInstanceId(instanceId); for(AppEntity appEntity:appList){ AppEntityVo appEntityVo=new AppEntityVo(appEntity); appEntityVo.setRole(roleService.getRole(appEntity)); appEntityVoList.add(appEntityVo); } return UiResponseHelper.setUiResponse(uiResponse, count, appEntityVoList); }  UiResponse findByInstanceId(String instanceId); UiResponse findByAppName(Map parameterMap); int update(AppEntity updateEntity); UiResponse update(AppUpdateRequest appUpdateRequest); AppEntity setUpdateEntity(AppUpdateRequest appUpdateRequest); }
UiAppService { public UiResponse findByInstanceId(String instanceId) { UiResponse uiResponse = new UiResponse(); Long count; List<AppEntity> appList; List<AppEntityVo> appEntityVoList=new ArrayList<>(); count = appRepository.appCount(instanceId); appList = appRepository.findByInstanceId(instanceId); for(AppEntity appEntity:appList){ AppEntityVo appEntityVo=new AppEntityVo(appEntity); appEntityVo.setRole(roleService.getRole(appEntity)); appEntityVoList.add(appEntityVo); } return UiResponseHelper.setUiResponse(uiResponse, count, appEntityVoList); }  UiResponse findByInstanceId(String instanceId); UiResponse findByAppName(Map parameterMap); int update(AppEntity updateEntity); UiResponse update(AppUpdateRequest appUpdateRequest); AppEntity setUpdateEntity(AppUpdateRequest appUpdateRequest);  }