Skip to content

Commit 8bb45a9

Browse files
committed
Compatibility test OauthFlow
1 parent 246f422 commit 8bb45a9

File tree

5 files changed

+142
-0
lines changed

5 files changed

+142
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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.assertSpecUnchanged;
5+
6+
import org.junit.jupiter.api.Test;
7+
8+
public class OAuthFlowBCTest {
9+
private final String BASE = "bc_oauthflow_base.yaml";
10+
11+
@Test
12+
public void unchanged() {
13+
assertSpecUnchanged(BASE, BASE);
14+
}
15+
16+
@Test
17+
public void authorizationUrlChanged() {
18+
assertOpenApiBackwardIncompatible(BASE, "bc_oauthflow_authorization_url_changed.yaml");
19+
}
20+
21+
@Test
22+
public void refreshUrlChanged() {
23+
assertOpenApiBackwardIncompatible(BASE, "bc_oauthflow_refresh_url_changed.yaml");
24+
}
25+
26+
@Test
27+
public void tokenUrlChanged() {
28+
assertOpenApiBackwardIncompatible(BASE, "bc_oauthflow_token_url_changed.yaml");
29+
}
30+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
security:
18+
- oauth2-scheme-1: []
19+
components:
20+
securitySchemes:
21+
oauth2-scheme-1:
22+
type: oauth2
23+
flows:
24+
implicit:
25+
authorizationUrl: https://example.com/api/oauth/authorization2
26+
refreshUrl: https://example.com/api/oauth/refresh
27+
tokenUrl: https://example.com/api/oauth/token
28+
scopes: {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
security:
18+
- oauth2-scheme-1: []
19+
components:
20+
securitySchemes:
21+
oauth2-scheme-1:
22+
type: oauth2
23+
flows:
24+
implicit:
25+
authorizationUrl: https://example.com/api/oauth/authorization
26+
refreshUrl: https://example.com/api/oauth/refresh
27+
tokenUrl: https://example.com/api/oauth/token
28+
scopes: {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
security:
18+
- oauth2-scheme-1: []
19+
components:
20+
securitySchemes:
21+
oauth2-scheme-1:
22+
type: oauth2
23+
flows:
24+
implicit:
25+
authorizationUrl: https://example.com/api/oauth/authorization
26+
refreshUrl: https://example.com/api/oauth/refresh2
27+
tokenUrl: https://example.com/api/oauth/token
28+
scopes: {}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
security:
18+
- oauth2-scheme-1: []
19+
components:
20+
securitySchemes:
21+
oauth2-scheme-1:
22+
type: oauth2
23+
flows:
24+
implicit:
25+
authorizationUrl: https://example.com/api/oauth/authorization
26+
refreshUrl: https://example.com/api/oauth/refresh
27+
tokenUrl: https://example.com/api/oauth/token2
28+
scopes: {}

0 commit comments

Comments
 (0)