### Question:
UiInstanceService { public UiResponse findInstance(HttpServletRequest request, Map parameterMap) { Map<String, AppEntity> appMap=appService.getCacheData(); UiResponse uiResponse = new UiResponse(); Long count; List<CombinedInstanceDto> instanceList; count = uiInstanceRepository.countBy(parameterMap); instanceList = uiInstanceRepository.findBy(parameterMap); for (CombinedInstanceDto combinedInstanceDto : instanceList) { combinedInstanceDto.setRole(uiUserService.getRole(appMap.get(combinedInstanceDto.getCandAppId()))); setFinalStatus(combinedInstanceDto); } return UiResponseHelper.setUiResponse(uiResponse, count, instanceList); }  UiResponse findInstance(HttpServletRequest request, Map parameterMap); UiResponse findExpiredInstance(HttpServletRequest request, Map parameterMap); UiResponse deleteById(long instanceId); UiResponse findByInstanceId(HttpServletRequest request, String instanceId); void setFinalStatus(CombinedInstanceDto combinedInstanceDto); @Transactional(rollbackFor = Exception.class) String updateSupperStatus(HttpServletRequest request, String originalStatus, String supperStatus, long instanceId); @Transactional(rollbackFor = Exception.class) String updatePublishStatus(HttpServletRequest request, String pubStatus, long instanceId); List<String> getAllSdkVersion();  }### Answer:
@Test public void testFindInstance() throws Exception { RegisterInstanceRequest registerInstanceRequest = RegisterInstanceUtil.setRegisterInstanceRequest(); RegisterInstanceResponse response = instanceService.registerInstance(registerInstanceRequest); InstanceEntity testInstanceEntity = RegisterInstanceUtil.createTestInstanceEntity(); HttpServletRequest request = new MockHttpServletRequest(); Map<String, Object> parameterMap = new LinkedHashMap<String, Object>(); parameterMap = setParameterMap(parameterMap); CombinedInstanceDto combinedInstanceDto = (CombinedInstanceDto) uiInstanceService.findInstance(request, parameterMap).getData().get(0); Assert.assertEquals(testInstanceEntity.getAppClusterName(), combinedInstanceDto.getAppClusterName()); Assert.assertEquals(testInstanceEntity.getCandAppId(), combinedInstanceDto.getCandAppId()); deRegister(combinedInstanceDto.getId()); }