Skip to content

Commit

Permalink
Update to junit5 and mockito
Browse files Browse the repository at this point in the history
  • Loading branch information
chonton authored and rohanKanojia committed May 25, 2022
1 parent ddf3029 commit 3dd6acd
Show file tree
Hide file tree
Showing 108 changed files with 5,662 additions and 6,842 deletions.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ jobs:
- run:
command: |
mvn clean install -DskipTests
PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
cd it/
find . -type f -exec sed -i 's/0.40-SNAPSHOT/'"$PROJECT_VERSION"'/g' {} +
mvn clean install
- save_cache:
key: dmp-{{ checksum "pom.xml" }}
Expand Down
36 changes: 12 additions & 24 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<packaging>pom</packaging>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.version>3.3.9</maven.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -42,6 +44,11 @@
<version>3.3.0</version>
</plugin>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
Expand Down Expand Up @@ -105,6 +112,11 @@
<version>3.0.0-M2</version>
</plugin>

<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand All @@ -127,28 +139,4 @@
</pluginManagement>
</build>

<profiles>
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</profile>
<profile>
<id>java1</id>
<activation>
<jdk>[11,]</jdk>
</activation>
<properties>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
</properties>
</profile>
</profiles>

</project>
103 changes: 53 additions & 50 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
</roles>
</developer>
</developers>

<prerequisites>
<maven>3.0.3</maven>
</prerequisites>
Expand Down Expand Up @@ -68,14 +69,17 @@
</distributionManagement>

<properties>
<excludedGroups>io.fabric8.maven.docker.UnixOnlyTests</excludedGroups>
<byte-buddy.version>1.12.10</byte-buddy.version>
<httpclient.version>4.5.13</httpclient.version>
<jib-core.version>0.18.0</jib-core.version>
<jmockit.version>1.43</jmockit.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<maven.version>3.3.9</maven.version>
<mockito.version>4.5.1</mockito.version>
<project.build.outputTimestamp>2020-11-14T11:57:00Z</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.version>3.0.0-M2</surefire.version>
<system-stubs.version>2.0.1</system-stubs.version>
</properties>

<dependencies>
Expand All @@ -86,13 +90,6 @@
<version>0.38.17</version>
</dependency>

<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-core</artifactId>
Expand All @@ -112,9 +109,9 @@
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>${byte-buddy.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -136,8 +133,6 @@
<version>1.1</version>
</dependency>

<!-- =============================================================================== -->

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand All @@ -164,6 +159,7 @@
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
Expand Down Expand Up @@ -195,13 +191,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>2.6.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
Expand Down Expand Up @@ -234,26 +223,45 @@
<version>1.16</version>
</dependency>

<!-- =============================================================================== -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit.version}</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.0</version>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -271,11 +279,19 @@
</dependency>

<dependency>
<groupId>pl.pragmatists</groupId>
<artifactId>JUnitParams</artifactId>
<version>1.1.0</version>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-core</artifactId>
<version>${system-stubs.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<version>${system-stubs.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand All @@ -299,28 +315,25 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
<configuration>
<argLine>-javaagent:${settings.localRepository}/org/jmockit/jmockit/${jmockit.version}/jmockit-${jmockit.version}.jar</argLine>
<argLine>-javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar</argLine>
</configuration>
</plugin>

Expand Down Expand Up @@ -365,7 +378,6 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<configuration>
Expand Down Expand Up @@ -576,6 +588,7 @@
</systemPropertyVariables>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down Expand Up @@ -645,17 +658,7 @@
</plugins>
</build>
</profile>
<profile>
<id>unix-test</id>
<activation>
<os>
<family>unix</family>
</os>
</activation>
<properties>
<excludedGroups></excludedGroups>
</properties>
</profile>

<profile>
<id>sonar</id>
<properties>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public abstract class AbstractDockerMojo extends AbstractMojo implements Context
* Image configurations configured directly.
*/
@Parameter
private List<ImageConfiguration> images;
List<ImageConfiguration> images;

/**
* Image configurations configured via maps to allow overriding.
Expand All @@ -227,7 +227,7 @@ public abstract class AbstractDockerMojo extends AbstractMojo implements Context

// Images resolved with external image resolvers and hooks for subclass to
// mangle the image configurations.
private List<ImageConfiguration> resolvedImages;
List<ImageConfiguration> resolvedImages;

// Handler dealing with authentication credentials
AuthConfigFactory authConfigFactory;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/fabric8/maven/docker/CopyMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ public class CopyMojo extends AbstractDockerMojo {
* Whether to create containers or to copy from existing containers.
*/
@Parameter(property = "docker.createContainers", defaultValue = "false")
private boolean createContainers;
boolean createContainers;

@Parameter(property = "docker.pull.registry")
private String pullRegistry;
String pullRegistry;

/**
* Naming pattern for how to name containers when created.
*/
@Parameter(property = "docker.containerNamePattern")
private String containerNamePattern = ContainerNamingUtil.DEFAULT_CONTAINER_NAME_PATTERN;
String containerNamePattern = ContainerNamingUtil.DEFAULT_CONTAINER_NAME_PATTERN;

/**
* Whether to copy from all containers matching configured images or only from the newest ones.
*/
@Parameter(property = "docker.copyAll", defaultValue = "false")
private boolean copyAll;
boolean copyAll;

@Override
protected void executeInternal(ServiceHub hub) throws IOException, MojoExecutionException {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/fabric8/maven/docker/PushMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class PushMojo extends AbstractDockerMojo {
private String pushRegistry;

@Parameter(property = "docker.skip.push", defaultValue = "false")
private boolean skipPush;
boolean skipPush;

/**
* Skip building tags
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/fabric8/maven/docker/RemoveMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ public class RemoveMojo extends AbstractDockerMojo {
// Should all configured images should be removed?
@Parameter(property = "docker.removeAll")
@Deprecated
private Boolean removeAll;
Boolean removeAll;

@Parameter(property = "docker.removeMode")
private String removeMode;
String removeMode;

/**
* Skip building tags
*/
@Parameter(property = "docker.skip.tag", defaultValue = "false")
private boolean skipTag;
boolean skipTag;

@Parameter(property = "docker.removeNamePattern")
private String removeNamePattern;
String removeNamePattern;

@Override
protected void executeInternal(ServiceHub hub) throws DockerAccessException, MojoExecutionException {
Expand Down
Loading

0 comments on commit 3dd6acd

Please sign in to comment.