IdGenerator { public String getImageId(Cloud cloud, String realId) { return generate(Image.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 testGetImageId() { String imageId = idGenerator.getImageId(CLOUD, ID); assertThat(imageId, equalTo("f4db4cbb-8f6b-3a3b-beef-904305645342")); }