|
27 | 27 | import org.openapitools.codegen.CodegenResponse;
|
28 | 28 | import org.openapitools.codegen.TestUtils;
|
29 | 29 | import org.openapitools.codegen.languages.JavaCXFClientCodegen;
|
| 30 | +import org.openapitools.codegen.languages.features.BeanValidationFeatures; |
| 31 | +import org.openapitools.codegen.languages.features.GzipTestFeatures; |
| 32 | +import org.openapitools.codegen.languages.features.LoggingTestFeatures; |
| 33 | +import org.openapitools.codegen.languages.features.UseGenericResponseFeatures; |
30 | 34 | import org.testng.Assert;
|
31 | 35 | import org.testng.annotations.Test;
|
32 | 36 |
|
@@ -118,4 +122,61 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception {
|
118 | 122 | Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.client.xyz.invoker");
|
119 | 123 | Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.client.xyz.invoker");
|
120 | 124 | }
|
| 125 | + |
| 126 | + @Test |
| 127 | + public void testUseBeanValidationAdditionalProperty() throws Exception { |
| 128 | + final JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); |
| 129 | + |
| 130 | + codegen.processOpts(); |
| 131 | + Assert.assertNull(codegen.additionalProperties().get(BeanValidationFeatures.USE_BEANVALIDATION)); |
| 132 | + Assert.assertFalse(codegen.isUseBeanValidation()); |
| 133 | + |
| 134 | + codegen.additionalProperties().put(BeanValidationFeatures.USE_BEANVALIDATION, true); |
| 135 | + codegen.processOpts(); |
| 136 | + Assert.assertEquals(codegen.additionalProperties().get(BeanValidationFeatures.USE_BEANVALIDATION), Boolean.TRUE); |
| 137 | + Assert.assertTrue(codegen.isUseBeanValidation()); |
| 138 | + } |
| 139 | + |
| 140 | + @Test |
| 141 | + public void testUseGenericResponseAdditionalProperty() throws Exception { |
| 142 | + final JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); |
| 143 | + |
| 144 | + codegen.processOpts(); |
| 145 | + Assert.assertNull(codegen.additionalProperties().get(UseGenericResponseFeatures.USE_GENERIC_RESPONSE)); |
| 146 | + Assert.assertFalse(codegen.isUseGenericResponse()); |
| 147 | + |
| 148 | + codegen.additionalProperties().put(UseGenericResponseFeatures.USE_GENERIC_RESPONSE, true); |
| 149 | + codegen.processOpts(); |
| 150 | + Assert.assertEquals(codegen.additionalProperties().get(UseGenericResponseFeatures.USE_GENERIC_RESPONSE), Boolean.TRUE); |
| 151 | + Assert.assertTrue(codegen.isUseGenericResponse()); |
| 152 | + } |
| 153 | + |
| 154 | + @Test |
| 155 | + public void testUseLoggingFeatureForTestsAdditionalProperty() throws Exception { |
| 156 | + final JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); |
| 157 | + |
| 158 | + codegen.processOpts(); |
| 159 | + Assert.assertNull(codegen.additionalProperties().get(LoggingTestFeatures.USE_LOGGING_FEATURE_FOR_TESTS)); |
| 160 | + Assert.assertFalse(codegen.isUseLoggingFeatureForTests()); |
| 161 | + |
| 162 | + codegen.additionalProperties().put(LoggingTestFeatures.USE_LOGGING_FEATURE_FOR_TESTS, true); |
| 163 | + codegen.processOpts(); |
| 164 | + Assert.assertEquals(codegen.additionalProperties().get(LoggingTestFeatures.USE_LOGGING_FEATURE_FOR_TESTS), Boolean.TRUE); |
| 165 | + Assert.assertTrue(codegen.isUseLoggingFeatureForTests()); |
| 166 | + } |
| 167 | + |
| 168 | + @Test |
| 169 | + public void testUseGzipFeatureForTestsAdditionalProperty() throws Exception { |
| 170 | + final JavaCXFClientCodegen codegen = new JavaCXFClientCodegen(); |
| 171 | + |
| 172 | + codegen.processOpts(); |
| 173 | + Assert.assertNull(codegen.additionalProperties().get(GzipTestFeatures.USE_GZIP_FEATURE_FOR_TESTS)); |
| 174 | + Assert.assertFalse(codegen.isUseLoggingFeatureForTests()); |
| 175 | + |
| 176 | + codegen.additionalProperties().put(GzipTestFeatures.USE_GZIP_FEATURE_FOR_TESTS, true); |
| 177 | + codegen.processOpts(); |
| 178 | + Assert.assertEquals(codegen.additionalProperties().get(GzipTestFeatures.USE_GZIP_FEATURE_FOR_TESTS), Boolean.TRUE); |
| 179 | + Assert.assertTrue(codegen.isUseGzipFeatureForTests()); |
| 180 | + } |
| 181 | + |
121 | 182 | }
|
0 commit comments