@Test void detectSingularDeployedApp3ModulesBlueSuffix() { DeployedMta deployedMta = createMta("com.sap.sample.mta.consumer", Collections.emptySet(), List.of(createMtaApplication("app-1", "app-1-blue", parseDate("2019-04-04")), createMtaApplication("app-2", "app-2-blue", parseDate("2019-04-05")), createMtaApplication("app-3", "app-3-blue", parseDate("2019-04-06")))); Expectation expectation = new Expectation(BLUE); tester.test(() -> applicationColorDetector.detectSingularDeployedApplicationColor(deployedMta), expectation); }
public ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta) { if (deployedMta == null) { return null; } ApplicationColor deployedApplicationColor = null; for (DeployedMtaApplication deployedMtaApplication : deployedMta.getApplications()) { ApplicationColor applicationColor = CloudModelBuilderUtil.getApplicationColor(deployedMtaApplication); if (deployedApplicationColor == null) { deployedApplicationColor = (applicationColor); } if (deployedApplicationColor != applicationColor) { throw new ConflictException(Messages.CONFLICTING_APP_COLORS, deployedMta.getMetadata() .getId()); } } return deployedApplicationColor; }
ApplicationColorDetector { public ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta) { if (deployedMta == null) { return null; } ApplicationColor deployedApplicationColor = null; for (DeployedMtaApplication deployedMtaApplication : deployedMta.getApplications()) { ApplicationColor applicationColor = CloudModelBuilderUtil.getApplicationColor(deployedMtaApplication); if (deployedApplicationColor == null) { deployedApplicationColor = (applicationColor); } if (deployedApplicationColor != applicationColor) { throw new ConflictException(Messages.CONFLICTING_APP_COLORS, deployedMta.getMetadata() .getId()); } } return deployedApplicationColor; } }
ApplicationColorDetector { public ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta) { if (deployedMta == null) { return null; } ApplicationColor deployedApplicationColor = null; for (DeployedMtaApplication deployedMtaApplication : deployedMta.getApplications()) { ApplicationColor applicationColor = CloudModelBuilderUtil.getApplicationColor(deployedMtaApplication); if (deployedApplicationColor == null) { deployedApplicationColor = (applicationColor); } if (deployedApplicationColor != applicationColor) { throw new ConflictException(Messages.CONFLICTING_APP_COLORS, deployedMta.getMetadata() .getId()); } } return deployedApplicationColor; }  }
ApplicationColorDetector { public ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta) { if (deployedMta == null) { return null; } ApplicationColor deployedApplicationColor = null; for (DeployedMtaApplication deployedMtaApplication : deployedMta.getApplications()) { ApplicationColor applicationColor = CloudModelBuilderUtil.getApplicationColor(deployedMtaApplication); if (deployedApplicationColor == null) { deployedApplicationColor = (applicationColor); } if (deployedApplicationColor != applicationColor) { throw new ConflictException(Messages.CONFLICTING_APP_COLORS, deployedMta.getMetadata() .getId()); } } return deployedApplicationColor; }  ApplicationColor detectLiveApplicationColor(DeployedMta deployedMta, String correlationId); ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta); }
ApplicationColorDetector { public ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta) { if (deployedMta == null) { return null; } ApplicationColor deployedApplicationColor = null; for (DeployedMtaApplication deployedMtaApplication : deployedMta.getApplications()) { ApplicationColor applicationColor = CloudModelBuilderUtil.getApplicationColor(deployedMtaApplication); if (deployedApplicationColor == null) { deployedApplicationColor = (applicationColor); } if (deployedApplicationColor != applicationColor) { throw new ConflictException(Messages.CONFLICTING_APP_COLORS, deployedMta.getMetadata() .getId()); } } return deployedApplicationColor; }  ApplicationColor detectLiveApplicationColor(DeployedMta deployedMta, String correlationId); ApplicationColor detectSingularDeployedApplicationColor(DeployedMta deployedMta);  }