X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Faspect%2FLogAspectTest.java;h=ae8ed2cbdbf537f3ef0d662fdb36b8e9cb15c98c;hb=6a39814272307d0207222c9229b0d765ac062bf0;hp=7930e5c7d0c1ca4969c51e3c1dd2de397a06d5ce;hpb=6116e98837066075013c5ee22b39a2df4ff604ea;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/aspect/LogAspectTest.java b/policy-agent/src/test/java/org/oransc/policyagent/aspect/LogAspectTest.java index 7930e5c7..ae8ed2cb 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/aspect/LogAspectTest.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/aspect/LogAspectTest.java @@ -1,3 +1,23 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2020 Nordix Foundation + * %% + * 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. + * ========================LICENSE_END=================================== + */ + package org.oransc.policyagent.aspect; import static ch.qos.logback.classic.Level.TRACE; @@ -47,7 +67,7 @@ class LogAspectTest { // 'proceed(Object[])' is never called verify(proceedingJoinPoint, never()).proceed(null); - assertThat(logAppender.list.toString().contains("Execution time of")).isTrue(); + assertThat(logAppender.list.get(0).getFormattedMessage()).startsWith("Execution time of"); } @Test @@ -60,7 +80,7 @@ class LogAspectTest { sampleAspect.entryLog(proceedingJoinPoint); - assertThat(logAppender.list.toString().contains("Entering method: " + signature)).isTrue(); + assertThat(logAppender.list.get(0).getFormattedMessage()).isEqualTo("Entering method: " + signature); } @Test @@ -73,6 +93,6 @@ class LogAspectTest { sampleAspect.exitLog(proceedingJoinPoint); - assertThat(logAppender.list.toString().contains("Exiting method: " + signature)).isTrue(); + assertThat(logAppender.list.get(0).getFormattedMessage()).isEqualTo("Exiting method: " + signature); } }