Fix tests for wrong messages in assertions

https://build.spring.io/browse/INT-MASTER-560/

**Cherry-pick to 4.3.x**
This commit is contained in:
Artem Bilan
2017-02-24 12:45:56 -05:00
parent 56f72cb736
commit af711a0d30
3 changed files with 10 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 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.
@@ -185,7 +185,7 @@ public class DelegatingConsumerParserTests {
fail("expected exception");
}
catch (Exception e) {
assertEquals("An AbstractReplyProducingMessageHandler may only be referenced once (foo) - "
assertEquals("An AbstractMessageProducingMessageHandler may only be referenced once (foo) - "
+ "use scope=\"prototype\"", e.getMessage());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2017 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.
@@ -171,7 +171,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
this.handlerTestInputChannel.send(message);
}
// INT-2399
// INT-2399
@Test
public void testMessageProcessor() {
Object processor = TestUtils.getPropertyValue(processorTestService, "handler.processor");
@@ -197,7 +197,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
assertThat(e.getCause(), Matchers.instanceOf(BeanCreationException.class));
assertThat(e.getCause().getCause(), Matchers.instanceOf(IllegalArgumentException.class));
assertThat(e.getCause().getCause().getMessage(),
Matchers.containsString("An AbstractReplyProducingMessageHandler may only be referenced once"));
Matchers.containsString("An AbstractMessageProducingMessageHandler may only be referenced once"));
}
}
@@ -219,13 +219,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
public void testAsyncWithDirectReply() {
DirectChannel replyChannel = new DirectChannel();
final AtomicReference<Message<?>> reply = new AtomicReference<Message<?>>();
replyChannel.subscribe(new MessageHandler() {
@Override
public void handleMessage(Message<?> message) throws MessagingException {
reply.set(message);
}
});
replyChannel.subscribe(reply::set);
Message<?> message = MessageBuilder.withPayload("testing").setReplyChannel(replyChannel).build();
this.asyncIn.send(message);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -147,7 +147,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
this.handlerTestInputChannel.send(message);
}
// INT-2399
// INT-2399
@Test
public void testMessageProcessor() {
Object processor = TestUtils.getPropertyValue(processorTestService, "handler.processor");
@@ -173,7 +173,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
assertThat(e.getCause(), Matchers.instanceOf(BeanCreationException.class));
assertThat(e.getCause().getCause(), Matchers.instanceOf(IllegalArgumentException.class));
assertThat(e.getCause().getCause().getMessage(),
Matchers.containsString("An AbstractReplyProducingMessageHandler may only be referenced once"));
Matchers.containsString("An AbstractMessageProducingMessageHandler may only be referenced once"));
}
}
@@ -230,6 +230,7 @@ public class ServiceActivatorDefaultFrameworkMethodTests {
public String processMessage(Message<?> message) {
return prefix + ":" + message.getPayload();
}
}
}