Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

HAPI v2 testing parser.getParserConfiguration().addForcedEncode with groovy not showing subfield delimiters in groovy test

I'm using addForcedEncode to force a set on PV1-3-4 as the receiving system wants to see "^"'s where there are blank subfields for PV1-3.2, PV1-3.3, PV1-3.4.

I'm trying to test this in groovy but cant get the output to show the "^"'s.

to set the PV1-3-4 in any case: parser.getParserConfiguration().addForcedEncode("PV1-3-4");

to test it in groovy:

    def "Test of rulePV1_3 "() {
        when:
        _output.getPV1().parse(value)

        _instance.rulePV1_3(_output)

        then:
        _output.getPV1().encode() == expected

        where:
        value            || expected
        "PV1|1|N||test|" || "PV1|1|N|^^^^|test"
    }

When i run the test the ^^^^ never show, they're always stripped out. Is this something the encode is doing? I'm running a file to file test and it shows the "^"'s its only the groovy test/encode portion that does not show them.

question from:https://stackoverflow.com/questions/65894178/hapi-v2-testing-parser-getparserconfiguration-addforcedencode-with-groovy-not

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...