Skip to content

Commit 4cf3567

Browse files
authored
Add test for Azure CR (#520)
2 parents c40d43b + 60255b0 commit 4cf3567

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*-
2+
* =LICENSE=
3+
* ORAS Java SDK
4+
* ===
5+
* Copyright (C) 2024 - 2025 ORAS
6+
* ===
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* =LICENSEEND=
19+
*/
20+
21+
package land.oras;
22+
23+
import static org.junit.jupiter.api.Assertions.assertNotNull;
24+
25+
import org.junit.jupiter.api.Test;
26+
import org.junit.jupiter.api.parallel.Execution;
27+
import org.junit.jupiter.api.parallel.ExecutionMode;
28+
29+
@Execution(ExecutionMode.CONCURRENT)
30+
class PublicAzureCRITCase {
31+
32+
@Test
33+
void shouldPullAnonymousIndex() {
34+
35+
// Via tag
36+
Registry registry = Registry.builder().build();
37+
ContainerRef containerRef1 = ContainerRef.parse("mcr.microsoft.com/azurelinux/busybox:1.36");
38+
Index index = registry.getIndex(containerRef1);
39+
assertNotNull(index);
40+
41+
// Via digest
42+
ContainerRef containerRef2 = ContainerRef.parse(
43+
"mcr.microsoft.com/azurelinux/busybox@sha256:330ce7e940f7476089c4c74565c63767988e188b06988e58e76b54890e7f621b");
44+
Index index2 = registry.getIndex(containerRef2);
45+
assertNotNull(index2);
46+
}
47+
48+
@Test
49+
void shouldPullAnonymousManifest() {
50+
51+
// Via tag
52+
Registry registry = Registry.builder().build();
53+
54+
// Via digest
55+
ContainerRef containerRef1 = ContainerRef.parse(
56+
"mcr.microsoft.com/azurelinux/busybox@sha256:ec5adfc87f57633da1feedb2361c06374020ab9c99d4a14b19319e57284b6656");
57+
Manifest manifest1 = registry.getManifest(containerRef1);
58+
assertNotNull(manifest1);
59+
}
60+
}

0 commit comments

Comments
 (0)