-
Notifications
You must be signed in to change notification settings - Fork 0
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
SD-589 Handle exception and add unit test cases #238
Conversation
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
Looking good to me. One minor remark written down. I also changed the grammar of the title to active voice. Commit messages are never in the past tense.
@Test | ||
void testFromString_caseInsensitiveInput() { | ||
assertThrowsExactly(IllegalArgumentException.class, () -> BookingState.fromString("start")); | ||
assertThrowsExactly(IllegalArgumentException.class, () -> BookingState.fromString("received")); |
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.
Please use assertThrows
if that also fixes the job.
In BookingCancellationStateTest.java
you did that as well, which is 👍🏻
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.
Looks good to me.
PR Type
enhancement, tests
Description
fromString
methods inBookingState
andBookingCancellationState
for safer parsing of state strings, replacing the use ofvalueOf
.IllegalArgumentException
for unknown states.fromString
methods to ensure correct functionality and error handling.Changes walkthrough 📝
BookingChecks.java
Use safer state parsing methods in BookingChecks
booking/src/main/java/org/dcsa/conformance/standards/booking/checks/BookingChecks.java
BookingState.valueOf
withBookingState.fromString
for saferstate parsing.
BookingCancellationState.valueOf
withBookingCancellationState.fromString
.PersistableCarrierBooking.java
Enhance state parsing in PersistableCarrierBooking
booking/src/main/java/org/dcsa/conformance/standards/booking/model/PersistableCarrierBooking.java
valueOf
withfromString
for parsing booking states.BookingCancellationState.java
Add fromString method to BookingCancellationState
booking/src/main/java/org/dcsa/conformance/standards/booking/party/BookingCancellationState.java
fromString
method for safer parsing of cancellation states.BookingState.java
Add fromString method to BookingState
booking/src/main/java/org/dcsa/conformance/standards/booking/party/BookingState.java
fromString
method for safer parsing of booking states.BookingCancellationStateTest.java
Add tests for BookingCancellationState fromString method
booking/src/test/java/org/dcsa/conformance/standards/booking/party/BookingCancellationStateTest.java
BookingCancellationState.fromString
.BookingStateTest.java
Add tests for BookingState fromString method
booking/src/test/java/org/dcsa/conformance/standards/booking/party/BookingStateTest.java
BookingState.fromString
.