@Test void testIsApplicationStagedCorrectlyMetadataIsNull() { CloudApplication app = createApplication(); Mockito.when(client.getBuildsForApplication(any(UUID.class))) .thenReturn(List.of(Mockito.mock(CloudBuild.class))); Assertions.assertFalse(applicationStager.isApplicationStagedCorrectly(app)); }
public boolean isApplicationStagedCorrectly(CloudApplication app) { List<CloudBuild> buildsForApplication = client.getBuildsForApplication(app.getMetadata() .getGuid()); if (containsNullMetadata(buildsForApplication)) { return false; } CloudBuild build = getLastBuild(buildsForApplication); if (build == null) { logger.debug(Messages.NO_BUILD_FOUND_FOR_APPLICATION, app.getName()); return false; } if (isBuildStagedCorrectly(build)) { return true; } logMessages(app, build); return false; }
ApplicationStager { public boolean isApplicationStagedCorrectly(CloudApplication app) { List<CloudBuild> buildsForApplication = client.getBuildsForApplication(app.getMetadata() .getGuid()); if (containsNullMetadata(buildsForApplication)) { return false; } CloudBuild build = getLastBuild(buildsForApplication); if (build == null) { logger.debug(Messages.NO_BUILD_FOUND_FOR_APPLICATION, app.getName()); return false; } if (isBuildStagedCorrectly(build)) { return true; } logMessages(app, build); return false; } }
ApplicationStager { public boolean isApplicationStagedCorrectly(CloudApplication app) { List<CloudBuild> buildsForApplication = client.getBuildsForApplication(app.getMetadata() .getGuid()); if (containsNullMetadata(buildsForApplication)) { return false; } CloudBuild build = getLastBuild(buildsForApplication); if (build == null) { logger.debug(Messages.NO_BUILD_FOUND_FOR_APPLICATION, app.getName()); return false; } if (isBuildStagedCorrectly(build)) { return true; } logMessages(app, build); return false; } ApplicationStager(ProcessContext context); }
ApplicationStager { public boolean isApplicationStagedCorrectly(CloudApplication app) { List<CloudBuild> buildsForApplication = client.getBuildsForApplication(app.getMetadata() .getGuid()); if (containsNullMetadata(buildsForApplication)) { return false; } CloudBuild build = getLastBuild(buildsForApplication); if (build == null) { logger.debug(Messages.NO_BUILD_FOUND_FOR_APPLICATION, app.getName()); return false; } if (isBuildStagedCorrectly(build)) { return true; } logMessages(app, build); return false; } ApplicationStager(ProcessContext context); StagingState getStagingState(); boolean isApplicationStagedCorrectly(CloudApplication app); void bindDropletToApplication(UUID appGuid); StepPhase stageApp(CloudApplication app); }
ApplicationStager { public boolean isApplicationStagedCorrectly(CloudApplication app) { List<CloudBuild> buildsForApplication = client.getBuildsForApplication(app.getMetadata() .getGuid()); if (containsNullMetadata(buildsForApplication)) { return false; } CloudBuild build = getLastBuild(buildsForApplication); if (build == null) { logger.debug(Messages.NO_BUILD_FOUND_FOR_APPLICATION, app.getName()); return false; } if (isBuildStagedCorrectly(build)) { return true; } logMessages(app, build); return false; } ApplicationStager(ProcessContext context); StagingState getStagingState(); boolean isApplicationStagedCorrectly(CloudApplication app); void bindDropletToApplication(UUID appGuid); StepPhase stageApp(CloudApplication app);  }