-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from arnoweiss/feat/add-catalog-request-message
fix: add artifacts for catalog request message
- Loading branch information
Showing
4 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
artifacts/src/main/resources/catalog/catalog-request-message-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2019-09/schema", | ||
"title": "CatalogRequestMessageSchema", | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/CatalogRequestMessage" | ||
} | ||
], | ||
"$id": "https://w3id.org/dspace/2024/1/catalog/catalog-request-message-schema.json", | ||
"definitions": { | ||
"CatalogRequestMessage": { | ||
"type": "object", | ||
"properties": { | ||
"@context": { | ||
"$ref": "https://w3id.org/dspace/2024/1/common/context-schema.json" | ||
}, | ||
"@type": { | ||
"type": "string", | ||
"const": "CatalogRequestMessage" | ||
}, | ||
"filter": { | ||
"type": "array" | ||
} | ||
}, | ||
"required": [ | ||
"@context", | ||
"@type" | ||
] | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
artifacts/src/main/resources/catalog/example/catalog-request-message.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"@context": [ | ||
"https://w3id.org/dspace/2024/1/context.json" | ||
], | ||
"@type": "CatalogRequestMessage", | ||
"filter": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
artifacts/src/test/java/org/eclipse/dsp/schema/catalog/CatalogRequestMessageSchemaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2024 SAP SE | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* SAP SE - extension to catalog request message | ||
* | ||
*/ | ||
|
||
package org.eclipse.dsp.schema.catalog; | ||
|
||
import org.eclipse.dsp.schema.fixtures.AbstractSchemaTest; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class CatalogRequestMessageSchemaTest extends AbstractSchemaTest { | ||
|
||
@Test | ||
void verifySchema() throws IOException { | ||
var node = mapper.readTree(getClass().getResourceAsStream("/catalog/example/catalog-request-message.json")); | ||
assertThat(schema.validate(node)).isEmpty(); | ||
} | ||
|
||
@BeforeEach | ||
void setUp() { | ||
setUp("/catalog/catalog-request-message-schema.json"); | ||
} | ||
|
||
|
||
} |