@@ -599,8 +599,8 @@ void shouldPushBlob() throws IOException {
599599 byte [] content = "hi" .getBytes (StandardCharsets .UTF_8 );
600600 String digest = SupportedAlgorithm .SHA256 .digest (content );
601601
602- LayoutRef layoutRef = LayoutRef .parse ("%s@%s" .formatted (path .toString (), digest ));
603602 OCILayout ociLayout = OCILayout .Builder .builder ().defaults (path ).build ();
603+ LayoutRef layoutRef = LayoutRef .of (ociLayout , digest );
604604
605605 // Push more blobs
606606 ociLayout .pushBlob (layoutRef , "hi" .getBytes (StandardCharsets .UTF_8 ));
@@ -621,11 +621,12 @@ void cannotPushBlobWithoutTagOrDigest() throws IOException {
621621
622622 Path invalidBlobPushDir = layoutPath .resolve ("shouldPushArtifact" );
623623
624- LayoutRef noTagLayout = LayoutRef .parse ("%s" .formatted (invalidBlobPushDir .toString ()));
625- LayoutRef noDigestLayout = LayoutRef .parse ("%s:latest" .formatted (invalidBlobPushDir .toString ()));
626624 OCILayout ociLayout =
627625 OCILayout .Builder .builder ().defaults (invalidBlobPushDir ).build ();
628626
627+ LayoutRef noTagLayout = LayoutRef .of (ociLayout );
628+ LayoutRef noDigestLayout = LayoutRef .of (ociLayout , "latest" );
629+
629630 // Push more blobs
630631 assertThrows (OrasException .class , () -> {
631632 ociLayout .pushBlob (noTagLayout , "hi" .getBytes (StandardCharsets .UTF_8 ));
@@ -665,7 +666,7 @@ void testShouldCopyArtifactFromRegistryIntoOciLayout() throws IOException {
665666 .build ();
666667
667668 OCILayout ociLayout = OCILayout .builder ().defaults (layoutPath ).build ();
668- LayoutRef layoutRef = LayoutRef .parse ( "%s" . formatted ( ociLayout . getPath ()) );
669+ LayoutRef layoutRef = LayoutRef .of ( ociLayout );
669670
670671 ContainerRef containerRef =
671672 ContainerRef .parse ("%s/library/artifact-oci-layout" .formatted (this .registry .getRegistry ()));
0 commit comments