diff --git a/CHANGELOG b/CHANGELOG
index a9f4dbc..e7a4579 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,7 +4,8 @@ CHANGELOG
1.2.1
-----
-* Bump kemitix-parent from 5.1.1 to 5.2.0
+* Bump kemitix-parent from 5.1.1 to 5.2.0 (#55)
+* Bump junit from 4.12 to 5.3.1 [#56)
1.2.0
-----
diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy
index 7f0eaa4..0f91efd 100644
--- a/Jenkinsfile.groovy
+++ b/Jenkinsfile.groovy
@@ -1,6 +1,5 @@
final String publicRepo = 'https://github.com/kemitix/'
final String mvn = "mvn --batch-mode --update-snapshots --errors"
-final dependenciesSupportJDK = 10
pipeline {
agent any
@@ -9,12 +8,6 @@ pipeline {
steps {
withMaven(maven: 'maven', jdk: 'JDK 1.8') {
sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test"
- // Code Coverage to Codacy
- sh "${mvn} jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " +
- "-DcoverageReportFile=target/site/jacoco/jacoco.xml " +
- "-DprojectToken=`$JENKINS_HOME/codacy/token` " +
- "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " +
- "-Dcommit=`git rev-parse HEAD`"
// Code Coverage to Jenkins
jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class'
// PMD to Jenkins
@@ -58,19 +51,10 @@ pipeline {
}
}
}
- stage('Build Java 9') {
- when { expression { dependenciesSupportJDK >= 9 } }
+ stage('Build Java 11') {
steps {
- withMaven(maven: 'maven', jdk: 'JDK 9') {
- sh "${mvn} clean verify -Djava.version=9"
- }
- }
- }
- stage('Build Java 10') {
- when { expression { dependenciesSupportJDK >= 10 } }
- steps {
- withMaven(maven: 'maven', jdk: 'JDK 10') {
- sh "${mvn} clean verify -Djava.version=10"
+ withMaven(maven: 'maven', jdk: 'JDK 11') {
+ sh "${mvn} clean verify -Djava.version=11"
}
}
}
diff --git a/pom.xml b/pom.xml
index 8b5b9e0..99e6f4b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,13 +33,16 @@
1.8
- 4.12
+ 5.3.1
+ 2.23.0
3.11.1
1.18.2
2.12
1.2.0
net.kemitix.mon
5.0.0
+ 1.4.3
+ 0.7
@@ -49,10 +52,21 @@
${lombok.version}
provided
+
- junit
- junit
- ${junit.version}
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ runtime
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito.version}
test
@@ -63,6 +77,18 @@
+
+
+
+ org.junit
+ junit-bom
+ ${junit.version}
+ pom
+ import
+
+
+
+
@@ -77,6 +103,19 @@
+
+
+ org.pitest
+ pitest-maven
+ ${pitest-maven-plugin.version}
+
+
+ org.pitest
+ pitest-junit5-plugin
+ ${pitest-junit5-plugin.version}
+
+
+
diff --git a/src/test/java/net/kemitix/mon/BeanBuilderTest.java b/src/test/java/net/kemitix/mon/BeanBuilderTest.java
index d36c69e..58b326a 100644
--- a/src/test/java/net/kemitix/mon/BeanBuilderTest.java
+++ b/src/test/java/net/kemitix/mon/BeanBuilderTest.java
@@ -5,15 +5,15 @@ import lombok.RequiredArgsConstructor;
import lombok.Setter;
import net.kemitix.mon.experimental.BeanBuilder;
import org.assertj.core.api.WithAssertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.function.Consumer;
import java.util.function.Supplier;
-public class BeanBuilderTest implements WithAssertions {
+class BeanBuilderTest implements WithAssertions {
@Test
- public void canCreateAndSetupObject() {
+ void canCreateAndSetupObject() {
//given
final Supplier template = () -> new DataObject("name");
final Consumer value = data -> data.setValue("value");
diff --git a/src/test/java/net/kemitix/mon/EitherTest.java b/src/test/java/net/kemitix/mon/EitherTest.java
index 7508b39..7fd835f 100644
--- a/src/test/java/net/kemitix/mon/EitherTest.java
+++ b/src/test/java/net/kemitix/mon/EitherTest.java
@@ -2,12 +2,12 @@ package net.kemitix.mon;
import net.kemitix.mon.experimental.either.Either;
import org.assertj.core.api.WithAssertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-public class EitherTest implements WithAssertions {
+class EitherTest implements WithAssertions {
@Test
- public void whenLeft_isLeft() {
+ void whenLeft_isLeft() {
//when
final Either either = Either.left(1);
//then
@@ -15,7 +15,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void whenLeft_isNotRight() {
+ void whenLeft_isNotRight() {
//when
final Either either = Either.left(1);
//then
@@ -23,7 +23,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void whenRight_isNotLeft() {
+ void whenRight_isNotLeft() {
//when
final Either either = Either.right("1");
//then
@@ -31,7 +31,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void whenRight_isRight() {
+ void whenRight_isRight() {
//when
final Either either = Either.right("1");
//then
@@ -39,7 +39,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void whenLeft_matchLeft() {
+ void whenLeft_matchLeft() {
//given
final Either either = Either.left(1);
//then
@@ -50,7 +50,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void whenRight_matchRight() {
+ void whenRight_matchRight() {
//given
final Either either = Either.right("1");
//then
@@ -61,7 +61,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void givenLeft_whenMapLeft_thenMap() {
+ void givenLeft_whenMapLeft_thenMap() {
//given
final Either either = Either.left(2);
//when
@@ -74,7 +74,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void givenRight_whenMapRight_thenMap() {
+ void givenRight_whenMapRight_thenMap() {
//given
final Either either = Either.right("2");
//when
@@ -87,7 +87,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void givenLeft_whenMapRight_thenDoNothing() {
+ void givenLeft_whenMapRight_thenDoNothing() {
//given
final Either either = Either.left(2);
//when
@@ -100,7 +100,7 @@ public class EitherTest implements WithAssertions {
}
@Test
- public void givenRight_whenMapLeft_thenDoNothing() {
+ void givenRight_whenMapLeft_thenDoNothing() {
//given
final Either either = Either.right("2");
//when
diff --git a/src/test/java/net/kemitix/mon/MaybeMonadTest.java b/src/test/java/net/kemitix/mon/MaybeMonadTest.java
index bbb6618..4611aa3 100644
--- a/src/test/java/net/kemitix/mon/MaybeMonadTest.java
+++ b/src/test/java/net/kemitix/mon/MaybeMonadTest.java
@@ -2,11 +2,11 @@ package net.kemitix.mon;
import net.kemitix.mon.maybe.Maybe;
import org.assertj.core.api.WithAssertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.function.Function;
-public class MaybeMonadTest implements WithAssertions {
+class MaybeMonadTest implements WithAssertions {
private final int v = 1;
private final Function> f = i -> m(i * 2);
@@ -17,7 +17,7 @@ public class MaybeMonadTest implements WithAssertions {
}
@Test
- public void leftIdentity() {
+ void leftIdentity() {
assertThat(
m(v).flatMap(f)
).isEqualTo(
@@ -26,7 +26,7 @@ public class MaybeMonadTest implements WithAssertions {
}
@Test
- public void rightIdentity() {
+ void rightIdentity() {
assertThat(
m(v).flatMap(x -> m(x))
).isEqualTo(
@@ -35,7 +35,7 @@ public class MaybeMonadTest implements WithAssertions {
}
@Test
- public void associativity() {
+ void associativity() {
assertThat(
m(v).flatMap(f).flatMap(g)
).isEqualTo(
diff --git a/src/test/java/net/kemitix/mon/MaybeTest.java b/src/test/java/net/kemitix/mon/MaybeTest.java
index af35dca..efc3fa9 100644
--- a/src/test/java/net/kemitix/mon/MaybeTest.java
+++ b/src/test/java/net/kemitix/mon/MaybeTest.java
@@ -2,7 +2,7 @@ package net.kemitix.mon;
import net.kemitix.mon.maybe.Maybe;
import org.assertj.core.api.WithAssertions;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.Objects;
import java.util.Optional;
@@ -13,25 +13,25 @@ import java.util.stream.Stream;
import static net.kemitix.mon.maybe.Maybe.*;
-public class MaybeTest implements WithAssertions {
+class MaybeTest implements WithAssertions {
private static Predicate eq(final T value) {
return v -> Objects.equals(value, v);
}
@Test
- public void justMustBeNonNull() {
+ void justMustBeNonNull() {
assertThatNullPointerException().isThrownBy(() -> just(null))
.withMessageContaining("value");
}
@Test
- public void nothingReusesTheSameInstance() {
+ void nothingReusesTheSameInstance() {
assertThat(nothing()).isSameAs(nothing());
}
@Test
- public void equality() {
+ void equality() {
assertThat(just(1)).isEqualTo(just(1));
assertThat(just(1)).isNotEqualTo(just(2));
assertThat(just(1)).isNotEqualTo(nothing());
@@ -40,19 +40,19 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void maybeAllowsNull() {
+ void maybeAllowsNull() {
assertThat(just(1)).isEqualTo(maybe(1));
assertThat(nothing()).isEqualTo(maybe(null));
}
@Test
- public void map() {
+ void map() {
assertThat(just(1).map(v -> v + 1)).isEqualTo(just(2));
assertThat(nothing().map(v -> v)).isEqualTo(nothing());
}
@Test
- public void mapToNull_thenJustNull() {
+ void mapToNull_thenJustNull() {
//given
final Maybe maybe = just(1);
//when
@@ -65,7 +65,7 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void optional_mapToNull_thenJustNull() {
+ void optional_mapToNull_thenJustNull() {
//given
final Optional optional = Optional.ofNullable(1);
//when
@@ -75,49 +75,49 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void justHashCode() {
+ void justHashCode() {
assertThat(just(1).hashCode()).isNotEqualTo(just(2).hashCode());
}
@Test
- public void nothingHashCode() {
+ void nothingHashCode() {
assertThat(nothing().hashCode()).isEqualTo(maybe(null).hashCode());
}
@Test
- public void orElseGet() {
+ void orElseGet() {
assertThat(just(1).orElseGet(() -> -1)).isEqualTo(1);
assertThat(nothing().orElseGet(() -> -1)).isEqualTo(-1);
}
@Test
- public void orElse() {
+ void orElse() {
assertThat(just(1).orElse(-1)).isEqualTo(1);
assertThat(nothing().orElse(-1)).isEqualTo(-1);
}
@Test
- public void filter() {
+ void filter() {
assertThat(just(1).filter(eq(1))).isEqualTo(just(1));
assertThat(just(1).filter(eq(0))).isEqualTo(nothing());
assertThat(nothing().filter(eq(1))).isEqualTo(nothing());
}
@Test
- public void toOptional() {
+ void toOptional() {
assertThat(just(1).toOptional()).isEqualTo(Optional.of(1));
assertThat(nothing()
.toOptional()).isEqualTo(Optional.empty());
}
@Test
- public void fromOptional() {
+ void fromOptional() {
assertThat(Optional.of(1).map(Maybe::just).orElseGet(Maybe::nothing)).isEqualTo(just(1));
assertThat(Optional.empty().map(Maybe::just).orElseGet(Maybe::nothing)).isEqualTo(nothing());
}
@Test
- public void peek() {
+ void peek() {
final AtomicInteger ref = new AtomicInteger(0);
assertThat(just(1).peek(x -> ref.incrementAndGet())).isEqualTo(just(1));
assertThat(ref.get()).isEqualTo(1);
@@ -127,12 +127,12 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void justOrThrowDoesNotThrow() {
+ void justOrThrowDoesNotThrow() {
assertThatCode(() -> just(1).orElseThrow(IllegalStateException::new)).doesNotThrowAnyException();
}
@Test
- public void justOrThrowReturnsValue() {
+ void justOrThrowReturnsValue() {
//given
final Maybe maybe = just(1);
//when
@@ -142,13 +142,13 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void nothingOrThrow() {
+ void nothingOrThrow() {
assertThatThrownBy(() -> nothing().orElseThrow(IllegalStateException::new)).isInstanceOf(
IllegalStateException.class);
}
@Test
- public void justToStream() {
+ void justToStream() {
//when
final Stream stream = just(1).stream();
//then
@@ -156,7 +156,7 @@ public class MaybeTest implements WithAssertions {
}
@Test
- public void nothingToStream() {
+ void nothingToStream() {
//when
final Stream