File tree Expand file tree Collapse file tree
main/java/io/opentelemetry/contrib/aws/resource
test/java/io/opentelemetry/contrib/aws/resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import java .io .IOException ;
2222import java .nio .file .Files ;
2323import java .nio .file .Path ;
24+ import java .nio .file .Paths ;
2425import java .util .Map ;
2526import java .util .stream .Stream ;
2627
@@ -40,12 +41,12 @@ public static Resource get() {
4041 }
4142
4243 private static Resource buildResource () {
43- return buildResource (System .getenv (), Path . of (ACCOUNT_ID_SYMLINK_PATH ));
44+ return buildResource (System .getenv (), Paths . get (ACCOUNT_ID_SYMLINK_PATH ));
4445 }
4546
4647 // Visible for testing
4748 static Resource buildResource (Map <String , String > environmentVariables ) {
48- return buildResource (environmentVariables , Path . of (ACCOUNT_ID_SYMLINK_PATH ));
49+ return buildResource (environmentVariables , Paths . get (ACCOUNT_ID_SYMLINK_PATH ));
4950 }
5051
5152 // Visible for testing
Original file line number Diff line number Diff line change 2222import io .opentelemetry .semconv .SchemaUrls ;
2323import java .nio .file .Files ;
2424import java .nio .file .Path ;
25+ import java .nio .file .Paths ;
2526import java .util .HashMap ;
2627import java .util .Map ;
2728import java .util .ServiceLoader ;
@@ -72,7 +73,7 @@ void shouldAddAllAttributes() {
7273 @ Test
7374 void shouldReadCloudAccountIdFromSymlink (@ TempDir Path tempDir ) throws Exception {
7475 Path symlink = tempDir .resolve (".otel-account-id" );
75- Files .createSymbolicLink (symlink , Path . of ("123456789012" ));
76+ Files .createSymbolicLink (symlink , Paths . get ("123456789012" ));
7677
7778 Resource resource =
7879 LambdaResource .buildResource (
@@ -106,7 +107,7 @@ void shouldSkipCloudAccountIdWhenSymlinkMissing(@TempDir Path tempDir) {
106107 @ Test
107108 void shouldPreserveLeadingZerosInAccountId (@ TempDir Path tempDir ) throws Exception {
108109 Path symlink = tempDir .resolve (".otel-account-id" );
109- Files .createSymbolicLink (symlink , Path . of ("012345678901" ));
110+ Files .createSymbolicLink (symlink , Paths . get ("012345678901" ));
110111
111112 Resource resource =
112113 LambdaResource .buildResource (
You can’t perform that action at this time.
0 commit comments