From 228faa3881764957300b9cb163826b80b4b1b8be Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Wed, 15 Nov 2023 09:47:53 -0800 Subject: [PATCH] improve test coverage - based on Sonar scan suggestion [#184752215] --- .../ZoneAwareWhitelistLogoutHandlerTests.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/test/java/org/cloudfoundry/identity/uaa/authentication/ZoneAwareWhitelistLogoutHandlerTests.java b/server/src/test/java/org/cloudfoundry/identity/uaa/authentication/ZoneAwareWhitelistLogoutHandlerTests.java index 62ea712e817..0817f932cea 100644 --- a/server/src/test/java/org/cloudfoundry/identity/uaa/authentication/ZoneAwareWhitelistLogoutHandlerTests.java +++ b/server/src/test/java/org/cloudfoundry/identity/uaa/authentication/ZoneAwareWhitelistLogoutHandlerTests.java @@ -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);