Skip to content

Commit ea09c2b

Browse files
committed
Compatibility test Content
1 parent c18202d commit ea09c2b

File tree

5 files changed

+147
-0
lines changed

5 files changed

+147
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 ContentBCTest {
10+
private final String BASE = "bc_content_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_content_changed_but_compatible.yaml");
20+
}
21+
22+
@Test
23+
public void requestDecreased() {
24+
assertOpenApiBackwardIncompatible(BASE, "bc_request_content_decreased.yaml");
25+
}
26+
27+
@Test
28+
public void responseDecreased() {
29+
assertOpenApiBackwardIncompatible(BASE, "bc_response_content_decreased.yaml");
30+
}
31+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: integer
15+
format: int32
16+
application/text:
17+
schema:
18+
type: string
19+
responses:
20+
'200':
21+
description: successful operation
22+
content:
23+
application/json:
24+
schema:
25+
type: integer
26+
format: int32
27+
application/text:
28+
schema:
29+
type: string
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: integer
15+
format: int32
16+
application/text:
17+
schema:
18+
type: string
19+
application/xml:
20+
schema:
21+
type: string
22+
responses:
23+
'200':
24+
description: successful operation
25+
content:
26+
application/json:
27+
schema:
28+
type: integer
29+
format: int32
30+
application/text:
31+
schema:
32+
type: string
33+
application/xml:
34+
schema:
35+
type: string
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: integer
15+
format: int32
16+
responses:
17+
'200':
18+
description: successful operation
19+
content:
20+
application/json:
21+
schema:
22+
type: integer
23+
format: int32
24+
application/text:
25+
schema:
26+
type: string
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
openapi: 3.0.0
2+
info:
3+
description: myDesc
4+
title: myTitle
5+
version: 1.0.0
6+
paths:
7+
/widgets:
8+
post:
9+
operationId: widgetCreate
10+
requestBody:
11+
content:
12+
application/json:
13+
schema:
14+
type: integer
15+
format: int32
16+
application/text:
17+
schema:
18+
type: string
19+
responses:
20+
'200':
21+
description: successful operation
22+
content:
23+
application/json:
24+
schema:
25+
type: integer
26+
format: int32

0 commit comments

Comments
 (0)