Skip to content

Commit dbdf674

Browse files
committed
Compatibility test Paths
1 parent 5a031de commit dbdf674

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
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 PathsBCTest {
10+
private final String BASE = "bc_paths_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_paths_changed_but_compatible.yaml");
20+
}
21+
22+
@Test
23+
public void decreased() {
24+
assertOpenApiBackwardIncompatible(BASE, "bc_paths_decreased.yaml");
25+
}
26+
}
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+
get:
9+
operationId: listWidgets
10+
responses:
11+
'200':
12+
description: successful operation
13+
content:
14+
application/json:
15+
schema:
16+
type: string
17+
/widgets/{id}:
18+
get:
19+
operationId: getWidget
20+
responses:
21+
'200':
22+
description: successful operation
23+
content:
24+
application/json:
25+
schema:
26+
type: string
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
content:
14+
application/json:
15+
schema:
16+
type: string
17+
/widgets/{id}:
18+
get:
19+
operationId: getWidget
20+
responses:
21+
'200':
22+
description: successful operation
23+
content:
24+
application/json:
25+
schema:
26+
type: string
27+
/widgets/{id}/status:
28+
get:
29+
operationId: getWidgetStatus
30+
responses:
31+
'200':
32+
description: successful operation
33+
content:
34+
application/json:
35+
schema:
36+
type: string
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+
content:
14+
application/json:
15+
schema:
16+
type: string

0 commit comments

Comments
 (0)