@Test public void testPublishers() { MediatorConfigurationSupport support = create("publisherPublisherOfMessage"); MediatorConfigurationSupport.ValidationOutput output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherMultiOfMessage"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherPublisherOfPayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherMultiOfPayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherPublisherBuilderOfMessage"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isTrue(); support = create("publisherPublisherBuilderOfPayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.STREAM_OF_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isTrue(); support = create("publisherGeneratePayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.INDIVIDUAL_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherGenerateMessage"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.INDIVIDUAL_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherGenerateCompletionStagePayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.COMPLETION_STAGE_OF_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherGenerateCompletionStageMessage"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.COMPLETION_STAGE_OF_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherGenerateUniPayload"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.UNI_OF_PAYLOAD); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); support = create("publisherGenerateUniMessage"); output = support.validate(Shape.PUBLISHER, null); assertThat(output.getConsumption()).isEqualTo(MediatorConfiguration.Consumption.NONE); assertThat(output.getProduction()).isEqualTo(MediatorConfiguration.Production.UNI_OF_MESSAGE); assertThat(output.getIngestedPayloadType()).isNull(); assertThat(output.getUseBuilderTypes()).isFalse(); }
public ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment) { switch (shape) { case SUBSCRIBER: return validateSubscriber(); case PUBLISHER: return validatePublisher(); case PROCESSOR: return validateProcessor(acknowledgment); case STREAM_TRANSFORMER: return validateStreamTransformer(acknowledgment); default: throw ex.illegalStateExceptionForValidate(shape); } }
MediatorConfigurationSupport { public ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment) { switch (shape) { case SUBSCRIBER: return validateSubscriber(); case PUBLISHER: return validatePublisher(); case PROCESSOR: return validateProcessor(acknowledgment); case STREAM_TRANSFORMER: return validateStreamTransformer(acknowledgment); default: throw ex.illegalStateExceptionForValidate(shape); } } }
MediatorConfigurationSupport { public ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment) { switch (shape) { case SUBSCRIBER: return validateSubscriber(); case PUBLISHER: return validatePublisher(); case PROCESSOR: return validateProcessor(acknowledgment); case STREAM_TRANSFORMER: return validateStreamTransformer(acknowledgment); default: throw ex.illegalStateExceptionForValidate(shape); } } MediatorConfigurationSupport(String methodAsString, Class<?> returnType, Class<?>[] parameterTypes,
            GenericTypeAssignable returnTypeAssignable, GenericTypeAssignable firstMethodParamTypeAssignable); }
MediatorConfigurationSupport { public ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment) { switch (shape) { case SUBSCRIBER: return validateSubscriber(); case PUBLISHER: return validatePublisher(); case PROCESSOR: return validateProcessor(acknowledgment); case STREAM_TRANSFORMER: return validateStreamTransformer(acknowledgment); default: throw ex.illegalStateExceptionForValidate(shape); } } MediatorConfigurationSupport(String methodAsString, Class<?> returnType, Class<?>[] parameterTypes,
            GenericTypeAssignable returnTypeAssignable, GenericTypeAssignable firstMethodParamTypeAssignable); Shape determineShape(List<?> incomingValue, Object outgoingValue); Acknowledgment.Strategy processSuppliedAcknowledgement(List<?> incomings,
            Supplier<Acknowledgment.Strategy> supplier); ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment); Acknowledgment.Strategy processDefaultAcknowledgement(Shape shape,
            MediatorConfiguration.Consumption consumption, MediatorConfiguration.Production production); Merge.Mode processMerge(List<?> incomings, Supplier<Merge.Mode> supplier); Integer processBroadcast(Object outgoing, Supplier<Integer> supplier); void validateBlocking(ValidationOutput validationOutput); }
MediatorConfigurationSupport { public ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment) { switch (shape) { case SUBSCRIBER: return validateSubscriber(); case PUBLISHER: return validatePublisher(); case PROCESSOR: return validateProcessor(acknowledgment); case STREAM_TRANSFORMER: return validateStreamTransformer(acknowledgment); default: throw ex.illegalStateExceptionForValidate(shape); } } MediatorConfigurationSupport(String methodAsString, Class<?> returnType, Class<?>[] parameterTypes,
            GenericTypeAssignable returnTypeAssignable, GenericTypeAssignable firstMethodParamTypeAssignable); Shape determineShape(List<?> incomingValue, Object outgoingValue); Acknowledgment.Strategy processSuppliedAcknowledgement(List<?> incomings,
            Supplier<Acknowledgment.Strategy> supplier); ValidationOutput validate(Shape shape, Acknowledgment.Strategy acknowledgment); Acknowledgment.Strategy processDefaultAcknowledgement(Shape shape,
            MediatorConfiguration.Consumption consumption, MediatorConfiguration.Production production); Merge.Mode processMerge(List<?> incomings, Supplier<Merge.Mode> supplier); Integer processBroadcast(Object outgoing, Supplier<Integer> supplier); void validateBlocking(ValidationOutput validationOutput);  }