Start version 5.4
* Fix compatibility after upgrading to some latest dependencies
This commit is contained in:
14
build.gradle
14
build.gradle
@@ -59,9 +59,9 @@ ext {
|
||||
derbyVersion = '10.14.2.0'
|
||||
ftpServerVersion = '1.1.1'
|
||||
googleJsr305Version = '3.0.2'
|
||||
groovyVersion = '2.5.11'
|
||||
groovyVersion = '3.0.3'
|
||||
hamcrestVersion = '2.2'
|
||||
hazelcastVersion = '3.12.6'
|
||||
hazelcastVersion = '4.0.1'
|
||||
hibernateVersion = '5.4.14.Final'
|
||||
hsqldbVersion = '2.5.0'
|
||||
h2Version = '1.4.200'
|
||||
@@ -92,11 +92,11 @@ ext {
|
||||
rsocketVersion = '1.0.0'
|
||||
servletApiVersion = '4.0.1'
|
||||
smackVersion = '4.3.4'
|
||||
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.2.6.RELEASE'
|
||||
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-RELEASE'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.3.2.RELEASE'
|
||||
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '2.3.0.BUILD-SNAPSHOT'
|
||||
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : 'Neumann-BUILD-SNAPSHOT'
|
||||
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '5.4.0.BUILD-SNAPSHOT'
|
||||
springRetryVersion = '1.2.5.RELEASE'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.2.6.RELEASE'
|
||||
springVersion = project.hasProperty('springVersion') ? project.springVersion : '5.3.0-SNAPSHOT'
|
||||
springWsVersion = '3.0.9.RELEASE'
|
||||
tomcatVersion = "9.0.35"
|
||||
xstreamVersion = '1.4.12'
|
||||
@@ -112,7 +112,7 @@ allprojects {
|
||||
if (project.hasProperty('mavenLocal')) {
|
||||
mavenLocal()
|
||||
}
|
||||
if (version.endsWith('BUILD-SNAPSHOT')) {
|
||||
if (version.endsWith('SNAPSHOT')) {
|
||||
maven { url 'https://repo.spring.io/libs-snapshot' }
|
||||
}
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version=5.3.1.BUILD-SNAPSHOT
|
||||
version=5.4.0-SNAPSHOT
|
||||
org.gradle.jvmargs=-Xmx1536m -Dfile.encoding=UTF-8
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
|
||||
@@ -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.
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.groovy.config;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -26,8 +26,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
@@ -43,8 +42,7 @@ import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.support.ErrorMessage;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.scripting.groovy.GroovyObjectCustomizer;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import groovy.lang.GroovyObject;
|
||||
import groovy.lang.MissingPropertyException;
|
||||
@@ -54,10 +52,10 @@ import groovy.lang.MissingPropertyException;
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Artem Bilan
|
||||
* @author Gunnar Hillert
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@ContextConfiguration
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@SpringJUnitConfig
|
||||
public class GroovyServiceActivatorTests {
|
||||
|
||||
@Autowired
|
||||
@@ -86,7 +84,7 @@ public class GroovyServiceActivatorTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void referencedScriptAndCustomiser() throws Exception {
|
||||
public void referencedScriptAndCustomizer() throws Exception {
|
||||
groovyCustomizer.executed = false;
|
||||
QueueChannel replyChannel = new QueueChannel();
|
||||
replyChannel.setBeanName("returnAddress");
|
||||
@@ -134,7 +132,7 @@ public class GroovyServiceActivatorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void inlineScript() throws Exception {
|
||||
public void inlineScript() {
|
||||
groovyCustomizer.executed = false;
|
||||
QueueChannel replyChannel = new QueueChannel();
|
||||
replyChannel.setBeanName("returnAddress");
|
||||
@@ -156,7 +154,7 @@ public class GroovyServiceActivatorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScriptWithoutVariables() throws Exception {
|
||||
public void testScriptWithoutVariables() {
|
||||
PollableChannel replyChannel = new QueueChannel();
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
Message<?> message = MessageBuilder.withPayload("test-" + i).setReplyChannel(replyChannel).build();
|
||||
@@ -174,33 +172,28 @@ public class GroovyServiceActivatorTests {
|
||||
assertThat(replyChannel.receive(0)).isNull();
|
||||
}
|
||||
|
||||
//INT-2399
|
||||
@Test(expected = MessageHandlingException.class)
|
||||
public void invalidInlineScript() throws Exception {
|
||||
Message<?> message =
|
||||
new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!"));
|
||||
try {
|
||||
this.invalidInlineScript.send(message);
|
||||
fail("MessageHandlingException expected!");
|
||||
}
|
||||
catch (Exception e) {
|
||||
Throwable cause = e.getCause();
|
||||
assertThat(cause.getClass()).isEqualTo(MissingPropertyException.class);
|
||||
assertThat(cause.getMessage()).contains("No such property: ReplyRequiredException for class: script");
|
||||
throw e;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void invalidInlineScript() {
|
||||
assertThatExceptionOfType(MessageHandlingException.class)
|
||||
.isThrownBy(() ->
|
||||
this.invalidInlineScript.send(
|
||||
new ErrorMessage(
|
||||
new ReplyRequiredException(new GenericMessage<>("test"), "reply required!"))))
|
||||
.withStackTraceContaining("No such property: ReplyRequiredException for class: Script_")
|
||||
.withCauseInstanceOf(MissingPropertyException.class);
|
||||
}
|
||||
|
||||
@Test(expected = BeanDefinitionParsingException.class)
|
||||
public void variablesAndScriptVariableGenerator() throws Exception {
|
||||
new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withgenerator-context.xml",
|
||||
this.getClass()).close();
|
||||
@Test
|
||||
public void variablesAndScriptVariableGenerator() {
|
||||
assertThatExceptionOfType(BeanDefinitionParsingException.class)
|
||||
.isThrownBy(() ->
|
||||
new ClassPathXmlApplicationContext("GroovyServiceActivatorTests-fail-withgenerator-context.xml",
|
||||
this.getClass()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGroovyScriptForOutboundChannelAdapter() {
|
||||
this.outboundChannelAdapterWithGroovy.send(new GenericMessage<String>("foo"));
|
||||
this.outboundChannelAdapterWithGroovy.send(new GenericMessage<>("foo"));
|
||||
assertThat(this.invoked.get()).isTrue();
|
||||
}
|
||||
|
||||
@@ -208,7 +201,7 @@ public class GroovyServiceActivatorTests {
|
||||
public static class SampleScriptVariSource implements ScriptVariableGenerator {
|
||||
|
||||
public Map<String, Object> generateScriptVariables(Message<?> message) {
|
||||
Map<String, Object> variables = new HashMap<String, Object>();
|
||||
Map<String, Object> variables = new HashMap<>();
|
||||
variables.put("foo", "foo");
|
||||
variables.put("bar", "bar");
|
||||
variables.put("date", new Date());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-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.
|
||||
@@ -27,8 +27,7 @@ import java.util.Collections;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -80,7 +79,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.socket.client.WebSocketClient;
|
||||
import org.springframework.web.socket.client.standard.StandardWebSocketClient;
|
||||
@@ -104,7 +103,7 @@ import org.springframework.web.socket.sockjs.client.WebSocketTransport;
|
||||
* @since 4.1
|
||||
*/
|
||||
@ContextConfiguration(classes = StompIntegrationTests.ClientConfig.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringJUnitConfig
|
||||
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
|
||||
public class StompIntegrationTests {
|
||||
|
||||
@@ -382,7 +381,6 @@ public class StompIntegrationTests {
|
||||
}
|
||||
|
||||
@Bean
|
||||
@SuppressWarnings("unchecked")
|
||||
public ApplicationListener<ApplicationEvent> webSocketEventListener() {
|
||||
ApplicationEventListeningMessageProducer producer = new ApplicationEventListeningMessageProducer();
|
||||
producer.setEventTypes(AbstractSubProtocolEvent.class);
|
||||
@@ -446,7 +444,7 @@ public class StompIntegrationTests {
|
||||
|
||||
@MessagingGateway
|
||||
@Controller
|
||||
interface WebSocketGateway {
|
||||
public interface WebSocketGateway {
|
||||
|
||||
@MessageMapping("/greeting")
|
||||
@SendToUser("/queue/answer")
|
||||
|
||||
Reference in New Issue
Block a user