-
Notifications
You must be signed in to change notification settings - Fork 45
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
Bug/unit tests #460
Bug/unit tests #460
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
Adding missing authentication protocols from updated SNMP library to address bug.
I've added a bug fix for #458 into this PR as well as it is a small fix. The additional code is under OdeSvcsApplication.java, line 52-53 and simply registers missing security protocols from the previously updated SNMP library. Note that this fix was tested locally and in WYDOT with success. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing the SNMP issue as well!
// convert java object to JSON format, | ||
// and returned as JSON formatted string | ||
return verbose ? gsonVerbose.toJson(o) : gsonCompact.toJson(o); | ||
try { | ||
return verbose ? mapper.writeValueAsString(o) : mapper_noNulls.writeValueAsString(o); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we need this update. It does the same thing as the existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This swaps over to using the Jackson library. There was an odd mixture using both the Gson and Jackson libraries, and they did not always mix. When I got the unit tests to run, large numbers of them were failing and many were due to this mismatch of serializations. You are correct that the new code performs the same as previous in this instance and that was intentional - this update ensures compatibility and chooses a single serializer (Jackson) over the current duality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
assertEquals( | ||
"<OdeAsn1Data><metadata><payloadType>us.dot.its.jpo.ode.model.OdeAsdPayload</payloadType><serialId><streamId>6c33f802-418d-4b67-89d1-326b4fc8b1e3</streamId><bundleSize>1</bundleSize><bundleId>0</bundleId><recordId>0</recordId><serialNumber>0</serialNumber></serialId><odeReceivedAt>timeTime</odeReceivedAt><schemaVersion>6</schemaVersion><maxDurationTime>0</maxDurationTime><sanitized>false</sanitized><request><sdw><deliverystart>2017-06-01T17:47:11-05:00</deliverystart><deliverystop>2018-03-01T17:47:11-05:15</deliverystop></sdw><rsus/></request><encodings><encodings><elementName>MessageFrame</elementName><elementType>MessageFrame</elementType><encodingRule>UPER</encodingRule></encodings><encodings><elementName>Ieee1609Dot2Data</elementName><elementType>Ieee1609Dot2Data</elementType><encodingRule>COER</encodingRule></encodings><encodings><elementName>AdvisorySituationData</elementName><elementType>AdvisorySituationData</elementType><encodingRule>UPER</encodingRule></encodings></encodings></metadata><payload><dataType>us.dot.its.jpo.ode.plugin.j2735.DdsAdvisorySituationData</dataType><data><AdvisorySituationData><dialogID>156</dialogID><seqID>5</seqID><groupID>00000000</groupID><requestID>7876BA7F</requestID><recordID>00000000</recordID><timeToLive>1</timeToLive><serviceRegion/><asdmDetails><asdmID>7876BA7F</asdmID><asdmType>2</asdmType><distType>03</distType><startTime><year>0</year><month>0</month><day>0</day><hour>0</hour><minute>0</minute></startTime><stopTime><year>0</year><month>0</month><day>0</day><hour>0</hour><minute>0</minute></stopTime><advisoryMessage><Ieee1609Dot2Data><protocolVersion>3</protocolVersion><content><unsecuredData><MessageFrame><messageId>31</messageId><value><TravelerInformation/></value></MessageFrame></unsecuredData></content></Ieee1609Dot2Data></advisoryMessage></asdmDetails></AdvisorySituationData></data></payload></OdeAsn1Data>", | ||
actualXML); | ||
String expected = "<OdeAsn1Data><metadata><payloadType>us.dot.its.jpo.ode.model.OdeAsdPayload</payloadType><serialId><streamId>6c33f802-418d-4b67-89d1-326b4fc8b1e3</streamId><bundleSize>1</bundleSize><bundleId>0</bundleId><recordId>0</recordId><serialNumber>0</serialNumber></serialId><odeReceivedAt>timeTime</odeReceivedAt><schemaVersion>6</schemaVersion><maxDurationTime>0</maxDurationTime><sanitized>false</sanitized><request><sdw><ttl>thirtyminutes</ttl><deliverystart>2017-06-01T17:47:11-05:00</deliverystart><deliverystop>2018-03-01T17:47:11-05:15</deliverystop></sdw><rsus/></request><encodings><encodings><elementName>MessageFrame</elementName><elementType>MessageFrame</elementType><encodingRule>UPER</encodingRule></encodings><encodings><elementName>Ieee1609Dot2Data</elementName><elementType>Ieee1609Dot2Data</elementType><encodingRule>COER</encodingRule></encodings><encodings><elementName>AdvisorySituationData</elementName><elementType>AdvisorySituationData</elementType><encodingRule>UPER</encodingRule></encodings></encodings></metadata><payload><dataType>us.dot.its.jpo.ode.plugin.j2735.DdsAdvisorySituationData</dataType><data><AdvisorySituationData><dialogID>156</dialogID><seqID>5</seqID><groupID>00000000</groupID><requestID>7876BA7F</requestID><recordID>00000000</recordID><timeToLive>1</timeToLive><serviceRegion/><asdmDetails><asdmID>7876BA7F</asdmID><asdmType>2</asdmType><distType>03</distType><startTime><year>0</year><month>0</month><day>0</day><hour>0</hour><minute>0</minute></startTime><stopTime><year>0</year><month>0</month><day>0</day><hour>0</hour><minute>0</minute></stopTime><advisoryMessage><Ieee1609Dot2Data><protocolVersion>3</protocolVersion><content><unsecuredData><MessageFrame><messageId>31</messageId><value><TravelerInformation/></value></MessageFrame></unsecuredData></content></Ieee1609Dot2Data></advisoryMessage></asdmDetails></AdvisorySituationData></data></payload></OdeAsn1Data>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this additional <ttl>thirtyminutes</ttl>
from metadata from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Details
Description
This PR addresses failing and non-included unit tests. When running Maven commands ('mvn test' for instance), the existing code base runs successfully. However, due to configuration a large number of unit tests were being exempt. This PR updates that configuration to pull in all unit tests, and fixes issues found within those unit tests causing failures.
Related Issue
#459
Motivation and Context
This change is required to successfully run all unit tests.
How Has This Been Tested?
Tested locally on multiple development environments. Also ran in remote development environment as defined by code base.
Types of changes
Checklist:
ODE Contributing Guide