IdGenerator { public String getProjectId(Cloud cloud, String trait) { return generate(Project.class, String.format("%s-%s", cloud.getId(), trait)); } @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 testGetProjectId() { String projectId = idGenerator.getProjectId(CLOUD, ID); assertThat(projectId, equalTo("8f348574-f915-3c28-9c6e-14905ca09a21")); }
@Test public void testGetProjectIdEmptyId() { String projectId = idGenerator.getProjectId(CLOUD); assertThat(projectId, equalTo("3edc0fed-ab7a-31e0-bae8-cb01b95e9919")); }