diff options
Diffstat (limited to 'intentanalysis')
-rw-r--r-- | intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/IntentAnalysisApplicationTests.java (renamed from intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/IntentAnalysisApplicationTests.java) | 2 | ||||
-rw-r--r-- | intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/adapters/policy/PolicyServiceTest.java (renamed from intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/adapters/policy/PolicyServiceTest.java) | 6 | ||||
-rw-r--r-- | intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java (renamed from intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/service/IntentServiceTest.java) | 5 | ||||
-rw-r--r-- | intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/RestFulServicesTest.java (renamed from intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/RestFulServicesTest.java) | 26 | ||||
-rw-r--r-- | intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/TestCall.java (renamed from intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/TestCall.java) | 2 | ||||
-rw-r--r-- | intentanalysis/src/test/resources/logback-test.xml | 59 |
6 files changed, 69 insertions, 31 deletions
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/IntentAnalysisApplicationTests.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/IntentAnalysisApplicationTests.java index 529f08d..965ec6d 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/IntentAnalysisApplicationTests.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/IntentAnalysisApplicationTests.java @@ -12,7 +12,7 @@ * the License. */ -package org.onap.usecaseui.intentanalysis.test; +package org.onap.usecaseui.intentanalysis; import java.io.IOException; import javax.servlet.FilterChain; diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/adapters/policy/PolicyServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/adapters/policy/PolicyServiceTest.java index 11084e3..ea253e7 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/adapters/policy/PolicyServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/adapters/policy/PolicyServiceTest.java @@ -12,7 +12,7 @@ * the License. */ -package org.onap.usecaseui.intentanalysis.test.adapters.policy; +package org.onap.usecaseui.intentanalysis.adapters.policy; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; @@ -29,8 +29,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.onap.usecaseui.intentanalysis.adapters.policy.apicall.PolicyAPICall; import org.onap.usecaseui.intentanalysis.adapters.policy.impl.PolicyServiceImpl; -import org.onap.usecaseui.intentanalysis.test.IntentAnalysisApplicationTests; -import org.onap.usecaseui.intentanalysis.test.util.TestCall; +import org.onap.usecaseui.intentanalysis.IntentAnalysisApplicationTests; +import org.onap.usecaseui.intentanalysis.util.TestCall; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/service/IntentServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java index 6dc1062..9e93b87 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/service/IntentServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java @@ -12,7 +12,7 @@ * the License. */ -package org.onap.usecaseui.intentanalysis.test.service; +package org.onap.usecaseui.intentanalysis.service; import java.io.IOException; import java.util.ArrayList; @@ -30,8 +30,7 @@ import org.onap.usecaseui.intentanalysis.bean.models.Context; import org.onap.usecaseui.intentanalysis.bean.models.Expectation; import org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget; import org.onap.usecaseui.intentanalysis.bean.models.ExpectationObject; -import org.onap.usecaseui.intentanalysis.service.IntentService; -import org.onap.usecaseui.intentanalysis.test.IntentAnalysisApplicationTests; +import org.onap.usecaseui.intentanalysis.IntentAnalysisApplicationTests; import org.onap.usecaseui.intentanalysis.util.SpringContextUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/RestFulServicesTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/RestFulServicesTest.java index 6af9820..b19e9a1 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/RestFulServicesTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/RestFulServicesTest.java @@ -12,37 +12,17 @@ * the License. */ -package org.onap.usecaseui.intentanalysis.test.util; +package org.onap.usecaseui.intentanalysis.util; -import java.io.BufferedReader; import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.security.Principal; -import java.util.Collection; -import java.util.Enumeration; -import java.util.Locale; -import java.util.Map; -import javax.servlet.AsyncContext; -import javax.servlet.DispatcherType; -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletInputStream; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.HttpUpgradeHandler; -import javax.servlet.http.Part; + import okhttp3.RequestBody; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.usecaseui.intentanalysis.adapters.policy.apicall.PolicyAPICall; -import org.onap.usecaseui.intentanalysis.test.IntentAnalysisApplicationTests; -import org.onap.usecaseui.intentanalysis.util.RestfulServices; +import org.onap.usecaseui.intentanalysis.IntentAnalysisApplicationTests; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.context.junit4.SpringRunner; diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/TestCall.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/TestCall.java index d9cc4a8..5454097 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/test/util/TestCall.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/util/TestCall.java @@ -12,7 +12,7 @@ * the License. */ -package org.onap.usecaseui.intentanalysis.test.util; +package org.onap.usecaseui.intentanalysis.util; import java.io.IOException; import okhttp3.MediaType; diff --git a/intentanalysis/src/test/resources/logback-test.xml b/intentanalysis/src/test/resources/logback-test.xml new file mode 100644 index 0000000..cb9a4a4 --- /dev/null +++ b/intentanalysis/src/test/resources/logback-test.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2022 Huawei Technologies Co., Ltd. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> +<configuration> + + <variable name="LOG_HOME" value="/log/usecaseui/intent-analysis" /> + + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <Target>System.out</Target> + <!-- encoders are assigned the type + ch.qos.logback.classic.encoder.PatternLayoutEncoder by default --> + <encoder> + <pattern>%d{yyyy-MM-dd HH:mm:ss:SSS} %5p ${PID} --- [%15.15t] %-40.40c{40} : %m%n</pattern> + </encoder> + </appender> + + <appender name="FILE" class="ch.qos.logback.core.FileAppender"> + <file>${user.dir}/${LOG_HOME}/ERROR.log</file> + <append>true</append> + <!-- set immediateFlush to false for much higher logging throughput --> + <immediateFlush>true</immediateFlush> + <encoder> + <pattern>%d{yyyy-MM-dd HH:mm:ss:SSS} %5p ${PID} --- [%15.15t] %-40.40c{40} : %m%n</pattern> + </encoder> + </appender> + <appender name="ROLLING-FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> + <fileNamePattern>${user.dir}/${LOG_HOME}/%d{yyyy-MM}-DEBUG.log</fileNamePattern> + <maxHistory>90</maxHistory> + <totalSizeCap>3GB</totalSizeCap> + </rollingPolicy> + <encoder> + <pattern>>%d{yyyy-MM-dd HH:mm:ss:SSS} %5p ${PID} --- [%15.15t] %-40.40c{40} : %m%n</pattern> + </encoder> + </appender> + + <logger name="org.onap.usecaseui.intentanalysis" level="error"> + <appender-ref ref="FILE" /> + </logger> + + <logger name="org.onap.usecaseui.intentanalysis" level="debug"> + <appender-ref ref="ROLLING-FILE" /> + </logger> + + <root level="info"> + <appender-ref ref="STDOUT"/> + </root> + +</configuration>
\ No newline at end of file |