|
| 1 | +/*- |
| 2 | + * =LICENSE= |
| 3 | + * ORAS Java SDK |
| 4 | + * === |
| 5 | + * Copyright (C) 2024 - 2026 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 java.nio.file.Path; |
| 26 | +import org.junit.jupiter.api.Test; |
| 27 | +import org.junit.jupiter.api.io.TempDir; |
| 28 | + |
| 29 | +class OracleContainerRegistryITCase { |
| 30 | + |
| 31 | + @TempDir |
| 32 | + private Path tempDir; |
| 33 | + |
| 34 | + @Test |
| 35 | + void shouldPullManifest() { |
| 36 | + Registry registry = Registry.builder().build(); |
| 37 | + ContainerRef containerRef1 = ContainerRef.parse("container-registry.oracle.com/os/oraclelinux:latest"); |
| 38 | + Manifest manifest = registry.getManifest(containerRef1); |
| 39 | + assertNotNull(manifest); |
| 40 | + } |
| 41 | + |
| 42 | + @Test |
| 43 | + void shouldPullOneBlob() { |
| 44 | + Registry registry = Registry.builder().build(); |
| 45 | + ContainerRef containerRef1 = ContainerRef.parse( |
| 46 | + "container-registry.oracle.com/os/oraclelinux@sha256:50ab38810635947eebaa66f1d3b551fcb5a28cc372dd3022805d83618fb59c02"); |
| 47 | + registry.fetchBlob(containerRef1, tempDir.resolve("my-blob")); |
| 48 | + assertNotNull(tempDir.resolve("my-blob")); |
| 49 | + } |
| 50 | +} |
0 commit comments