Skip to content

Commit

Permalink
(#1411) Cleanup pom, bump parent and add todo for junit 5
Browse files Browse the repository at this point in the history
  • Loading branch information
victornoel committed Jul 5, 2020
1 parent 3675019 commit 033b34e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 108 deletions.
121 changes: 38 additions & 83 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The MIT License (MIT)
<parent>
<groupId>com.jcabi</groupId>
<artifactId>parent</artifactId>
<version>0.49.4</version>
<version>0.50.0</version>
</parent>
<groupId>org.cactoos</groupId>
<artifactId>cactoos</artifactId>
Expand Down Expand Up @@ -81,6 +81,9 @@ The MIT License (MIT)
<url>https://github.com/yegor256/cactoos</url>
</site>
</distributionManagement>
<properties>
<junit-platform.version>5.6.2</junit-platform.version>
</properties>
<dependencies>
<dependency>
<groupId>org.takes</groupId>
Expand Down Expand Up @@ -110,19 +113,34 @@ The MIT License (MIT)
</exclusion>
</exclusions>
</dependency>
<!--
@todo #1411:30min Migrate existing tests to JUnit 5. It mainly means
changing the imports and move from Ignore to Disabled annotation as
well as replace rules with corresponding annotations. Once this is done
remove the dependencies below.
-->
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-verifier-plugin</artifactId>
Expand All @@ -141,14 +159,15 @@ The MIT License (MIT)
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.9.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
Expand All @@ -158,13 +177,6 @@ The MIT License (MIT)
<artifactId>maven-verifier-plugin</artifactId>
</plugin>
</plugins>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.1</version>
</extension>
</extensions>
</build>
<profiles>
<profile>
Expand Down Expand Up @@ -217,7 +229,7 @@ The MIT License (MIT)
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<version>0.8.5</version>
<configuration>
<output>file</output>
</configuration>
Expand Down Expand Up @@ -283,32 +295,6 @@ The MIT License (MIT)
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<tags>
<tag>
<name>todo</name>
<placement>X</placement>
</tag>
<tag>
<name>checkstyle</name>
<placement>X</placement>
</tag>
</tags>
</configuration>
<executions>
<execution>
<id>javadoc-generate</id>
<phase>test</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -332,36 +318,5 @@ The MIT License (MIT)
</plugins>
</build>
</profile>
<profile>
<id>jcabi-gpg</id>
<activation>
<property>
<name>gpg.keyname</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>jcabi-sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration combine.self="override">
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
50 changes: 25 additions & 25 deletions src/test/java/org/cactoos/map/NoNullsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import org.hamcrest.core.AllOf;
import org.hamcrest.core.IsEqual;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.llorllale.cactoos.matchers.Assertion;
import org.llorllale.cactoos.matchers.Throws;

/**
* Test case for {@link NoNulls}.
Expand All @@ -50,12 +50,6 @@
)
public final class NoNullsTest {

/**
* A rule for handling an exception.
*/
@Rule
public final ExpectedException exception = ExpectedException.none();

@Test
public void getSize() {
MatcherAssert.assertThat(
Expand Down Expand Up @@ -374,27 +368,33 @@ public void entrySet() {

@Test
public void putThrowsErrorIfValueNull() {
this.exception.expect(IllegalStateException.class);
this.exception.expectMessage(
"Value at #put(1,V) is NULL"
);
new NoNulls<Integer, Integer>(
new HashMap<>()
).put(1, null);
new Assertion<>(
"Should throws an error if value is null",
() -> new NoNulls<Integer, Integer>(
new HashMap<>()
).put(1, null),
new Throws<>(
"Value at #put(1,V) is NULL",
IllegalStateException.class
)
).affirm();
}

@Test
public void putThrowsErrorIfPreviousValueNull() {
this.exception.expect(IllegalStateException.class);
this.exception.expectMessage(
"Value returned by #put(1,2) is NULL"
);
new NoNulls<>(
new HashMap<Integer, Integer>() {
{
put(1, null);
new Assertion<>(
"Should throws an error if previous value is null",
() -> new NoNulls<>(
new HashMap<Integer, Integer>() {
{
put(1, null);
}
}
}
).put(1, 2);
).put(1, 2),
new Throws<>(
"Value returned by #put(1,2) is NULL",
IllegalStateException.class
)
).affirm();
}
}

1 comment on commit 033b34e

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 033b34e Jul 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1411-445dea43 discovered in pom.xml and submitted as #1416. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.