Skip to content

Commit 1fefa31

Browse files
authored
fix: tests on versioning endpoint (#148)
* fix: tests on versioning endpoint * feat: add gradle build to pr
1 parent 1694012 commit 1fefa31

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

.github/workflows/pr-check.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,15 @@ on:
77

88
jobs:
99
trigger-workflow:
10-
uses: eclipse-dataspace-protocol-base/.github/.github/workflows/scan-pr-title.yml@main
10+
uses: eclipse-dataspace-protocol-base/.github/.github/workflows/scan-pr-title.yml@main
11+
run-tests:
12+
name: gradle
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: ./.github/actions/setup-java
17+
- name: run
18+
run: |
19+
cd artifacts
20+
chmod +x ./gradlew
21+
./gradlew build

artifacts/src/main/resources/common/protocol-version-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "object",
55
"allOf": [
66
{
7-
"$ref": "#/definitions/Version"
7+
"$ref": "#/definitions/VersionResponse"
88
}
99
],
1010
"$id": "https://w3id.org/dspace/2025/1/common/protocol-version-schema.json",

artifacts/src/test/java/org/eclipse/dsp/schema/common/InvalidVersionSchemaTest.java

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void verifyInvalidCases() throws IOException {
3535
assertThat(schema.validate(INVALID_BINDING_NOT_IN_ENUM, JSON).iterator().next().getType()).isEqualTo(ENUM);
3636
assertThat(schema.validate(INVALID_AUTH_A_STRING, JSON).iterator().next().getType()).isEqualTo(TYPE);
3737
assertThat(schema.validate(INVALID_AUTH_MISSING_PROTOCOL, JSON).iterator().next().getType()).isEqualTo(REQUIRED);
38-
assertThat(schema.validate(INVALID_AUTH_NOT_AN_ARRAY, JSON).iterator().next().getType()).isEqualTo(TYPE);
38+
assertThat(schema.validate(INVALID_AUTH_PROFILE_NOT_AN_ARRAY, JSON).iterator().next().getType()).isEqualTo(TYPE);
3939
}
4040

4141
@BeforeEach
@@ -91,7 +91,14 @@ void setUp() {
9191
"version": "1.0",
9292
"path": "mqtts://mycorp.com/some/path/v1",
9393
"binding": "MQTT",
94-
"auth": "auth-protocol"
94+
"auth": {
95+
"protocol": "some-protocol",
96+
"version": "2",
97+
"profile": [
98+
"one-profile",
99+
"different-profile"
100+
]
101+
}
95102
}
96103
]
97104
}
@@ -104,7 +111,7 @@ void setUp() {
104111
"version": "1.0",
105112
"path": "/some/path/v1",
106113
"binding": "HTTPS",
107-
"auth": "auth-protocol"
114+
"auth": "a string"
108115
}
109116
]
110117
}
@@ -118,23 +125,27 @@ void setUp() {
118125
"path": "/some/path/v1",
119126
"binding": "HTTPS",
120127
"auth": {
121-
"version": "a.b.c",
122-
"profile": ["someprofile"]
128+
"version": "2",
129+
"profile": [
130+
"one-profile",
131+
"different-profile"
132+
]
123133
}
124134
}
125135
]
126136
}
127137
""";
128-
private static final String INVALID_AUTH_NOT_AN_ARRAY = """
138+
private static final String INVALID_AUTH_PROFILE_NOT_AN_ARRAY = """
129139
{
130140
"protocolVersions": [
131141
{
132142
"version": "1.0",
133143
"path": "/some/path/v1",
134144
"binding": "HTTPS",
135145
"auth": {
136-
"version": "a.b.c",
137-
"profile": "someprofile"
146+
"protocol": "some-protocol",
147+
"version": "2",
148+
"profile": "one-profile"
138149
}
139150
}
140151
]

0 commit comments

Comments
 (0)