Skip to content

Commit e17e744

Browse files
committed
Dependency upgrades
Upgrades: * Maven Enforcer Plugin to 3.0.0-M3 * Maven Surefire Plugin to 3.0.0-M5 * Maven Checkstyle Plugin to 3.1.1 * Maven Bundle Plugin to 5.1.1 * Jacoco Maven Plugin to 0.8.6 * Checkstyle to 8.36.1 * JUnit Jipiter to 5.7.0 * AssertJ to 3.17.2 * Guava to 29.0-jre Fix AssertJ breaking changes Use Java 8 or Apache Commons IO instead of Guava where possible Update GitHub Actions to use JDK 14 and JDK 15-ea
1 parent 52ab22b commit e17e744

11 files changed

Lines changed: 31 additions & 39 deletions

File tree

.github/workflows/java-ea.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
java: [15-ea]
10+
java: [16-ea]
1111
name: 'Linux JDK ${{ matrix.java }}'
1212
runs-on: ubuntu-latest
1313
steps:

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
java: [11, 13, 14]
14+
java: [11, 13, 15]
1515
name: 'Linux JDK ${{ matrix.java }}'
1616
runs-on: ubuntu-latest
1717
steps:

parent/pom.xml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,16 @@
2222
<properties>
2323
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2424
<org.mapstruct.gem.version>1.0.0.Alpha2</org.mapstruct.gem.version>
25-
<!-- We can't go to 3.0.0-M2 as it has a regression. See https://issues.apache.org/jira/browse/MENFORCER-306 -->
26-
<org.apache.maven.plugins.enforcer.version>3.0.0-M1</org.apache.maven.plugins.enforcer.version>
27-
<org.apache.maven.plugins.surefire.version>3.0.0-M3</org.apache.maven.plugins.surefire.version>
25+
<org.apache.maven.plugins.enforcer.version>3.0.0-M3</org.apache.maven.plugins.enforcer.version>
26+
<org.apache.maven.plugins.surefire.version>3.0.0-M5</org.apache.maven.plugins.surefire.version>
2827
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
2928
<org.springframework.version>4.0.3.RELEASE</org.springframework.version>
3029
<org.eclipse.tycho.compiler-jdt.version>1.6.0</org.eclipse.tycho.compiler-jdt.version>
31-
<com.puppycrawl.tools.checkstyle.version>8.29</com.puppycrawl.tools.checkstyle.version>
32-
<org.junit.jupiter.version>5.6.0</org.junit.jupiter.version>
30+
<com.puppycrawl.tools.checkstyle.version>8.36.1</com.puppycrawl.tools.checkstyle.version>
31+
<org.junit.jupiter.version>5.7.0</org.junit.jupiter.version>
3332
<add.release.arguments />
3433
<forkCount>1</forkCount>
35-
<assertj.version>3.11.1</assertj.version>
34+
<assertj.version>3.17.2</assertj.version>
3635
<!-- automatically run annotation processors within the incremental compilation -->
3736
<!-- Needed for the hickory processor-->
3837
<m2e.apt.activation>jdt_apt</m2e.apt.activation>
@@ -112,7 +111,7 @@
112111
<dependency>
113112
<groupId>com.google.guava</groupId>
114113
<artifactId>guava</artifactId>
115-
<version>19.0</version>
114+
<version>29.0-jre</version>
116115
</dependency>
117116
<dependency>
118117
<groupId>org.mapstruct.tools.gem</groupId>
@@ -307,7 +306,7 @@
307306
<plugin>
308307
<groupId>org.apache.maven.plugins</groupId>
309308
<artifactId>maven-checkstyle-plugin</artifactId>
310-
<version>3.1.0</version>
309+
<version>3.1.1</version>
311310
<configuration>
312311
<configLocation>build-config/checkstyle.xml</configLocation>
313312
<consoleOutput>true</consoleOutput>
@@ -383,7 +382,7 @@
383382
<plugin>
384383
<groupId>org.apache.felix</groupId>
385384
<artifactId>maven-bundle-plugin</artifactId>
386-
<version>4.0.0</version>
385+
<version>5.1.1</version>
387386
<executions>
388387
<execution>
389388
<id>bundle-manifest</id>
@@ -529,7 +528,7 @@
529528
<plugin>
530529
<groupId>org.jacoco</groupId>
531530
<artifactId>jacoco-maven-plugin</artifactId>
532-
<version>0.8.5</version>
531+
<version>0.8.6</version>
533532
</plugin>
534533
<plugin>
535534
<groupId>org.jvnet.jaxb2.maven2</groupId>

processor/src/test/java/org/mapstruct/ap/test/bugs/_1338/Issue1338Test.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
17-
import static org.assertj.core.api.Assertions.atIndex;
1817

