@@ -305,8 +305,8 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
305305 // this is the legacy config that most of our tooling uses
306306 OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
307307 DefaultCodegen codegen = new DefaultCodegen ();
308- codegen .setOpenAPI (openAPI );
309308 codegen .setDisallowAdditionalPropertiesIfNotPresent (true );
309+ codegen .setOpenAPI (openAPI );
310310
311311 Schema schema = openAPI .getComponents ().getSchemas ().get ("AdditionalPropertiesClass" );
312312 Assertions .assertNull (schema .getAdditionalProperties ());
@@ -385,9 +385,9 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
385385 public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPresentFalse () {
386386 OpenAPI openAPI = TestUtils .parseFlattenSpec ("src/test/resources/2_0/additional-properties-for-testing.yaml" );
387387 DefaultCodegen codegen = new DefaultCodegen ();
388- codegen .setOpenAPI (openAPI );
389388 codegen .setDisallowAdditionalPropertiesIfNotPresent (false );
390389 codegen .supportsAdditionalPropertiesWithComposedSchema = true ;
390+ codegen .setOpenAPI (openAPI );
391391 /*
392392 When this DisallowAdditionalPropertiesIfNotPresent is false:
393393 for CodegenModel/CodegenParameter/CodegenProperty/CodegenResponse.getAdditionalProperties
@@ -405,7 +405,7 @@ public void testAdditionalPropertiesV2SpecDisallowAdditionalPropertiesIfNotPrese
405405 Schema addProps = ModelUtils .getAdditionalProperties (schema );
406406 // The petstore-with-fake-endpoints-models-for-testing.yaml does not set the
407407 // 'additionalProperties' keyword for this model, hence assert the value to be null.
408- Assertions .assertNull (addProps );
408+ Assertions .assertNotNull (addProps );
409409 CodegenModel cm = codegen .fromModel ("AdditionalPropertiesClass" , schema );
410410 Assertions .assertNotNull (cm .getAdditionalProperties ());
411411 // When the 'additionalProperties' keyword is not present, the model
0 commit comments