Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
- based on Sonar scan suggestion

[#184752215]
  • Loading branch information
peterhaochen47 committed Nov 15, 2023
1 parent b12fbd8 commit 228faa3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ public void test_does_not_external_logout() throws ServletException, IOException
verify(oAuthLogoutHandler, times(0)).onLogoutSuccess(request, response, null);
}

@Test
public void test_does_not_external_logout_when_logout_url_is_null() throws ServletException, IOException {
when(oAuthLogoutHandler.getLogoutUrl(null)).thenReturn(null);
when(oAuthLogoutHandler.getPerformRpInitiatedLogout(null)).thenReturn(true);
handler.onLogoutSuccess(request, response, null);
verify(oAuthLogoutHandler, times(0)).onLogoutSuccess(request, response, null);
}

@Test
public void test_logout() throws ServletException, IOException {
handler.onLogoutSuccess(request, response, null);
Expand Down

0 comments on commit 228faa3

Please sign in to comment.