Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Sep 22, 2023
1 parent 40664eb commit cb9333e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ void testValidateArtifactMetadata() {
@Test
void testValidateGroupIdMetadata() {
Metadata metadata = new Metadata();
List<Plugin> plugins = new ArrayList<>();
metadata.setPlugins(plugins);
SimpleProblemCollector problems = new SimpleProblemCollector();
validator.validate(metadata, Level.GROUP_ID, null, problems);
assertEquals(0, problems.messages.size());
Expand All @@ -117,13 +115,13 @@ void testValidateGroupIdMetadata() {
plugin.setArtifactId("myArtifactId");
plugin.setName("myPluginName");
plugin.setPrefix("mypluginprefix");
plugins.add(plugin);
metadata.getPlugins().add(plugin);
problems = new SimpleProblemCollector();
validator.validate(metadata, problems);
assertEquals(0, problems.messages.size());

plugin = new Plugin();
plugins.add(plugin);
metadata.getPlugins().add(plugin);
problems = new SimpleProblemCollector();
validator.validate(metadata, problems);
assertEquals(3, problems.messages.size());
Expand All @@ -135,6 +133,7 @@ void testValidateGroupIdMetadata() {
problems.messages.get(2),
"'plugins.plugin.artifactId' on repository metadata level groupId is missing");

plugin = metadata.getPlugins().get(1);
plugin.setArtifactId("myOtherArtifactId");
problems = new SimpleProblemCollector();
validator.validate(metadata, problems);
Expand Down

0 comments on commit cb9333e

Please sign in to comment.