X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dashboard%2Fwebapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fportalapi%2FPortalAuthManagerTest.java;fp=dashboard%2Fwebapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fportalapi%2FPortalAuthManagerTest.java;h=028921b40bf83d80f853cdb6f2a47d9ec987b81f;hb=329b53efb578dd41a6de31eafd5f228f3f10987c;hp=a2747e8799b3da53e9930829f6680fb69f709e92;hpb=c204fe007d1569ad0ad9fbdb1041571ccf32696e;p=portal%2Fric-dashboard.git diff --git a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthManagerTest.java b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthManagerTest.java index a2747e87..028921b4 100644 --- a/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthManagerTest.java +++ b/dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/portalapi/PortalAuthManagerTest.java @@ -27,6 +27,7 @@ import javax.servlet.ServletException; import javax.servlet.http.Cookie; import org.junit.Assert; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; @@ -71,22 +72,16 @@ public class PortalAuthManagerTest { Assert.assertNull(s); DashboardUserManager dum = new DashboardUserManager(true); - PortalAuthenticationFilter filter = new PortalAuthenticationFilter(false, m, dum); + final PortalAuthenticationFilter filter = new PortalAuthenticationFilter(false, m, dum); filter.init(null); filter.destroy(); MockHttpServletResponse response = new MockHttpServletResponse(); - try { + Assertions.assertThrows(NullPointerException.class, () -> { filter.doFilter(request, response, null); - } catch (NullPointerException ex) { - logger.debug("chain is null"); - } + }); - filter = new PortalAuthenticationFilter(true, m, dum); - try { - filter.doFilter(request, response, null); - } catch (NullPointerException ex) { - logger.debug("chain is null"); - } + PortalAuthenticationFilter filter2 = new PortalAuthenticationFilter(true, m, dum); + filter2.doFilter(request, response, null); } } \ No newline at end of file