diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/licence-header.txt b/licence-header.txt deleted file mode 100644 index b96e314eb3..0000000000 --- a/licence-header.txt +++ /dev/null @@ -1,10 +0,0 @@ -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on -an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. - -Copyright ${inceptionYear}-${currentYear} the original author or authors. \ No newline at end of file diff --git a/pom.xml b/pom.xml index c1ef8c506a..9e8c4fb3be 100644 --- a/pom.xml +++ b/pom.xml @@ -1,17 +1,15 @@ - + 4.0.0 assertj-core 3.13.3-SNAPSHOT bundle AssertJ fluent assertions Rich and fluent assertions for testing for Java - 2014 org.assertj assertj-parent-pom - 2.2.5 + 2.2.6 @@ -32,21 +30,40 @@ github https://github.com/joel-costigliola/assertj-core/issues + -html5 --allow-script-in-comments --no-module-directories + 1.10.1 + + 5.5.2 + 3.0.0 - org.junit - junit-bom - 5.5.2 - pom - import + net.bytebuddy + byte-buddy + ${byte-buddy.version} + + + net.bytebuddy + byte-buddy-agent + ${byte-buddy.version} + + + org.hamcrest + hamcrest-core + 1.3 + + + org.opentest4j + opentest4j + 1.1.1 + junit @@ -85,7 +102,6 @@ org.opentest4j opentest4j - 1.1.1 provided true @@ -100,23 +116,21 @@ org.hamcrest hamcrest-core - 1.3 provided true net.bytebuddy byte-buddy - 1.10.1 org.mockito mockito-core + test org.mockito mockito-junit-jupiter - 2.23.0 test + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. + +Copyright ${inceptionYear}-${currentYear} the original author or authors. + + + org.apache.maven.plugins maven-enforcer-plugin - enforce-banned-dependencies + enforce-dependency-rules enforce @@ -164,6 +196,7 @@ *:*:*:jar:compile + diff --git a/src/main/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtension.java b/src/main/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtension.java index 79c241094c..e29a6bd4d4 100644 --- a/src/main/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtension.java +++ b/src/main/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtension.java @@ -10,7 +10,6 @@ * * Copyright 2012-2019 the original author or authors. */ - package org.assertj.core.api.junit.jupiter; import static java.lang.String.format; diff --git a/src/main/java9/module-info.java b/src/main/java9/module-info.java index 8510b9041d..20838e3711 100644 --- a/src/main/java9/module-info.java +++ b/src/main/java9/module-info.java @@ -10,7 +10,6 @@ * * Copyright 2012-2019 the original author or authors. */ - module org.assertj.core { // AssertJ Core's package API exports org.assertj.core.annotations; diff --git a/src/test/java/org/assertj/core/api/junit/jupiter/AbstractSoftAssertionsExtensionIntegrationTests.java b/src/test/java/org/assertj/core/api/junit/jupiter/AbstractSoftAssertionsExtensionIntegrationTests.java index f5cdea2b9f..6639bd29f0 100644 --- a/src/test/java/org/assertj/core/api/junit/jupiter/AbstractSoftAssertionsExtensionIntegrationTests.java +++ b/src/test/java/org/assertj/core/api/junit/jupiter/AbstractSoftAssertionsExtensionIntegrationTests.java @@ -10,7 +10,6 @@ * * Copyright 2012-2019 the original author or authors. */ - package org.assertj.core.api.junit.jupiter; import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass; diff --git a/src/test/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtensionUnitTest.java b/src/test/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtensionUnitTest.java index 2e44897e43..6aef52d82c 100644 --- a/src/test/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtensionUnitTest.java +++ b/src/test/java/org/assertj/core/api/junit/jupiter/SoftAssertionsExtensionUnitTest.java @@ -10,7 +10,6 @@ * * Copyright 2012-2019 the original author or authors. */ - package org.assertj.core.api.junit.jupiter; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/org/example/test/AutoClosableSoftAssertionsLineNumberTest.java b/src/test/java/org/example/test/AutoClosableSoftAssertionsLineNumberTest.java index 59491c5621..813018d15f 100644 --- a/src/test/java/org/example/test/AutoClosableSoftAssertionsLineNumberTest.java +++ b/src/test/java/org/example/test/AutoClosableSoftAssertionsLineNumberTest.java @@ -24,16 +24,16 @@ * line number information will be removed by the assertj filtering of internal lines. * {@link org.assertj.core.util.Throwables#removeAssertJRelatedElementsFromStackTrace} */ -public class AutoClosableSoftAssertionsLineNumberTest { +class AutoClosableSoftAssertionsLineNumberTest { @Test - public void should_print_line_numbers_of_failed_assertions() { + void should_print_line_numbers_of_failed_assertions() { AutoCloseableSoftAssertions softly = new AutoCloseableSoftAssertions(); softly.assertThat(1) .isLessThan(0) .isLessThan(1); // WHEN - AssertionError error = catchThrowableOfType(() -> softly.close(), AssertionError.class); + AssertionError error = catchThrowableOfType(softly::close, AssertionError.class); // THEN assertThat(error).hasMessageContaining(format("%n" + "Expecting:%n" diff --git a/src/test/java/org/example/test/BDDSoftAssertionsLineNumberTest.java b/src/test/java/org/example/test/BDDSoftAssertionsLineNumberTest.java index 83853f6f48..99abd548be 100644 --- a/src/test/java/org/example/test/BDDSoftAssertionsLineNumberTest.java +++ b/src/test/java/org/example/test/BDDSoftAssertionsLineNumberTest.java @@ -24,16 +24,16 @@ * line number information will be removed by the assertj filtering of internal lines. * {@link org.assertj.core.util.Throwables#removeAssertJRelatedElementsFromStackTrace} */ -public class BDDSoftAssertionsLineNumberTest { +class BDDSoftAssertionsLineNumberTest { @Test - public void should_print_line_numbers_of_failed_assertions() { + void should_print_line_numbers_of_failed_assertions() { BDDSoftAssertions softly = new BDDSoftAssertions(); softly.then(1) .isLessThan(0) .isLessThan(1); // WHEN - AssertionError error = catchThrowableOfType(() -> softly.assertAll(), AssertionError.class); + AssertionError error = catchThrowableOfType(softly::assertAll, AssertionError.class); // THEN assertThat(error).hasMessageContaining(format("%n" + "Expecting:%n" diff --git a/src/test/java/org/example/test/CustomSoftAssertionsLineNumberTest.java b/src/test/java/org/example/test/CustomSoftAssertionsLineNumberTest.java index cf749483a3..392f0af8e5 100644 --- a/src/test/java/org/example/test/CustomSoftAssertionsLineNumberTest.java +++ b/src/test/java/org/example/test/CustomSoftAssertionsLineNumberTest.java @@ -23,20 +23,20 @@ * The assertions classes have to be in a package other than org.assertj to test * the behavior of line numbers for assertions defined outside the assertj package */ -public class CustomSoftAssertionsLineNumberTest { +class CustomSoftAssertionsLineNumberTest { // ignore because of failure only happening in Travis CI https://travis-ci.org/joel-costigliola/assertj-core/builds/351639100 @Test @Disabled - public void should_print_line_numbers_of_failed_assertions_even_if_custom_assertion_in_non_assertj_package() throws Exception { + void should_print_line_numbers_of_failed_assertions_even_if_custom_assertion_in_non_assertj_package() throws Exception { // GIVEN MyProjectSoftAssertions softly = new MyProjectSoftAssertions(); softly.assertThat(new MyProjectClass("v1")).hasValue("v2"); // WHEN - AssertionError error = catchThrowableOfType(() -> softly.assertAll(), AssertionError.class); + AssertionError error = catchThrowableOfType(softly::assertAll, AssertionError.class); // THEN assertThat(error).hasMessageContaining(format("Expecting value to be but was :%n" + - "at CustomSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions_even_if_custom_assertion_in_non_assertj_package(CustomSoftAssertionsLineNumberTest.java:31)")); + "at CustomSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions_even_if_custom_assertion_in_non_assertj_package(CustomSoftAssertionsLineNumberTest.java:34)")); } } diff --git a/src/test/java/org/example/test/SoftAssertionsLineNumberTest.java b/src/test/java/org/example/test/SoftAssertionsLineNumberTest.java index 4d51ae28b3..058ea74364 100644 --- a/src/test/java/org/example/test/SoftAssertionsLineNumberTest.java +++ b/src/test/java/org/example/test/SoftAssertionsLineNumberTest.java @@ -27,17 +27,17 @@ * line number information will be removed by the assertj filtering of internal lines. * {@link org.assertj.core.util.Throwables#removeAssertJRelatedElementsFromStackTrace} */ -public class SoftAssertionsLineNumberTest { +class SoftAssertionsLineNumberTest { @Test - public void should_print_line_numbers_of_failed_assertions() { + void should_print_line_numbers_of_failed_assertions() { // GIVEN SoftAssertions softly = new SoftAssertions(); softly.assertThat(1) .isLessThan(0) .isLessThan(1); // WHEN - AssertionError error = catchThrowableOfType(() -> softly.assertAll(), AssertionError.class); + AssertionError error = catchThrowableOfType(softly::assertAll, AssertionError.class); // THEN assertThat(error).hasMessageContaining(format("%n" + "Expecting:%n" @@ -54,7 +54,7 @@ public void should_print_line_numbers_of_failed_assertions() { } @Test - public void should_print_line_numbers_of_failed_assertions_even_if_it_came_from_nested_calls() { + void should_print_line_numbers_of_failed_assertions_even_if_it_came_from_nested_calls() { // GIVEN SoftAssertions softly = new SoftAssertions(); softly.assertThat(Optional.empty()).contains("Foo"); @@ -63,7 +63,7 @@ public void should_print_line_numbers_of_failed_assertions_even_if_it_came_from_ Predicate lowercasePredicate = s -> s.equals(s.toLowerCase()); softly.assertThat(lowercasePredicate).accepts("a", "b", "C"); // WHEN - AssertionError error = catchThrowableOfType(() -> softly.assertAll(), AssertionError.class); + AssertionError error = catchThrowableOfType(softly::assertAll, AssertionError.class); // THEN assertThat(error).hasMessageContaining(format("%n" + "Expecting Optional to contain:%n"