File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
config/src/test/java/com/megaease/easeagent/config Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 4444 uses : actions/checkout@v2
4545
4646 - name : Setup Java Version
47- uses : actions/setup-java@v2
47+ uses : actions/setup-java@v3.14.1
4848 with :
4949 java-version : ${{ matrix.java-version }}
5050 distribution : ${{ matrix.java-distribution }}
Original file line number Diff line number Diff line change 1818package com .megaease .easeagent .config ;
1919
2020import com .megaease .easeagent .plugin .utils .SystemEnv ;
21+ import org .junit .After ;
2122import org .junit .Assert ;
2223import org .junit .Test ;
2324
25+ import java .lang .reflect .Field ;
2426import java .util .Map ;
2527
2628
2729public class OtelSdkConfigsTest {
2830
31+ @ After
32+ public void after () throws NoSuchFieldException , IllegalAccessException {
33+ Field field = SystemEnv .class .getDeclaredField ("ENVIRONMENTS" );
34+ field .setAccessible (true );
35+ Object env = field .get (null );
36+ field .setAccessible (false );
37+ Map <String , String > envMap = (Map <String , String >) env ;
38+ envMap .remove ("OTEL_RESOURCE_ATTRIBUTES" );
39+ envMap .remove ("OTEL_SERVICE_NAME" );
40+ envMap .remove ("OTEL_SERVICE_NAMESPACE" );
41+ System .clearProperty ("otel.service.name" );
42+ System .clearProperty ("otel.service.namespace" );
43+ }
44+
2945 @ Test
3046 public void updateEnvCfg () {
3147 //value from system env "OTEL_RESOURCE_ATTRIBUTES
You can’t perform that action at this time.
0 commit comments