Skip to content

Commit 7f6f04b

Browse files
codelipenghuieolivelli
authored andcommitted
[fix][schema] Fix the schema registry tests and enabled the schema tests in CI (#1835)
- Fix the schema registry test is not enabled in GitHub CI - Fix the failed tests after #1826 merged (cherry picked from commit 9b01854)
1 parent 128d933 commit 7f6f04b

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.github/workflows/pr-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
- name: Build with Maven skipTests
3838
run: mvn clean checkstyle:check install -ntp -B -DskipTests
3939

40+
- name: schema registry test after build
41+
run: mvn test -ntp -B -DfailIfNoTests=false -pl schema-registry
42+
4043
- name: tests module
4144
run: mvn test -ntp -B -DfailIfNoTests=false '-Dtest=!Docker*Test,!*Proxy*Test' -pl tests
4245
timeout-minutes: 120

schema-registry/src/test/java/io/streamnative/pulsar/handlers/kop/schemaregistry/SchemaRegistryHandlerTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public void testBasicJsonApi() throws Exception {
7272
@Test
7373
public void testBasicJsonApiError401() throws Exception {
7474
assertEquals("{\n"
75-
+ " \"message\" : \"Bad auth\",\n"
76-
+ " \"error_code\" : 401\n"
75+
+ " \"error_code\" : 401,\n"
76+
+ " \"message\" : \"Bad auth\"\n"
7777
+ "}",
7878
server.executePost("/subjects/errorsubject401", "{\n"
7979
+ " \"value\" : \"/json/test\"\n"
@@ -83,8 +83,8 @@ public void testBasicJsonApiError401() throws Exception {
8383
@Test
8484
public void testBasicJsonApiError403() throws Exception {
8585
assertEquals("{\n"
86-
+ " \"message\" : \"Forbidden\",\n"
87-
+ " \"error_code\" : 403\n"
86+
+ " \"error_code\" : 403,\n"
87+
+ " \"message\" : \"Forbidden\"\n"
8888
+ "}",
8989
server.executePost("/subjects/errorsubject403", "{\n"
9090
+ " \"value\" : \"/json/test\"\n"
@@ -94,8 +94,8 @@ public void testBasicJsonApiError403() throws Exception {
9494
@Test
9595
public void testBasicJsonApiError500() throws Exception {
9696
assertEquals("{\n"
97-
+ " \"message\" : \"Error\",\n"
98-
+ " \"error_code\" : 500\n"
97+
+ " \"error_code\" : 500,\n"
98+
+ " \"message\" : \"Error\"\n"
9999
+ "}",
100100
server.executePost("/subjects/errorsubject500", "{\n"
101101
+ " \"value\" : \"/json/test\"\n"

schema-registry/src/test/java/io/streamnative/pulsar/handlers/kop/schemaregistry/resources/SchemaResourceTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ public void getSchemaBySubjectAndVersion() throws Exception {
142142
+ " \"id\" : 1,\n"
143143
+ " \"schema\" : \"{SCHEMA-1}\",\n"
144144
+ " \"subject\" : \"aaa\",\n"
145-
+ " \"version\" : 17,\n"
146-
+ " \"type\" : \"AVRO\"\n"
145+
+ " \"version\" : 17\n"
147146
+ "}");
148147
}
149148

@@ -217,8 +216,7 @@ public void getLatestVersionSubject() throws Exception {
217216
+ " \"id\" : 3,\n"
218217
+ " \"schema\" : \"{SCHEMA3}\",\n"
219218
+ " \"subject\" : \"subject1\",\n"
220-
+ " \"version\" : 8,\n"
221-
+ " \"type\" : \"AVRO\"\n"
219+
+ " \"version\" : 8\n"
222220
+ "}");
223221

224222
server.executeMethod("/subjects/subjectnotexists/versions/latest", "GET",

0 commit comments

Comments
 (0)