1918
/**
2019
* @author Filip Hrisafov
@@ -34,9 +33,8 @@ public void shouldCorrectlyUseAdder() {
3433
source.setProperties( Arrays.asList( "first", "second" ) );
3534
Target target = Issue1338Mapper.INSTANCE.map( source );
3635

37-
assertThat( target )
38-
.extracting( "properties" )
39-
.contains( Arrays.asList( "first", "second" ), atIndex( 0 ) );
36+
assertThat( target.getProperties() )
37+
.containsExactly( "first", "second" );
4038

4139
Source mapped = Issue1338Mapper.INSTANCE.map( target );
4240

processor/src/test/java/org/mapstruct/ap/test/bugs/_1359/Issue1359Test.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
1616

1717
import static org.assertj.core.api.Assertions.assertThat;
18-
import static org.assertj.core.api.Assertions.atIndex;
18+
import static org.assertj.core.api.InstanceOfAssertFactories.ITERABLE;
1919

2020
/**
2121
* @author Filip Hrisafov
@@ -33,14 +33,14 @@ public class Issue1359Test {
3333
public void shouldCompile() {
3434

3535
Target target = new Target();
36-
assertThat( target ).extracting( "properties" ).contains( null, atIndex( 0 ) );
36+
assertThat( target ).extracting( "properties" ).isNull();
3737

3838
Set<String> properties = new HashSet<>();
3939
properties.add( "first" );
4040
Source source = new Source( properties );
4141
Issue1359Mapper.INSTANCE.map( target, source );
4242

43-
assertThat( target ).extracting( "properties" ).contains( properties, atIndex( 0 ) );
43+
assertThat( target ).extracting( "properties", ITERABLE ).containsExactly( "first" );
4444

4545
}
4646
}

processor/src/test/java/org/mapstruct/ap/test/bugs/_895/Issue895Test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public void properlyMapsMultiDimensionalArrays() {
3232
assertThat( listOfByteArray.getBytes() ).containsExactly( new byte[] { 0, 1 }, new byte[] { 1, 2 } );
3333

3434
arrayOfByteArray = Mappers.getMapper( MultiArrayMapper.class ).convert( listOfByteArray );
35-
assertThat( arrayOfByteArray.getBytes() ).containsExactly( new byte[] { 0, 1 }, new byte[] { 1, 2 } );
35+
assertThat( arrayOfByteArray.getBytes() ).isDeepEqualTo( new byte[][] { { 0, 1 }, { 1, 2 } } );
3636
}
3737
}

processor/src/test/java/org/mapstruct/ap/test/builder/nestedprop/expanding/FlattenedStock.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
package org.mapstruct.ap.test.builder.nestedprop.expanding;
77

8-
import static com.google.common.base.Preconditions.checkNotNull;
8+
import static java.util.Objects.requireNonNull;
99

1010
public class FlattenedStock {
1111
private String article1;
@@ -16,8 +16,8 @@ public FlattenedStock() {
1616
}
1717

1818
public FlattenedStock(String article1, String article2, int count) {
19-
this.article1 = checkNotNull( article1 );
20-
this.article2 = checkNotNull( article2 );
19+
this.article1 = requireNonNull( article1 );
20+
this.article2 = requireNonNull( article2 );
2121
this.count = count;
2222
}
2323

processor/src/test/java/org/mapstruct/ap/test/collection/Target.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
import java.util.ArrayList;
99
import java.util.Collection;
1010
import java.util.EnumSet;
11+
import java.util.HashMap;
1112
import java.util.HashSet;
1213
import java.util.List;
1314
import java.util.Map;
1415
import java.util.Set;
1516

16-
import com.google.common.collect.Lists;
17-
import com.google.common.collect.Maps;
18-
1917
public class Target {
2018

2119
//CHECKSTYLE:OFF
@@ -54,10 +52,11 @@ public class Target {
5452
private StringHolderToLongMap nonGenericMapStringtoLong;
5553

5654
public Target() {
57-
otherStringLongMap = Maps.newHashMap();
55+
otherStringLongMap = new HashMap<>();
5856
otherStringLongMap.put( "not-present-after-mapping", 42L );
5957

60-
otherStringList = Lists.newArrayList( "not-present-after-mapping" );
58+
otherStringList = new ArrayList<>();
59+
otherStringList.add( "not-present-after-mapping" );
6160
}
6261

6362
public List<String> getStringList() {

processor/src/test/java/org/mapstruct/ap/test/collection/iterabletononiterable/StringListMapper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
import java.util.Arrays;
99
import java.util.List;
1010

11-
import com.google.common.base.Joiner;
12-
1311
public class StringListMapper {
1412

1513
public String stringListToString(List<String> strings) {
16-
return strings == null ? null : Joiner.on( "-" ).join( strings );
14+
return strings == null ? null : String.join( "-", strings );
1715
}
1816

1917
public List<String> stringToStringList(String string) {

processor/src/test/java/org/mapstruct/ap/testutil/assertions/JavaFileAssert.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import java.util.ArrayList;
1616
import java.util.List;
1717

18+
import org.apache.commons.io.FileUtils;
1819
import org.assertj.core.api.AbstractCharSequenceAssert;
1920
import org.assertj.core.api.Assertions;
2021
import org.assertj.core.api.FileAssert;
@@ -23,9 +24,6 @@
2324
import org.assertj.core.internal.Failures;
2425
import org.assertj.core.util.diff.Delta;
2526

26-
import com.google.common.base.Charsets;
27-
import com.google.common.io.Files;
28-
2927
/**
3028
* Allows to perform assertions on .java source files.
3129
*
@@ -58,7 +56,7 @@ public AbstractCharSequenceAssert<?, String> content() {
5856
isFile();
5957

6058
try {
61-
return Assertions.assertThat( Files.toString( actual, Charsets.UTF_8 ) );
59+
return Assertions.assertThat( FileUtils.readFileToString( actual, StandardCharsets.UTF_8 ) );
6260
}
6361
catch ( IOException e ) {
6462
failWithMessage( "Unable to read" + actual.toString() + ". Exception: " + e.getMessage() );

0 commit comments

Comments
 (0)