Skip to content

Commit

Permalink
- version 2.14.16-01 - fixed missing field
Browse files Browse the repository at this point in the history
- added junit test
  • Loading branch information
dhladky committed Feb 25, 2020
1 parent 583289a commit 8f53a7e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
<scope>provided</scope>
<type>${nexus-plugin.type}</type> <!-- -->
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -77,6 +84,19 @@
<extensions>true</extensions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>3.0.0-M4</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public CleanUpTask(final StagingManager stagingManager, final StagingConfigurati
@Override
protected String doRun() throws Exception {
logger.info("I am doing run!"); // todo not implemented
Field configurationField = DefaultStagingConfiguration.class.getDeclaredField("configuration");
Field configurationField = DefaultStagingConfiguration.class.getDeclaredField("configurationSnapshot");
configurationField.setAccessible(true);
Configuration configuration = (Configuration) configurationField.get(stagingConfiguration);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.redhat.nexus.releasestagingrepositories.task;

import com.sonatype.nexus.staging.internal.persist.DefaultStagingConfiguration;
import org.junit.Test;

import java.lang.reflect.Field;

public class CleanUpTaskTest {

@Test
public void verifyObjects() throws NoSuchFieldException {
// fail if the structure of DefaultStagingConfiguration changed again
DefaultStagingConfiguration.class.getDeclaredField("configurationSnapshot");
}
}

0 comments on commit 8f53a7e

Please sign in to comment.