Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/land/oras/utils/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ private Const() {
*/
public static final String ANNOTATION_REF = "org.opencontainers.image.ref.name";

/**
* Annotation for the source
*/
public static final String ANNOTATION_SOURCE = "org.opencontainers.image.source";

/**
* Annotation for the revision
*/
public static final String ANNOTATION_REVISION = "org.opencontainers.image.revision";

/**
* Get the current timestamp for the created annotation
* @return The current timestamp
Expand Down
40 changes: 40 additions & 0 deletions src/test/java/land/oras/utils/ConstTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*-
* =LICENSE=
* ORAS Java SDK
* ===
* Copyright (C) 2024 - 2025 ORAS
* ===
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =LICENSEEND=
*/

package land.oras.utils;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;

@Execution(ExecutionMode.CONCURRENT)
public class ConstTest {

@Test
void shouldValidateAnnotations() {
assertEquals("org.opencontainers.image.title", Const.ANNOTATION_TITLE);
assertEquals("org.opencontainers.image.source", Const.ANNOTATION_SOURCE);
assertEquals("org.opencontainers.image.revision", Const.ANNOTATION_REVISION);
assertEquals("org.opencontainers.image.created", Const.ANNOTATION_CREATED);
assertEquals("org.opencontainers.image.ref.name", Const.ANNOTATION_REF);
}
}