2 * Copyright 2022 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
15 package org.onap.usecaseui.intentanalysis.test;
17 import java.io.IOException;
18 import javax.servlet.FilterChain;
19 import javax.servlet.ServletException;
20 import javax.servlet.http.HttpServletRequest;
21 import javax.servlet.http.HttpServletResponse;
22 import org.mybatis.spring.annotation.MapperScan;
23 import org.onap.usecaseui.intentanalysis.util.SpringContextUtil;
24 import org.springframework.boot.SpringApplication;
25 import org.springframework.boot.autoconfigure.SpringBootApplication;
26 import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
27 import org.springframework.context.ApplicationContext;
28 import org.springframework.context.annotation.Bean;
29 import org.springframework.scheduling.annotation.EnableScheduling;
30 import org.springframework.web.filter.OncePerRequestFilter;
32 @SpringBootApplication(exclude = {SecurityAutoConfiguration.class}, scanBasePackages = "org.onap.usecaseui.intentanalysis")
33 @MapperScan(basePackages = {"org.onap.usecaseui.intentanalysis.mapper"})
36 public class IntentAnalysisApplicationTests {
38 public static void main(String[] args) throws Exception {
39 ApplicationContext applicationContext = SpringApplication.run(IntentAnalysisApplicationTests.class, args);
40 SpringContextUtil.setApplicationContext(applicationContext);
44 public OncePerRequestFilter accessTokenFilter() {
45 return new OncePerRequestFilter() {
47 protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
48 FilterChain filterChain) throws ServletException, IOException {
49 filterChain.doFilter(request, response);