File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed 
javaagent-tooling/src/test/java/io/opentelemetry/javaagent/tooling/config Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 88import  static  org .assertj .core .api .Assertions .assertThat ;
99
1010import  java .io .File ;
11- import  java .io .FileWriter ;
1211import  java .io .IOException ;
12+ import  java .io .OutputStreamWriter ;
13+ import  java .io .Writer ;
14+ import  java .nio .charset .StandardCharsets ;
15+ import  java .nio .file .Files ;
1316import  java .util .Map ;
1417import  org .junit .Rule ;
1518import  org .junit .contrib .java .lang .system .EnvironmentVariables ;
1619import  org .junit .jupiter .api .AfterEach ;
1720import  org .junit .jupiter .api .BeforeEach ;
1821import  org .junit .jupiter .api .Test ;
1922import  org .junit .jupiter .api .io .TempDir ;
23+ import  org .junitpioneer .jupiter .ClearSystemProperty ;
2024
25+ @ ClearSystemProperty .ClearSystemProperties 
2126class  ConfigurationFileTest  {
2227
2328  @ TempDir  File  tmpDir ;
@@ -91,7 +96,8 @@ void shouldReturnEmptyPropertiesIfPropertyIsNotSet() {
9196
9297  private  String  createFile (String  name , String  contents ) throws  IOException  {
9398    File  file  = new  File (tmpDir , name );
94-     try  (FileWriter  writer  = new  FileWriter (file )) {
99+     try  (Writer  writer  =
100+         new  OutputStreamWriter (Files .newOutputStream (file .toPath ()), StandardCharsets .UTF_8 )) {
95101      writer .write (contents );
96102    }
97103    return  file .getAbsolutePath ();
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments