具有Kafka标头的CitrusFramework-意外行为

时间:2018-11-01 12:06:06

标签: citrus-framework

我正在使用带有gradle,spring boot和kafka的Citrus框架。我收到以下异常。请注意,唯一的区别是实际字符串(第二个字符串)周围有双引号。

Validation failed: Values not equal for header element 'X-CorrelationID', expected 'TESTcorrelationidTEST' but was '"TESTcorrelationidTEST"'
com.consol.citrus.exceptions.TestCaseFailedException: Validation failed: Values not equal for header element 'X-CorrelationID', expected 'TESTcorrelationidTEST' but was '"TESTcorrelationidTEST"'

柑橘版本紧随其后

testCompile ('com.consol.citrus:citrus-core:2.8.0-SNAPSHOT')
testCompile ('com.consol.citrus:citrus-java-dsl:2.8.0-SNAPSHOT')
testCompile ('com.consol.citrus:citrus-kafka:2.8.0-SNAPSHOT')
testCompile ('com.consol.citrus:citrus-cucumber:2.8.0-SNAPSHOT')

这是代码。据我所知,我没有做任何事情来生成一个字符串,该字符串在异常中指定了双引号。有没有人看到过类似的行为或有任何想法?

@SpringBootTest
@ContextConfiguration(classes = {EndpointConfig.class,  SampleAppApplication.class})
public class SampleListenerIT extends JUnit4CitrusTestDesigner {

    @Autowired
    @Qualifier("appInput")
    private KafkaEndpoint appInput;

    @Autowired
    @Qualifier("appOutput")
    private KafkaEndpoint appOutput;

    @Test
    @CitrusTest
    public void test() throws Exception {

        send(appInput)
            .header("X-CorrelationID", "TESTcorrelationidTEST")
            .payload(new ClassPathResource("test.xml"));

        receive(appOutput)
            .header("X-CorrelationID", "TESTcorrelationidTEST")
            .payload(new ClassPathResource("test.json"));


    }

}

0 个答案:

没有答案