Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise required Java version to 17 #3447

Draft
wants to merge 2 commits into
base: 3.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 7 additions & 15 deletions assertj-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,26 +317,15 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>jdk9</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
</executions>
<configuration>
<useModulePath>false</useModulePath> <!-- FIXME #3446 -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useModulePath>false</useModulePath> <!-- FIXME #3446 -->
<trimStackTrace>false</trimStackTrace>
<excludes>
<exclude>org/assertj/core/internal/objects/Objects_assertHasOnlyFields_Test*</exclude>
Expand Down Expand Up @@ -419,6 +408,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<legacyMode>true</legacyMode> <!-- FIXME #3446 -->
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down
6 changes: 0 additions & 6 deletions assertj-guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
25 changes: 25 additions & 0 deletions assertj-guava/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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 2012-2024 the original author or authors.
*/

/**
* AssertJ extension for Guava assertions.
*/
module org.assertj.guava {
requires transitive org.assertj.core;
requires com.google.common;

exports org.assertj.guava.api;
exports org.assertj.guava.data;
exports org.assertj.guava.error;
exports org.assertj.guava.util;
}
2 changes: 1 addition & 1 deletion assertj-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<additionalparam>-Xdoclint:none</additionalparam>
<java.version>8</java.version>
<java.version>17</java.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.release>${java.version}</maven.compiler.release>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.assertj</groupId>
<artifactId>assertj-integration-tests</artifactId>
<version>3.26.0-SNAPSHOT</version>
</parent>

<artifactId>assertj-guava-module-path</artifactId>

<name>AssertJ Guava Integration Tests - Module Path</name>

<properties>
<rootDirectory>${project.basedir}/../../../</rootDirectory>
<spotless.skip>false</spotless.skip>
</properties>

<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.0-jre</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-guava</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 2012-2024 the original author or authors.
*/
open module org.assertj.guava.tests {
requires com.google.common;
requires org.assertj.guava;
requires org.junit.jupiter.params;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.guava.api.Assertions.assertThat;

import org.assertj.guava.api.MultimapAssert;
import org.junit.jupiter.api.Test;

import com.google.common.collect.HashMultimap;
Expand All @@ -35,14 +36,4 @@ void should_create_Assert() {
then(assertion).isNotNull();
}

@Test
void should_pass_actual() {
// GIVEN
Multimap<String, String> actual = HashMultimap.create();
// WHEN
Multimap<String, String> result = assertThat(actual).getActual();
// THEN
then(result).isSameAs(actual);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.guava.api.Assertions.assertThat;

import org.assertj.guava.api.OptionalAssert;
import org.junit.jupiter.api.Test;

import com.google.common.base.Optional;

/**
* @author Joel Costigliola
*/
@SuppressWarnings("Guava")
class Assertions_assertThat_with_Optional_Test {

@Test
Expand All @@ -35,14 +35,4 @@ void should_create_Assert() {
then(assertion).isNotNull();
}

@Test
void should_pass_actual() {
// GIVEN
Optional<String> actual = Optional.of("value");
// WHEN
Optional<String> result = assertThat(actual).getActual();
// THEN
then(result).isSameAs(actual);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static java.util.stream.Collectors.toMap;
import static org.assertj.core.api.Assertions.assertThat;
Expand All @@ -34,6 +34,11 @@
import java.util.stream.Stream;

import org.assertj.core.api.InstanceOfAssertFactory;
import org.assertj.guava.api.Assertions;
import org.assertj.guava.api.InstanceOfAssertFactories;
import org.assertj.guava.api.RangeAssert;
import org.assertj.guava.api.RangeMapAssert;
import org.assertj.guava.api.RangeSetAssert;
import org.junit.jupiter.api.Test;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.guava.api.Assertions.assertThat;
import static org.assertj.guava.error.ShouldHaveSameContent.shouldHaveSameContent;
import static org.assertj.guava.testkit.AssertionErrors.expectAssertionError;
import static org.assertj.guava.tests.testkit.AssertionErrors.expectAssertionError;

import java.io.IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.MapEntry.entry;
Expand All @@ -29,6 +29,15 @@

import java.io.IOException;

import org.assertj.guava.api.Assertions;
import org.assertj.guava.api.ByteSourceAssert;
import org.assertj.guava.api.MultimapAssert;
import org.assertj.guava.api.MultisetAssert;
import org.assertj.guava.api.OptionalAssert;
import org.assertj.guava.api.RangeAssert;
import org.assertj.guava.api.RangeMapAssert;
import org.assertj.guava.api.RangeSetAssert;
import org.assertj.guava.api.TableAssert;
import org.junit.jupiter.api.Test;

import com.google.common.base.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static com.google.common.collect.Lists.newArrayList;

Expand All @@ -35,4 +35,4 @@ public void setUp() {
actual.putAll("Spurs", newArrayList("Tony Parker", "Tim Duncan", "Manu Ginobili"));
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.catchThrowable;
Expand All @@ -20,8 +20,8 @@
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.core.util.Lists.list;
import static org.assertj.guava.api.Assertions.assertThat;
import static org.assertj.guava.testkit.AssertionErrors.expectAssertionError;

import org.assertj.guava.tests.testkit.AssertionErrors;
import org.junit.jupiter.api.Test;

import com.google.common.collect.HashMultimap;
Expand Down Expand Up @@ -76,7 +76,7 @@ void should_fail_if_actual_is_null() {
// GIVEN
actual = null;
// WHEN
AssertionError error = expectAssertionError(() -> assertThat(actual).containsAllEntriesOf(other));
AssertionError error = AssertionErrors.expectAssertionError(() -> assertThat(actual).containsAllEntriesOf(other));
// THEN
then(error).hasMessage(actualIsNull());
}
Expand All @@ -100,7 +100,7 @@ void should_fail_if_actual_does_not_contain_all_given_multimap_entries() {
other.putAll("Spurs", newArrayList("Tony Parker", "Tim Duncan", "Manu Ginobili"));
other.putAll("Warriors", newArrayList("Stephen Curry", "Klay Thompson"));
// WHEN
AssertionError error = expectAssertionError(() -> assertThat(actual).containsAllEntriesOf(other));
AssertionError error = AssertionErrors.expectAssertionError(() -> assertThat(actual).containsAllEntriesOf(other));
// THEN
then(error).hasMessage(shouldContain(actual, other,
list(entry("Warriors", "Stephen Curry"), entry("Warriors", "Klay Thompson"))).create());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* Copyright 2012-2024 the original author or authors.
*/
package org.assertj.guava.api;
package org.assertj.guava.tests.api;

import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down