Skip to content

Commit

Permalink
make the failure message of the unit test for issue 2218 more detailed
Browse files Browse the repository at this point in the history
  • Loading branch information
mizhoux committed Aug 16, 2018
1 parent c7ab201 commit a250bef
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public void testInvokeByPassingNullValue() throws RemotingException {
// pass null value to parameter of primitive type
try {
invoke.telnet(mockChannel, "DemoService.add(null, 2)");
fail("It should cause a NullPointerException here.");
fail("It should cause a NullPointerException by the above code.");
} catch (NullPointerException ex) {
String message = ex.getMessage();
assertEquals("The type of No.1 parameter is primitive(int), but the value passed is null.", message);
}

try {
invoke.telnet(mockChannel, "DemoService.add(1, null)");
fail("It should cause a NullPointerException here.");
fail("It should cause a NullPointerException by above code.");
} catch (NullPointerException ex) {
String message = ex.getMessage();
assertEquals("The type of No.2 parameter is primitive(long), but the value passed is null.", message);
Expand All @@ -104,7 +104,7 @@ public void testInvokeByPassingNullValue() throws RemotingException {
try {
invoke.telnet(mockChannel, "DemoService.sayHello(null)");
} catch (NullPointerException ex) {
fail("It shouldn't cause a NullPointerException here.");
fail("It shouldn't cause a NullPointerException by the above code.");
}
}

Expand Down

0 comments on commit a250bef

Please sign in to comment.