Skip to content

Commit 81e79e2

Browse files
mma5997frantuma
authored andcommitted
Revert "Updated the test files as per PR changes"
This reverts commit f83f325.
1 parent a54bba6 commit 81e79e2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/FileReferenceTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import io.swagger.v3.oas.models.PathItem;
99
import io.swagger.v3.oas.models.media.ArraySchema;
1010
import io.swagger.v3.oas.models.media.ComposedSchema;
11-
import io.swagger.v3.oas.models.media.ObjectSchema;
1211
import io.swagger.v3.oas.models.media.Schema;
1312
import io.swagger.v3.parser.OpenAPIV3Parser;
1413
import io.swagger.v3.parser.core.models.ParseOptions;
@@ -236,9 +235,9 @@ public void testIssue421() {
236235
assertNotNull(swagger.getPaths().get("/pet/{petId}").getPost().getParameters());
237236
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getParameters().size() == 1);
238237
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody() != null);
239-
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().getContent() != null);
240-
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().getContent().get("application/x-www-form-urlencoded") != null);
241-
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().getContent().get("application/x-www-form-urlencoded").getSchema() instanceof ObjectSchema);
238+
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().get$ref() != null);
239+
assertEquals(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().get$ref(),"#/components/requestBodies/requestBody");
240+
assertTrue(swagger.getPaths().get("/pet/{petId}").getPost().getRequestBody().get$ref().equals("#/components/requestBodies/requestBody"));
242241

243242
assertNotNull(swagger.getPaths().get("/store/order"));
244243
assertNotNull(swagger.getPaths().get("/store/order").getPost());

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIResolverTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ public void componentsResolver() throws Exception {
346346
// internal callback reference
347347
assertEquals(callbacks.get("referenced").get$ref(),"#/components/callbacks/failed");
348348
//callback pathItem -> operation ->requestBody
349-
assertTrue(callbacks.get("heartbeat").get("$request.query.heartbeat-url").getPost().getRequestBody().getContent() != null);
350-
assertTrue(callbacks.get("heartbeat").get("$request.query.heartbeat-url").getPost().getRequestBody().getContent().get("application/json").getSchema() instanceof ArraySchema);
351-
assertEquals(((ArraySchema) callbacks.get("heartbeat").get("$request.query.heartbeat-url").getPost().getRequestBody().getContent().get("application/json").getSchema()).getItems().get$ref(),"#/components/schemas/User");
349+
assertEquals(callbacks.get("heartbeat").get("$request.query.heartbeat-url").getPost().getRequestBody().get$ref(),"#/components/requestBodies/requestBody3");
352350
//remote callback ref
353351
assertEquals(callbacks.get("remoteCallback").get$ref(),"#/components/callbacks/callback");
354352

0 commit comments

Comments
 (0)