Skip to content

Commit 76947e0

Browse files
committed
Add test cases
1 parent 1607445 commit 76947e0

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

core/src/test/java/org/openapitools/openapidiff/core/backcompat/OperationBCTest.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package org.openapitools.openapidiff.core.backcompat;
22

33
import static org.openapitools.openapidiff.core.TestUtils.assertSpecChangedButCompatible;
4+
import static org.openapitools.openapidiff.core.TestUtils.assertSpecIncompatible;
45
import static org.openapitools.openapidiff.core.TestUtils.assertSpecUnchanged;
56

67
import org.junit.jupiter.api.Test;
8+
import org.openapitools.openapidiff.core.model.BackwardIncompatibleProp;
79

810
public class OperationBCTest {
911
private final String BASE = "bc_operation_base.yaml";
@@ -17,4 +19,14 @@ public void unchanged() {
1719
public void changedButCompatible() {
1820
assertSpecChangedButCompatible(BASE, "bc_operation_changed_but_compatible.yaml");
1921
}
22+
23+
@Test
24+
public void operationIdChangedButCompatible() {
25+
assertSpecChangedButCompatible(BASE, "bc_operation_changed_incompatible_operation_id.yaml");
26+
}
27+
28+
@Test
29+
public void operationIdChangedInCompatibleWithFlagSet() {
30+
assertSpecIncompatible(BASE, "bc_operation_changed_incompatible_operation_id.yaml", BackwardIncompatibleProp.OPERATION_ID_CHANGED);
31+
}
2032
}
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: listWidgetsV2
10+
responses:
11+
'200':
12+
description: successful operation
13+
content:
14+
application/json:
15+
schema:
16+
type: string

0 commit comments

Comments
 (0)