### Question:
StaticServicesRegistrationService { synchronized void renewInstances() { log.debug("Renewing static instances"); PeerAwareInstanceRegistry registry = getRegistry(); for (InstanceInfo instance : getStaticInstances()) { registry.renew(instance.getAppName(), instance.getId(), false); } } @Autowired  StaticServicesRegistrationService(ServiceDefinitionProcessor serviceDefinitionProcessor, MetadataDefaultsService metadataDefaultsService); List<InstanceInfo> getStaticInstances(); void registerServices(); synchronized StaticRegistrationResult reloadServices();  }### Answer:
@Test public void testRenewInstances() { String directory = "directory"; String service = "service"; InstanceInfo instance = InstanceInfo.Builder.newBuilder().setInstanceId(service).setAppName(service).build(); ServiceDefinitionProcessor serviceDefinitionProcessor = mock(ServiceDefinitionProcessor.class); when(serviceDefinitionProcessor.findStaticServicesData(directory)).thenReturn(createResult(instance)); StaticServicesRegistrationService registrationService = new StaticServicesRegistrationService(serviceDefinitionProcessor, new MetadataDefaultsService()); registrationService.registerServices(directory); registrationService.renewInstances(); verify(mockRegistry, times(1)).renew(instance.getAppName(), instance.getId(), false); }