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%2Fconfig%2FWebSecurityMockConfiguration.java;h=80cde661b32da875a617f61e12f30bbff18afcda;hb=9cf5b95a5bc9810d739d14d324dd7d80cbdb4a7d;hp=de2ee55d83364b57bac67ba66a1132619b0ee0fa;hpb=9fef9615bd5889eacbe8ddad454b7ff4b4c195c0;p=portal%2Fric-dashboard.git diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/WebSecurityMockConfiguration.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/WebSecurityMockConfiguration.java index de2ee55d..80cde661 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/WebSecurityMockConfiguration.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/WebSecurityMockConfiguration.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. @@ -19,20 +19,12 @@ */ package org.oransc.ric.portal.dashboard.config; -import java.io.IOException; import java.lang.invoke.MethodHandles; -import java.util.HashSet; -import java.util.Set; -import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; -import org.onap.portalsdk.core.restful.domain.EcompRole; -import org.onap.portalsdk.core.restful.domain.EcompUser; import org.oransc.ric.portal.dashboard.DashboardConstants; -import org.oransc.ric.portal.dashboard.portalapi.DashboardUserManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; @@ -89,23 +81,4 @@ public class WebSecurityMockConfiguration extends WebSecurityConfigurerAdapter { web.ignoring().antMatchers("/", "/csrf"); // allow swagger-ui to load } - // This implementation is so light it can be used during tests. - @Bean - public DashboardUserManager dashboardUserManager() throws IOException, PortalAPIException { - DashboardUserManager dum = new DashboardUserManager(true); - // Mock user for convenience in testing - EcompUser demo = new EcompUser(); - demo.setLoginId("demo"); - demo.setFirstName("Demo"); - demo.setLastName("User"); - demo.setActive(true); - EcompRole role = new EcompRole(); - role.setName("view"); - Set roles = new HashSet<>(); - roles.add(role); - demo.setRoles(roles); - dum.createUser(demo); - return dum; - } - }