X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-backend%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fric%2Fportal%2Fdashboard%2Fcontroller%2FPortalRestCentralServiceTest.java;h=e1c48ea04959853d0529798f497f13cbde6c53ab;hb=44203c43bb16a87eb54cc97431a026e111842c97;hp=bb3102825edb9613826dd2a4324b687903e835ef;hpb=642622502dc1222af8570a3de2b0223fa5474500;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/PortalRestCentralServiceTest.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/PortalRestCentralServiceTest.java index bb310282..e1c48ea0 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/PortalRestCentralServiceTest.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/controller/PortalRestCentralServiceTest.java @@ -2,7 +2,7 @@ * ========================LICENSE_START================================= * O-RAN-SC * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * Copyright (C) 2019 AT&T Intellectual Property * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.onap.portalsdk.core.onboarding.util.PortalApiConstants; import org.onap.portalsdk.core.restful.domain.EcompUser; -import org.oransc.ric.portal.dashboard.DashboardConstants; import org.oransc.ric.portal.dashboard.config.PortalApIMockConfiguration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,8 +38,6 @@ public class PortalRestCentralServiceTest extends AbstractControllerTest { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - // paths are hardcoded here exactly like the EPSDK-FW library :( - @Test public void getAnalyticsTest() { // paths are hardcoded here exactly like the EPSDK-FW library :( @@ -52,12 +49,13 @@ public class PortalRestCentralServiceTest extends AbstractControllerTest { } @Test - public void getLoginPageTest() { - URI uri = buildUri(null, DashboardConstants.LOGIN_PAGE); + public void getErrorPageTest() { + // Send unauthorized request + URI uri = buildUri(null, "/favicon.ico"); logger.info("Invoking {}", uri); ResponseEntity response = restTemplate.exchange(uri, HttpMethod.GET, null, String.class); - Assertions.assertTrue(response.getStatusCode().is2xxSuccessful()); - Assertions.assertTrue(response.getBody().contains("Please log in")); + Assertions.assertTrue(response.getStatusCode().is4xxClientError()); + Assertions.assertTrue(response.getBody().contains("Static error page")); } private HttpEntity getEntityWithHeaders(Object body) {