modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
public T payload(final Object payload, final String mapperName) {
        validateApplicationContext();

        if (applicationContext.containsBean(mapperName)) {
            final Object mapper = applicationContext.getBean(mapperName);

            if (Marshaller.class.isAssignableFrom(mapper.getClass())) {
                return payload(payload, (Marshaller) mapper);
            } else if (ObjectMapper.class.isAssignableFrom(mapper.getClass())) {
                return payload(payload, (ObjectMapper) mapper);
            } else {
                throw new CitrusRuntimeException(String.format("Invalid bean type for mapper '%s' expected ObjectMapper or Marshaller but was '%s'", mapperName, mapper.getClass()));
            }
        }

        throw createUnableToFindMapperException();
    }
/**
     * Expect this message payload as model object which is marshalled to a character sequence using the given object to xml mapper that
     * is accessed by its bean name in Spring bean application context.
     *
     * @param payload
     * @param mapperName
     * @return
     */
Expect this message payload as model object which is marshalled to a character sequence using the given object to xml mapper that
is accessed by its bean name in Spring bean application context.

@param payload
@param mapperName
@return
Expect this message payload as model object which is marshalled to a character sequence using the given object to xml mapper that is accessed by its bean name in Spring bean application context . @param payload @param mapperName @return
public T payload(final Object payload, final String mapperName) {
        validateApplicationContext();
        if (applicationContext.containsBean(mapperName)) {
            final Object mapper = applicationContext.getBean(mapperName);
            if (Marshaller.class.isAssignableFrom(mapper.getClass())) {
                return payload(payload, (Marshaller) mapper);
            } else if (ObjectMapper.class.isAssignableFrom(mapper.getClass())) {
                return payload(payload, (ObjectMapper) mapper);
            } else {
                throw new CitrusRuntimeException(String.format("Invalid bean type for mapper '%s' expected ObjectMapper or Marshaller but was '%s'", mapperName, mapper.getClass()));
            }
        }
        throw createUnableToFindMapperException();
    }
public T payload ( final Object payload , final String mapperName ) { validateApplicationContext ( ) ; if ( applicationContext . containsBean ( mapperName ) ) { final Object mapper = applicationContext . getBean ( mapperName ) ; if ( Marshaller . class . isAssignableFrom ( mapper . getClass ( ) ) ) { return payload ( payload , ( Marshaller ) mapper ) ; } else if ( ObjectMapper . class . isAssignableFrom ( mapper . getClass ( ) ) ) { return payload ( payload , ( ObjectMapper ) mapper ) ; } else { throw new CitrusRuntimeException ( String . format ( "Invalid bean type for mapper '%s' expected ObjectMapper or Marshaller but was '%s'" , mapperName , mapper . getClass ( ) ) ) ; } } throw createUnableToFindMapperException ( ) ; }
Expect this message payload as model object which is marshalled to a character sequence using the given object to xml mapper that
 is accessed by its bean name in Spring bean application context.
Expect this message payload as model object which is marshalled to a character sequence using the given object to xml mapper that is accessed by its bean name in Spring bean application context .