Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed behaviour between spring-ws-test 3.0.10.RELEASE and 3.1.1 #1204

Closed
sanderino666 opened this issue Jul 12, 2021 · 3 comments
Closed

Comments

@sanderino666
Copy link

sanderino666 commented Jul 12, 2021

All my tests are green using spring-ws-test 3.0.10.RELEASE but when bumping to 3.1.1 I get the following types of failures:

Wrong number of childnodes

[ERROR]   EmploymentMutationServiceClientTest.sendAnnualSalary:153 Messages are different, org.custommonkey.xmlunit.Diff
[different] Expected number of child nodes '7' but was '3' - comparing <ns7:VerstuurPortalSalarisopgaveRequest...> at /VerstuurPortalSalarisopgaveRequest[1] to <ns7:VerstuurPortalSalarisopgaveRequest...> at /VerstuurPortalSalarisopgaveRequest[1]

Payload: <ns7:VerstuurPortalSalarisopgaveRequest xmlns:ns7="http://xxxx.com/inkomen/services/ArbeidsverhoudingMutatieService/messages" xmlns:ns2="http://xxxx.com/relatie/cdm/types" xmlns:ns3="http://xxxx.com/relatie/cdm/objecten" xmlns:ns4="http://xxxx.com/inkomen/cdm/types" xmlns:ns5="http://xxxx.com/inkomen/cdm/objecten" xm
lns:ns6="http://xxxx.com/generiek/services"><ns6:ServiceContext><ns6:bronSysteem>IZP</ns6:bronSysteem><ns6:administratie>PME</ns6:administratie><ns6:afzender>012321</ns6:afzender><ns6:debugMode>false</ns6:debugMode></ns6:ServiceContext><ns3:Persoon><ns3:Identificatie><ns2:persoonsnummer>123456</ns2:persoonsnummer>
</ns3:Identificatie><ns3:opgemaakteNaam>dhr. M. Testmans</ns3:opgemaakteNaam><ns3:geboortedatum><ns2:jaar>1963</ns2:jaar><ns2:maand>2</ns2:maand><ns2:dag>7</ns2:dag></ns3:geboortedatum><ns3:Adressen/><ns3:Partnerschappen/></ns3:Persoon><ns5:Arbeidsverhouding><ns5:Identificatie><ns4:WerkgeversIdentificatie><ns2:
werkgevernummer>012321</ns2:werkgevernummer></ns4:WerkgeversIdentificatie><ns4:WerknemersIdentificatie><ns2:persoonsnummer>123456</ns2:persoonsnummer></ns4:WerknemersIdentificatie></ns5:Identificatie><ns5:AardPeriodes/><ns5:BeroepPeriodes><ns5:BeroepPeriode><ns4:code>1111</ns4:code></ns5:BeroepPeriode></ns5:Ber
oepPeriodes><ns5:LoonPeriodes><ns5:LoonPeriode><ns4:codeLooncomponent>SALI</ns4:codeLooncomponent><ns4:codeFrequentie>J</ns4:codeFrequentie><ns4:bedrag>77222.00</ns4:bedrag><ns4:codeValuta>EUR</ns4:codeValuta></ns5:LoonPeriode><ns5:LoonPeriode><ns4:codeLooncomponent>SVLN</ns4:codeLooncomponent><ns4:codeFrequent
ie>J</ns4:codeFrequentie><ns4:bedrag>1234.00</ns4:bedrag><ns4:codeValuta>EUR</ns4:codeValuta></ns5:LoonPeriode><ns5:LoonPeriode><ns4:codeLooncomponent>VARI</ns4:codeLooncomponent><ns4:codeFrequentie>J</ns4:codeFrequentie><ns4:bedrag>234.00</ns4:bedrag><ns4:codeValuta>EUR</ns4:codeValuta></ns5:LoonPeriode><ns5:L
oonPeriode><ns4:codeLooncomponent>INCDTL</ns4:codeLooncomponent><ns4:codeFrequentie>J</ns4:codeFrequentie><ns4:bedrag>567.00</ns4:bedrag><ns4:codeValuta>EUR</ns4:codeValuta></ns5:LoonPeriode></ns5:LoonPeriodes><ns5:UrenPeriodes><ns5:UrenPeriode><ns4:codeSoortUren/><ns4:datumBegin>2019-01-01</ns4:datumBegin><ns4
:parttimePercentage>87.0</ns4:parttimePercentage></ns5:UrenPeriode></ns5:UrenPeriodes></ns5:Arbeidsverhouding></ns7:VerstuurPortalSalarisopgaveRequest>
[ERROR]   EmploymentMutationServiceClientTest.sendAnnualSalaryWithInfix:180 Messages are different, org.custommonkey.xmlunit.Diff
[different] Expected number of child nodes '7' but was '3' - comparing <ns7:VerstuurPortalSalarisopgaveRequest...> at /VerstuurPortalSalarisopgaveRequest[1] to <ns7:VerstuurPortalSalarisopgaveRequest...> at /VerstuurPortalSalarisopgaveRequest[1]

Wrong namespace

[ERROR] EmployeeDetailsServiceClientTest.getGenerationPactsForEmployeeTest  Time elapsed: 0.134 s  <<< FAILURE!
org.springframework.ws.test.support.SourceAssertionError:
Messages are different, org.custommonkey.xmlunit.Diff
[not identical] Expected namespace prefix 'mes' but was 'ns3' - comparing <mes:HaalGeneratiePactRequest...> at /HaalGeneratiePactRequest[1] to <ns3:HaalGeneratiePactRequest...> at /HaalGeneratiePactRequest[1]

It might be related to #1203 ?

@ondrejlerch
Copy link

I am experiencing the same issue in my ws tests. Workaround is to call XMLUnit.setIgnoreWhitespace(true) in appropriate ws tests. However, I suggest to put back static { XMLUnit.setIgnoreWhitespace(true); } to DiffMatcher so that projects can easily upgrade spring-ws without broken build investigation as in my case. Moreover, static { XMLUnit.setIgnoreWhitespace(true); } is still called from SoapEnvelopeDiffMatcher anyway.

@gregturn
Copy link
Contributor

This could be a duplicate of #1193, which has since been fixed on 3.1.x and available with 3.1.5 release. See if that resolves your problem.

@gregturn
Copy link
Contributor

Based upon positive feedback from c39d3d1, I'm closing this ticket as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants