IdGenerator { public String getInstanceId(Cloud cloud, String realId) { return generate(Instance.class, String.format("%s-%s", cloud.getId(), realId)); } @Autowired  IdGenerator(WorkerMetadata workerMetadata, Config config); String generate(Class<?> role, String id); String getProjectId(Cloud cloud, String trait); String getProjectId(Cloud cloud); String getInstanceId(Cloud cloud, String realId); String getImageId(Cloud cloud, String realId);  }
@Test public void testGetInstanceId() { String instanceId = idGenerator.getInstanceId(CLOUD, ID); assertThat(instanceId, equalTo("539becb6-6bfd-3630-809b-848b50723081")); }