Example usage for org.springframework.integration.handler LoggingHandler setShouldLogFullMessage

List of usage examples for org.springframework.integration.handler LoggingHandler setShouldLogFullMessage

Introduction

In this page you can find the example usage for org.springframework.integration.handler LoggingHandler setShouldLogFullMessage.

Prototype

public void setShouldLogFullMessage(boolean shouldLogFullMessage) 

Source Link

Document

Specify whether to log the full Message.

Usage

From source file:org.springframework.integration.handler.LoggingHandlerTests.java

@Test
public void assertMutuallyExclusive() {
    LoggingHandler loggingHandler = new LoggingHandler("INFO");
    loggingHandler.setExpression("'foo'");
    try {// w ww  . j a v  a 2 s  . co  m
        loggingHandler.setShouldLogFullMessage(true);
        fail("Expected IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        assertEquals("Cannot set both 'expression' AND 'shouldLogFullMessage' properties", e.getMessage());
    }

    loggingHandler = new LoggingHandler("INFO");
    loggingHandler.setShouldLogFullMessage(true);
    try {
        loggingHandler.setExpression("'foo'");
        fail("Expected IllegalArgumentException");
    } catch (IllegalArgumentException e) {
        assertEquals("Cannot set both 'expression' AND 'shouldLogFullMessage' properties", e.getMessage());
    }
}