INT-2399-maint:

Refactor ReplyRequiredException to MessageHandlingException
This commit is contained in:
Artem Bilan
2012-02-07 17:26:21 +02:00
committed by Mark Fisher
parent dad420c6ac
commit 013e09c888
2 changed files with 4 additions and 5 deletions

View File

@@ -45,9 +45,9 @@
<service-activator input-channel="invalidInlineScript">
<groovy:script>
<![CDATA[
//import org.springframework.integration.handler.ReplyRequiredException
//import org.springframework.integration.MessageHandlingException
if (payload in ReplyRequiredException) return 'OK'
if (payload in MessageHandlingException) return 'OK'
throw payload
]]>
</groovy:script>

View File

@@ -38,7 +38,6 @@ import org.springframework.integration.Message;
import org.springframework.integration.MessageChannel;
import org.springframework.integration.MessageHandlingException;
import org.springframework.integration.channel.QueueChannel;
import org.springframework.integration.handler.ReplyRequiredException;
import org.springframework.integration.message.ErrorMessage;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.scripting.ScriptVariableGenerator;
@@ -141,7 +140,7 @@ public class GroovyServiceActivatorTests {
//INT-2399
@Test(expected = MessageHandlingException.class)
public void invalidInlineScript() throws Exception {
Message message = new ErrorMessage(new ReplyRequiredException(new GenericMessage<String>("test"), "reply required!"));
Message message = new ErrorMessage(new MessageHandlingException(new GenericMessage<String>("test"), "reply required!"));
try {
this.invalidInlineScript.send(message);
fail("MessageHandlingException expected!");
@@ -149,7 +148,7 @@ public class GroovyServiceActivatorTests {
catch (Exception e) {
Throwable cause = e.getCause();
assertEquals(MissingPropertyException.class, cause.getClass());
assertThat(cause.getMessage(), Matchers.containsString("No such property: ReplyRequiredException for class: groovy.lang"));
assertThat(cause.getMessage(), Matchers.containsString("No such property: MessageHandlingException for class: groovy.lang"));
throw e;
}