ServiceController { @RequestMapping("/config") public List<ServiceDTO> getConfigService( @RequestParam(value = "appId", defaultValue = "") String appId, @RequestParam(value = "ip", required = false) String clientIp) { return discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE); } ServiceController(final DiscoveryService discoveryService); @Deprecated @RequestMapping("/meta") List<ServiceDTO> getMetaService(); @RequestMapping("/config") List<ServiceDTO> getConfigService(
      @RequestParam(value = "appId", defaultValue = "") String appId,
      @RequestParam(value = "ip", required = false) String clientIp); @RequestMapping("/admin") List<ServiceDTO> getAdminService();  }
@Test public void testGetConfigService() { String someAppId = "someAppId"; String someClientIp = "someClientIp"; when(discoveryService.getServiceInstances(ServiceNameConsts.APOLLO_CONFIGSERVICE)) .thenReturn(someServices); assertEquals(someServices, serviceController.getConfigService(someAppId, someClientIp)); }