Merge "Added STD sim 2.0.0 tests"
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / aspect / LogAspectTest.java
index 7930e5c..ae8ed2c 100644 (file)
@@ -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);
     }
 }