Skip to content

Commit c18202d

Browse files
committed
Compatibility test ApiResponse
- Remove redundant ApiResponseDiffTest. Comment regarding original issue retained.
1 parent 1524342 commit c18202d

File tree

7 files changed

+82
-49
lines changed

7 files changed

+82
-49
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.openapitools.openapidiff.core.backcompat;
2+
3+
import static org.openapitools.openapidiff.core.TestUtils.assertOpenApiBackwardIncompatible;
4+
import static org.openapitools.openapidiff.core.TestUtils.assertSpecChangedButCompatible;
5+
import static org.openapitools.openapidiff.core.TestUtils.assertSpecUnchanged;
6+
7+
import org.junit.jupiter.api.Test;
8+
9+
public class ApiResponseBCTest {
10+
private final String BASE = "bc_response_apiresponse_base.yaml";
11+
12+
@Test
13+
public void unchanged() {
14+
assertSpecUnchanged(BASE, BASE);
15+
}
16+
17+
@Test
18+
public void changedButCompatible() {
19+
assertSpecChangedButCompatible(BASE, "bc_response_apiresponse_changed_but_compatible.yaml");
20+
}
21+
22+
@Test
23+
public void decreased() {
24+
assertOpenApiBackwardIncompatible(BASE, "bc_response_apiresponse_decreased.yaml");
25+
}
26+
}

core/src/test/java/org/openapitools/openapidiff/core/compare/ApiResponseDiffTest.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

core/src/test/resources/backwardCompatibility/apiResponse_diff_1.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

core/src/test/resources/backwardCompatibility/apiResponse_diff_2.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
get:
9+
operationId: listWidgets
10+
responses:
11+
'200':
12+
description: successful operation
13+
'400':
14+
description: Invalid status value
15+
/widgets/index:
16+
post:
17+
operationId: indexWidgets
18+
description: Regression test for https://github.com/OpenAPITools/openapi-diff/pull/206 (handle missing responses)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
get:
9+
operationId: listWidgets
10+
responses:
11+
'200':
12+
description: successful operation
13+
'201':
14+
description: OK
15+
'400':
16+
description: Invalid status value
17+
/widgets/index:
18+
post:
19+
operationId: indexWidgets
20+
responses:
21+
'200':
22+
description: successful operation
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
get:
9+
operationId: listWidgets
10+
responses:
11+
'200':
12+
description: successful operation
13+
/widgets/index:
14+
post:
15+
operationId: indexWidgets
16+
description: Regression test for https://github.com/OpenAPITools/openapi-diff/pull/206 (handle missing responses)

0 commit comments

Comments
 (0)