@ExtendWith({ RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class }) @Test public void validateGroupIdCase(@MavenRepository(repositoryId = REPOSITORY_RELEASES) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES, id = GROUP_ID + ":" + ARTIFACT_ID, versions = { "1.0" }) Path path) throws Exception { RepositoryPath repositoryPath = (RepositoryPath) path.normalize(); ArtifactCoordinates coordinates = RepositoryFiles.readCoordinates(repositoryPath); assertThatExceptionOfType(LowercaseValidationException.class) .isThrownBy(() -> mavenGroupIdLowercaseValidator.validate(repository, coordinates)); }
@Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getGroupId().toLowerCase().equals(mac.getGroupId())) { throw new LowercaseValidationException("The groupId should be defined in lowercase."); } }
MavenGroupIdLowercaseValidator implements MavenArtifactCoordinatesValidator { @Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getGroupId().toLowerCase().equals(mac.getGroupId())) { throw new LowercaseValidationException("The groupId should be defined in lowercase."); } } }
MavenGroupIdLowercaseValidator implements MavenArtifactCoordinatesValidator { @Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getGroupId().toLowerCase().equals(mac.getGroupId())) { throw new LowercaseValidationException("The groupId should be defined in lowercase."); } }  }
MavenGroupIdLowercaseValidator implements MavenArtifactCoordinatesValidator { @Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getGroupId().toLowerCase().equals(mac.getGroupId())) { throw new LowercaseValidationException("The groupId should be defined in lowercase."); } }  @PostConstruct @Override void register(); @Override String getAlias(); @Override String getDescription(); @Override void validate(Repository repository,
                         ArtifactCoordinates coordinates); RepositoryFileAttributes getAttributes(RepositoryPath repositoryPath); }
MavenGroupIdLowercaseValidator implements MavenArtifactCoordinatesValidator { @Override public void validate(Repository repository, ArtifactCoordinates coordinates) throws ArtifactCoordinatesValidationException { MavenArtifactCoordinates mac = (MavenArtifactCoordinates) coordinates; if (!mac.getGroupId().toLowerCase().equals(mac.getGroupId())) { throw new LowercaseValidationException("The groupId should be defined in lowercase."); } }  @PostConstruct @Override void register(); @Override String getAlias(); @Override String getDescription(); @Override void validate(Repository repository,
                         ArtifactCoordinates coordinates); RepositoryFileAttributes getAttributes(RepositoryPath repositoryPath); static final String ALIAS; static final String DESCRIPTION; }