Upgrade dependencies including Gradle 6.1

* Add `org.gradle.caching=true` and `org.gradle.parallel=true` into a `gradle.properties`
* Fix `Matcher` tests in the `spring-integration-test-support` for the latest JUnit 4
This commit is contained in:
Artem Bilan
2020-01-16 15:35:16 -05:00
committed by Gary Russell
parent dba307adf6
commit 715e9a2042
7 changed files with 78 additions and 74 deletions

View File

@@ -13,10 +13,10 @@ buildscript {
plugins {
id 'org.sonarqube' version '2.8'
id 'org.asciidoctor.convert' version '1.6.1'
id 'io.spring.nohttp' version '0.0.3.RELEASE' apply false
id 'org.ajoberstar.grgit' version '4.0.0'
id 'io.spring.nohttp' version '0.0.4.RELEASE' apply false
id 'org.ajoberstar.grgit' version '4.0.1'
id "io.spring.dependency-management" version '1.0.8.RELEASE'
id 'com.jfrog.artifactory' version '4.11.0' apply false
id 'com.jfrog.artifactory' version '4.13.0' apply false
}
if (System.getenv('TRAVIS') || System.getenv('bamboo_buildKey')) {
@@ -49,7 +49,7 @@ ext {
aspectjVersion = '1.9.5'
assertjVersion = '3.14.0'
assertkVersion = '0.20'
awaitilityVersion = '4.0.1'
awaitilityVersion = '4.0.2'
commonsDbcp2Version = '2.7.0'
commonsIoVersion = '2.6'
commonsNetVersion = '3.6'
@@ -72,29 +72,29 @@ ext {
jrubyVersion = '9.2.9.0'
jschVersion = '0.1.55'
jsonpathVersion = '2.4.0'
junit4Version = '4.12'
junit4Version = '4.13'
junitJupiterVersion = '5.5.2'
jythonVersion = '2.7.0'
kryoShadedVersion = '4.0.2'
lettuceVersion = '5.2.1.RELEASE'
log4jVersion = '2.13.0'
micrometerVersion = '1.3.2'
micrometerVersion = '1.3.3'
mockitoVersion = '3.2.4'
mongoDriverVersion = '1.12.0'
mysqlVersion = '8.0.18'
pahoMqttClientVersion = '1.2.0'
postgresVersion = '42.2.9'
reactorVersion = 'Dysprosium-BUILD-SNAPSHOT'
reactorVersion = 'Dysprosium-SR3'
resilience4jVersion = '1.2.0'
romeToolsVersion = '1.12.2'
rsocketVersion = '1.0.0-RC5'
servletApiVersion = '4.0.1'
smackVersion = '4.3.4'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.3.BUILD-SNAPSHOT'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-BUILD-SNAPSHOT'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.3.RELEASE'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-M1'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.0.M1'
springRetryVersion = '1.2.5.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.3.BUILD-SNAPSHOT'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.3.RELEASE'
springWsVersion = '3.0.8.RELEASE'
tomcatVersion = "9.0.30"
xstreamVersion = '1.4.11.1'

View File

@@ -1,2 +1,4 @@
version=5.3.0.BUILD-SNAPSHOT
org.gradle.jvmargs=-Xmx1536m -Dfile.encoding=UTF-8
org.gradle.caching=true
org.gradle.parallel=true

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
@@ -52,7 +52,7 @@ public class HeaderMatcherTests {
Message<?> message;
@Before
@BeforeEach
public void setUp() {
message = MessageBuilder.withPayload(ANY_PAYLOAD)
.setHeader(ANY_HEADER_KEY, ANY_HEADER_VALUE)
@@ -61,45 +61,45 @@ public class HeaderMatcherTests {
@Test
public void hasEntry_withValidKeyValue_matches() {
Assert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, ANY_HEADER_VALUE));
Assert.assertThat(message, HeaderMatcher.hasHeader(OTHER_HEADER_KEY, OTHER_HEADER_VALUE));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, ANY_HEADER_VALUE));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeader(OTHER_HEADER_KEY, OTHER_HEADER_VALUE));
}
@Test
public void hasEntry_withUnknownKey_notMatching() {
Assert.assertThat(message, Matchers.not(HeaderMatcher.hasHeader("test.unknown", ANY_HEADER_VALUE)));
MatcherAssert.assertThat(message, Matchers.not(HeaderMatcher.hasHeader("test.unknown", ANY_HEADER_VALUE)));
}
@Test
public void hasEntry_withValidKeyAndMatcherValue_matches() {
Assert.assertThat(message,
MatcherAssert.assertThat(message,
HeaderMatcher.hasHeader(ANY_HEADER_KEY, Matchers.instanceOf(String.class)));
Assert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, Matchers.notNullValue()));
Assert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, Matchers.is(ANY_HEADER_VALUE)));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, Matchers.notNullValue()));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeader(ANY_HEADER_KEY, Matchers.is(ANY_HEADER_VALUE)));
}
@Test
public void hasEntry_withValidKeyAndMatcherValue_notMatching() {
Assert.assertThat(message,
MatcherAssert.assertThat(message,
Matchers.not(HeaderMatcher.hasHeader(ANY_HEADER_KEY,
Matchers.is(Matchers.instanceOf(Integer.class)))));
}
@Test
public void hasKey_withValidKey_matches() {
Assert.assertThat(message, HeaderMatcher.hasHeaderKey(ANY_HEADER_KEY));
Assert.assertThat(message, HeaderMatcher.hasHeaderKey(OTHER_HEADER_KEY));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeaderKey(ANY_HEADER_KEY));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeaderKey(OTHER_HEADER_KEY));
}
@Test
public void hasKey_withInvalidKey_notMatching() {
Assert.assertThat(message, Matchers.not(HeaderMatcher.hasHeaderKey(UNKNOWN_KEY)));
MatcherAssert.assertThat(message, Matchers.not(HeaderMatcher.hasHeaderKey(UNKNOWN_KEY)));
}
@Test
public void hasAllEntries_withMessageHeader_matches() {
Map<String, Object> expectedInHeaderMap = message.getHeaders();
Assert.assertThat(message, HeaderMatcher.hasAllHeaders(expectedInHeaderMap));
MatcherAssert.assertThat(message, HeaderMatcher.hasAllHeaders(expectedInHeaderMap));
}
@Test
@@ -107,7 +107,7 @@ public class HeaderMatcherTests {
Map<String, Object> expectedInHeaderMap = new HashMap<>();
expectedInHeaderMap.put(ANY_HEADER_KEY, ANY_HEADER_VALUE);
expectedInHeaderMap.put(OTHER_HEADER_KEY, Matchers.is(OTHER_HEADER_VALUE));
Assert.assertThat(message, HeaderMatcher.hasAllHeaders(expectedInHeaderMap));
MatcherAssert.assertThat(message, HeaderMatcher.hasAllHeaders(expectedInHeaderMap));
}
@Test
@@ -115,7 +115,7 @@ public class HeaderMatcherTests {
Map<String, Object> expectedInHeaderMap = new HashMap<>();
expectedInHeaderMap.put(ANY_HEADER_KEY, ANY_HEADER_VALUE); // valid
expectedInHeaderMap.put(UNKNOWN_KEY, Matchers.not(Matchers.nullValue())); // fails
Assert.assertThat(message, Matchers.not(HeaderMatcher.hasAllHeaders(expectedInHeaderMap)));
MatcherAssert.assertThat(message, Matchers.not(HeaderMatcher.hasAllHeaders(expectedInHeaderMap)));
expectedInHeaderMap.remove(UNKNOWN_KEY);
expectedInHeaderMap.put(OTHER_HEADER_KEY, ANY_HEADER_VALUE); // fails
}
@@ -123,11 +123,11 @@ public class HeaderMatcherTests {
@Test
public void readableException_singleHeader() {
try {
Assert.assertThat(message, HeaderMatcher.hasHeader("corn", "bread"));
MatcherAssert.assertThat(message, HeaderMatcher.hasHeader("corn", "bread"));
}
catch (AssertionError ae) {
Assert.assertThat(ae.getMessage(), Matchers.containsString("Expected: a Message with Headers containing "
));
MatcherAssert.assertThat(ae.getMessage(),
Matchers.containsString("Expected: a Message with Headers containing "));
}
}
@@ -137,53 +137,53 @@ public class HeaderMatcherTests {
Map<String, String> entries = new HashMap<>();
entries.put("corn", "bread");
entries.put("chocolate", "pudding");
Assert.assertThat(message, HeaderMatcher.hasAllHeaders(entries));
MatcherAssert.assertThat(message, HeaderMatcher.hasAllHeaders(entries));
}
catch (AssertionError ae) {
Assert.assertThat(ae.getMessage(), Matchers.containsString("Expected: a Message with Headers containing "
));
MatcherAssert.assertThat(ae.getMessage(),
Matchers.containsString("Expected: a Message with Headers containing "));
}
}
@Test
public void hasMessageId_sameId() {
Assert.assertThat(message, HeaderMatcher.hasMessageId(message.getHeaders().getId()));
MatcherAssert.assertThat(message, HeaderMatcher.hasMessageId(message.getHeaders().getId()));
}
@Test
public void hasCorrelationId_() {
UUID correlationId = message.getHeaders().getId();
message = MessageBuilder.withPayload("blabla").setHeader("correlationId", correlationId).build();
Assert.assertThat(message, HeaderMatcher.hasCorrelationId(correlationId));
MatcherAssert.assertThat(message, HeaderMatcher.hasCorrelationId(correlationId));
}
@Test
public void hasSequenceNumber_() {
int sequenceNumber = 123;
message = MessageBuilder.fromMessage(message).setHeader("sequenceNumber", sequenceNumber).build();
Assert.assertThat(message, HeaderMatcher.hasSequenceNumber(sequenceNumber));
MatcherAssert.assertThat(message, HeaderMatcher.hasSequenceNumber(sequenceNumber));
}
@Test
public void hasSequenceSize_() {
int sequenceSize = 123;
message = MessageBuilder.fromMessage(message).setHeader("sequenceSize", sequenceSize).build();
Assert.assertThat(message, HeaderMatcher.hasSequenceSize(sequenceSize));
Assert.assertThat(message, HeaderMatcher.hasSequenceSize(Matchers.is(sequenceSize)));
MatcherAssert.assertThat(message, HeaderMatcher.hasSequenceSize(sequenceSize));
MatcherAssert.assertThat(message, HeaderMatcher.hasSequenceSize(Matchers.is(sequenceSize)));
}
@Test
public void hasTimestamp_() {
Assert.assertThat(message, HeaderMatcher.hasTimestamp(new Date(message.getHeaders().getTimestamp())));
MatcherAssert.assertThat(message, HeaderMatcher.hasTimestamp(new Date(message.getHeaders().getTimestamp())));
}
@Test
public void hasExpirationDate_() {
Assert.assertThat(message, Matchers.not(HeaderMatcher.hasExpirationDate(Matchers.any(Long.class))));
MatcherAssert.assertThat(message, Matchers.not(HeaderMatcher.hasExpirationDate(Matchers.any(Long.class))));
Date expirationDate = new Date(System.currentTimeMillis() + 10000);
message = MessageBuilder.fromMessage(message).setHeader("expirationDate", expirationDate.getTime()).build();
Assert.assertThat(message, HeaderMatcher.hasExpirationDate(expirationDate));
Assert.assertThat(message,
MatcherAssert.assertThat(message, HeaderMatcher.hasExpirationDate(expirationDate));
MatcherAssert.assertThat(message,
HeaderMatcher.hasExpirationDate(Matchers.not(Matchers.is((System.currentTimeMillis())))));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,14 +19,15 @@ package org.springframework.integration.test.matcher;
import java.util.HashMap;
import java.util.Map;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* @author Alex Peters
* @author Gunnar Hillert
* @author Artem Bilan
*
*/
public class MapContainsTests {
@@ -39,11 +40,11 @@ public class MapContainsTests {
static final String OTHER_KEY = "test.number";
static final Integer OTHER_VALUE = Integer.valueOf(123);
static final Integer OTHER_VALUE = 123;
private HashMap<String, Object> map;
@Before
@BeforeEach
public void setUp() {
map = new HashMap<>();
map.put(SOME_KEY, SOME_VALUE);
@@ -52,36 +53,36 @@ public class MapContainsTests {
@Test
public void hasKey_validKey_matching() {
Assert.assertThat(map, Matchers.hasKey(SOME_KEY));
MatcherAssert.assertThat(map, Matchers.hasKey(SOME_KEY));
}
@Test
public void hasKey_unknownKey_notMatching() {
Assert.assertThat(map, Matchers.not(Matchers.hasKey(UNKNOWN_KEY)));
MatcherAssert.assertThat(map, Matchers.not(Matchers.hasKey(UNKNOWN_KEY)));
}
@Test
public void hasEntry_withValidKeyValue_matches() {
Assert.assertThat(map, Matchers.hasEntry(SOME_KEY, SOME_VALUE));
Assert.assertThat(map, Matchers.hasEntry(OTHER_KEY, OTHER_VALUE));
MatcherAssert.assertThat(map, Matchers.hasEntry(SOME_KEY, SOME_VALUE));
MatcherAssert.assertThat(map, Matchers.hasEntry(OTHER_KEY, OTHER_VALUE));
}
@Test
public void hasEntry_withUnknownKey_notMatching() {
Assert.assertThat(map, Matchers.not(Matchers.hasEntry("test.unknown", SOME_VALUE)));
MatcherAssert.assertThat(map, Matchers.not(Matchers.hasEntry("test.unknown", SOME_VALUE)));
}
@Test
public void hasEntry_withValidKeyAndMatcherValue_matches() {
Assert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.instanceOf(String.class)));
Assert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.notNullValue()));
Assert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.is(SOME_VALUE)));
MatcherAssert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.instanceOf(String.class)));
MatcherAssert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.notNullValue()));
MatcherAssert.assertThat(map, Matchers.hasEntry(Matchers.is(SOME_KEY), Matchers.is(SOME_VALUE)));
}
@Test
public void hasEntry_withValidKeyAndMatcherValue_notMatching() {
Assert.assertThat(map,
MatcherAssert.assertThat(map,
Matchers.not(Matchers.hasEntry(SOME_KEY, Matchers.is(Matchers.instanceOf(Integer.class)))));
}
@@ -90,9 +91,9 @@ public class MapContainsTests {
Map<String, String> map = new HashMap<>();
map.put("a", "b");
map.put("c", "d");
Assert.assertThat(map, Matchers.hasEntry("a", "b"));
Assert.assertThat(map, Matchers.not(Matchers.hasEntry(SOME_KEY, Matchers.is("a"))));
Assert.assertThat(map, MapContentMatchers.hasAllEntries(map));
MatcherAssert.assertThat(map, Matchers.hasEntry("a", "b"));
MatcherAssert.assertThat(map, Matchers.not(Matchers.hasEntry(SOME_KEY, Matchers.is("a"))));
MatcherAssert.assertThat(map, MapContentMatchers.hasAllEntries(map));
}
@Test
@@ -100,7 +101,7 @@ public class MapContainsTests {
Map<String, Object> expectedInHeaderMap = new HashMap<>();
expectedInHeaderMap.put(SOME_KEY, SOME_VALUE);
expectedInHeaderMap.put(OTHER_KEY, Matchers.is(OTHER_VALUE));
Assert.assertThat(map, MapContentMatchers.hasAllEntries(expectedInHeaderMap));
MatcherAssert.assertThat(map, MapContentMatchers.hasAllEntries(expectedInHeaderMap));
}
@Test
@@ -108,7 +109,7 @@ public class MapContainsTests {
Map<String, Object> expectedInHeaderMap = new HashMap<>();
expectedInHeaderMap.put(SOME_KEY, SOME_VALUE); // valid
expectedInHeaderMap.put(UNKNOWN_KEY, Matchers.not(Matchers.nullValue())); // fails
Assert.assertThat(map, Matchers.not(MapContentMatchers.hasAllEntries(expectedInHeaderMap)));
MatcherAssert.assertThat(map, Matchers.not(MapContentMatchers.hasAllEntries(expectedInHeaderMap)));
expectedInHeaderMap.remove(UNKNOWN_KEY);
expectedInHeaderMap.put(OTHER_KEY, SOME_VALUE); // fails
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@ package org.springframework.integration.test.matcher;
import java.math.BigDecimal;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.messaging.Message;
import org.springframework.messaging.support.MessageBuilder;
@@ -39,33 +39,34 @@ public class PayloadMatcherTests {
@Test
public void hasPayload_withEqualValue_matches() {
Assert.assertThat(this.message, PayloadMatcher.hasPayload(new BigDecimal("1.123")));
MatcherAssert.assertThat(this.message, PayloadMatcher.hasPayload(new BigDecimal("1.123")));
}
@Test
public void hasPayload_withNotEqualValue_notMatching() {
Assert.assertThat(this.message, Matchers.not(PayloadMatcher.hasPayload(new BigDecimal("456"))));
MatcherAssert.assertThat(this.message, Matchers.not(PayloadMatcher.hasPayload(new BigDecimal("456"))));
}
@Test
public void hasPayload_withMatcher_matches() {
Assert.assertThat(this.message, PayloadMatcher.hasPayload(Matchers.is(Matchers.instanceOf(BigDecimal.class))));
Assert.assertThat(this.message, PayloadMatcher.hasPayload(Matchers.notNullValue()));
MatcherAssert.assertThat(this.message,
PayloadMatcher.hasPayload(Matchers.is(Matchers.instanceOf(BigDecimal.class))));
MatcherAssert.assertThat(this.message, PayloadMatcher.hasPayload(Matchers.notNullValue()));
}
@Test
public void hasPayload_withNotMatchingMatcher_notMatching() {
Assert.assertThat(this.message,
MatcherAssert.assertThat(this.message,
Matchers.not((PayloadMatcher.hasPayload(Matchers.is(Matchers.instanceOf(String.class))))));
}
@Test
public void readableException() {
try {
Assert.assertThat(this.message, PayloadMatcher.hasPayload("woot"));
MatcherAssert.assertThat(this.message, PayloadMatcher.hasPayload("woot"));
}
catch (AssertionError ae) {
Assert.assertThat(ae.getMessage(), Matchers.containsString("Expected: a Message with payload: "));
MatcherAssert.assertThat(ae.getMessage(), Matchers.containsString("Expected: a Message with payload: "));
}
}