@Override public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) { GoogleCanaryAccountValidator googleCanaryAccountValidator = new GoogleCanaryAccountValidator() .setHalyardVersion(halyardVersion) .setRegistry(registry) .setTaskScheduler(taskScheduler); if (n.isGcsEnabled()) { List<GoogleCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled."); } else { accountsWithBucket.forEach(a -> googleCanaryAccountValidator.validate(p, a)); } } } }
@Override public void validate(ConfigProblemSetBuilder p, GoogleCanaryServiceIntegration n) { GoogleCanaryAccountValidator googleCanaryAccountValidator = new GoogleCanaryAccountValidator(halyardVersion); n.getAccounts().forEach(a -> googleCanaryAccountValidator.validate(p, a)); if (n.isGcsEnabled()) { List<GoogleCanaryAccount> accountsWithBucket = n.getAccounts() .stream() .filter(a -> a.getBucket() != null) .collect(Collectors.toList()); if (CollectionUtils.isEmpty(accountsWithBucket)) { p.addProblem(Problem.Severity.ERROR, "At least one Google account must specify a bucket if GCS is enabled."); } } } }
GoogleCanaryServiceIntegration googleCanaryServiceIntegration = (GoogleCanaryServiceIntegration)s; new GoogleCanaryValidator().setHalyardVersion(halyardVersion).setRegistry(registry).validate(p, googleCanaryServiceIntegration);
GoogleCanaryServiceIntegration googleCanaryServiceIntegration = (GoogleCanaryServiceIntegration)s; new GoogleCanaryValidator() .setHalyardVersion(halyardVersion) .setRegistry(registry) .setTaskScheduler(taskScheduler) .validate(p, googleCanaryServiceIntegration);