|
| 1 | +/* |
| 2 | + * Copyright 2024 NAVER Corp. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package com.navercorp.pinpoint.it.plugin.log4j2; |
| 17 | + |
| 18 | +import com.navercorp.pinpoint.it.plugin.utils.AgentPath; |
| 19 | +import com.navercorp.pinpoint.it.plugin.utils.PluginITConstants; |
| 20 | +import com.navercorp.pinpoint.test.plugin.*; |
| 21 | +import org.junit.jupiter.api.Assertions; |
| 22 | +import org.junit.jupiter.api.Test; |
| 23 | + |
| 24 | +@PluginForkedTest |
| 25 | +@PinpointAgent(AgentPath.PATH) |
| 26 | +@PinpointConfig("pinpoint-spring-bean-test.config") |
| 27 | +@JvmVersion(11) |
| 28 | +@Dependency({"org.apache.logging.log4j:log4j-core:[2.20,2.22]", PluginITConstants.VERSION}) |
| 29 | +@JvmArgument({"-DtestLoggerEnable=false", "-Dprofiler.log4j2.logging.pattern.full_replace.with=Log4j2IT TxId:%X{PtxId} %message"}) |
| 30 | +public class Log4J2PatternFullReplace_2_20_ITTest extends Log4j2PatternTestBase { |
| 31 | + |
| 32 | + @Test |
| 33 | + public void patternUpdate() { |
| 34 | + String log = checkPatternUpdate(); |
| 35 | + Assertions.assertTrue(log.contains("Log4j2IT"), "contains full-replace string Log4j2IT"); |
| 36 | + } |
| 37 | + |
| 38 | +} |
0 commit comments