-
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
FLK-1037 - Changes made for Lab Exercises 3 and 4 #2
base: release-1.15
Are you sure you want to change the base?
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.
Pls see my comments
@@ -41,6 +43,9 @@ public class LongRidesUnitTest extends LongRidesTestBase { | |||
|
|||
private KeyedOneInputStreamOperatorTestHarness<Long, TaxiRide, Long> harness; | |||
|
|||
@Rule | |||
public ExpectedException exceptionRule = ExpectedException.none(); |
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.
- What is it? Purpose.
- Why it's public?
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 is to check if the expected exception is thrown with a expected message. It doesn't need to be public. should be private
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.
Rewritten the Junit to handle exception using Junit-5
@@ -110,6 +115,16 @@ public void shouldAlertWithStartFirst() throws Exception { | |||
assertThat(resultingRideId()).isEqualTo(rideStarted.rideId); | |||
} | |||
|
|||
@Test | |||
public void shouldThrowExceptionWhenIsStartFalse() throws Exception { | |||
exceptionRule.expect(LongRidesException.class); |
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.
Sorry, what we are checking here?
As I see you introduced variable
@Rule
public ExpectedException exceptionRule = ExpectedException.none();
a now just do this, what is the reason of it?
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.
checking if the method is throwing an exception when startTime is not available in the end event
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 proper methods for it
https://github.com/junit-team/junit5/blob/main/junit-jupiter-api/src/main/java/org/junit/jupiter/api/AssertThrows.java#L41
thanks
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.
Rewritten the Junit to handle exception using Junit-5
No description provided.