4141import static org .assertj .core .api .Assertions .assertThat ;
4242import static org .openapitools .codegen .TestUtils .assertFileContains ;
4343import static org .openapitools .codegen .TestUtils .assertFileNotContains ;
44- import static org .openapitools .codegen .languages .KotlinSpringServerCodegen .REACTIVE ;
45- import static org .openapitools .codegen .languages .KotlinSpringServerCodegen .SERVICE_IMPLEMENTATION ;
46- import static org .openapitools .codegen .languages .SpringCodegen .DELEGATE_PATTERN ;
47- import static org .openapitools .codegen .languages .SpringCodegen .SPRING_BOOT ;
4844import static org .openapitools .codegen .languages .features .DocumentationProviderFeatures .ANNOTATION_LIBRARY ;
4945import static org .openapitools .codegen .languages .features .DocumentationProviderFeatures .DOCUMENTATION_PROVIDER ;
5046
@@ -214,7 +210,7 @@ public void testSettersForConfigValues() throws Exception {
214210 Assert .assertTrue (codegen .getServiceInterface ());
215211 Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen .SERVICE_INTERFACE ), true );
216212 Assert .assertTrue (codegen .getServiceImplementation ());
217- Assert .assertEquals (codegen .additionalProperties ().get (SERVICE_IMPLEMENTATION ), true );
213+ Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION ), true );
218214 Assert .assertFalse (codegen .getUseBeanValidation ());
219215 Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen .USE_BEANVALIDATION ), false );
220216 Assert .assertFalse (codegen .isReactive ());
@@ -233,7 +229,7 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
233229 codegen .additionalProperties ().put (KotlinSpringServerCodegen .EXCEPTION_HANDLER , false );
234230 codegen .additionalProperties ().put (KotlinSpringServerCodegen .GRADLE_BUILD_FILE , false );
235231 codegen .additionalProperties ().put (KotlinSpringServerCodegen .SERVICE_INTERFACE , true );
236- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
232+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
237233 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_BEANVALIDATION , false );
238234 codegen .additionalProperties ().put (KotlinSpringServerCodegen .REACTIVE , false );
239235 codegen .processOpts ();
@@ -259,7 +255,7 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
259255 Assert .assertTrue (codegen .getServiceInterface ());
260256 Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen .SERVICE_INTERFACE ), true );
261257 Assert .assertTrue (codegen .getServiceImplementation ());
262- Assert .assertEquals (codegen .additionalProperties ().get (SERVICE_IMPLEMENTATION ), true );
258+ Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION ), true );
263259 Assert .assertFalse (codegen .getUseBeanValidation ());
264260 Assert .assertEquals (codegen .additionalProperties ().get (KotlinSpringServerCodegen .USE_BEANVALIDATION ), false );
265261 Assert .assertFalse (codegen .isReactive ());
@@ -797,8 +793,8 @@ public void contractWithResolvedInnerEnumContainsEnumConverter() throws IOExcept
797793 @ Test
798794 public void givenNonRequiredMultipartFileArray_whenGenerateDelegateAndService_thenParameterIsCreatedAsNullableListOfMultipartFile () throws IOException {
799795 Map <String , Object > additionalProperties = new HashMap <>();
800- additionalProperties .put (DELEGATE_PATTERN , true );
801- additionalProperties .put (SERVICE_IMPLEMENTATION , true );
796+ additionalProperties .put (KotlinSpringServerCodegen . DELEGATE_PATTERN , true );
797+ additionalProperties .put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
802798
803799 Map <String , String > generatorPropertyDefaults = new HashMap <>();
804800 generatorPropertyDefaults .put (CodegenConstants .MODELS , "false" );
@@ -824,8 +820,8 @@ public void givenNonRequiredMultipartFileArray_whenGenerateDelegateAndService_th
824820 @ Test
825821 public void givenMultipartBinaryArray_whenGenerateDelegateAndService_correctMultipartFileIsCreated () throws IOException {
826822 Map <String , Object > additionalProperties = new HashMap <>();
827- additionalProperties .put (DELEGATE_PATTERN , true );
828- additionalProperties .put (SERVICE_IMPLEMENTATION , true );
823+ additionalProperties .put (KotlinSpringServerCodegen . DELEGATE_PATTERN , true );
824+ additionalProperties .put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
829825
830826 Map <String , String > generatorPropertyDefaults = new HashMap <>();
831827 generatorPropertyDefaults .put (CodegenConstants .MODELS , "false" );
@@ -864,9 +860,9 @@ public void givenMultipartBinaryArray_whenGenerateDelegateAndService_correctMult
864860 @ Test
865861 public void givenMultipartBinaryArray_whenGenerateReactiveDelegateAndService_correctPartIsCreated () throws IOException {
866862 Map <String , Object > additionalProperties = new HashMap <>();
867- additionalProperties .put (DELEGATE_PATTERN , true );
868- additionalProperties .put (SERVICE_IMPLEMENTATION , true );
869- additionalProperties .put (REACTIVE , true );
863+ additionalProperties .put (KotlinSpringServerCodegen . DELEGATE_PATTERN , true );
864+ additionalProperties .put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
865+ additionalProperties .put (KotlinSpringServerCodegen . REACTIVE , true );
870866
871867 Map <String , String > generatorPropertyDefaults = new HashMap <>();
872868 generatorPropertyDefaults .put (CodegenConstants .MODELS , "false" );
@@ -1062,7 +1058,7 @@ public void reactiveWithoutFlow() throws Exception {
10621058 codegen .additionalProperties ().put (KotlinSpringServerCodegen .REACTIVE , true );
10631059 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_FLOW_FOR_ARRAY_RETURN_TYPE , false );
10641060 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_TAGS , true );
1065- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
1061+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
10661062 codegen .additionalProperties ().put (KotlinSpringServerCodegen .DELEGATE_PATTERN , true );
10671063
10681064 List <File > files = new DefaultGenerator ()
@@ -1107,7 +1103,7 @@ public void reactiveWithFlow() throws Exception {
11071103 codegen .additionalProperties ().put (KotlinSpringServerCodegen .REACTIVE , true );
11081104 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_FLOW_FOR_ARRAY_RETURN_TYPE , true );
11091105 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_TAGS , true );
1110- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
1106+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
11111107 codegen .additionalProperties ().put (KotlinSpringServerCodegen .DELEGATE_PATTERN , true );
11121108
11131109 List <File > files = new DefaultGenerator ()
@@ -1153,7 +1149,7 @@ public void reactiveWithDefaultValueFlow() throws Exception {
11531149 // should use default 'true' instead
11541150 // codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_FLOW_FOR_ARRAY_RETURN_TYPE, true);
11551151 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_TAGS , true );
1156- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
1152+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
11571153 codegen .additionalProperties ().put (KotlinSpringServerCodegen .DELEGATE_PATTERN , true );
11581154
11591155 List <File > files = new DefaultGenerator ()
@@ -1198,7 +1194,7 @@ public void nonReactiveWithoutFlow() throws Exception {
11981194 codegen .additionalProperties ().put (KotlinSpringServerCodegen .REACTIVE , false );
11991195 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_FLOW_FOR_ARRAY_RETURN_TYPE , false );
12001196 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_TAGS , true );
1201- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
1197+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
12021198 codegen .additionalProperties ().put (KotlinSpringServerCodegen .DELEGATE_PATTERN , true );
12031199
12041200 List <File > files = new DefaultGenerator ()
@@ -1243,7 +1239,7 @@ public void nonReactiveWithFlow() throws Exception {
12431239 codegen .additionalProperties ().put (KotlinSpringServerCodegen .REACTIVE , false );
12441240 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_FLOW_FOR_ARRAY_RETURN_TYPE , true );
12451241 codegen .additionalProperties ().put (KotlinSpringServerCodegen .USE_TAGS , true );
1246- codegen .additionalProperties ().put (SERVICE_IMPLEMENTATION , true );
1242+ codegen .additionalProperties ().put (KotlinSpringServerCodegen . SERVICE_IMPLEMENTATION , true );
12471243 codegen .additionalProperties ().put (KotlinSpringServerCodegen .DELEGATE_PATTERN , true );
12481244
12491245 List <File > files = new DefaultGenerator ()
@@ -1371,7 +1367,7 @@ private Map<String, File> generateFromContract(
13711367 .setAdditionalProperties (additionalProperties )
13721368 .setValidateSpec (false )
13731369 .setInputSpec (url )
1374- .setLibrary (SPRING_BOOT )
1370+ .setLibrary (KotlinSpringServerCodegen . SPRING_BOOT )
13751371 .setOutputDir (output .getAbsolutePath ());
13761372
13771373 consumer .accept (configurator );
0 commit comments