|
28 | 28 | import java.util.HashMap; |
29 | 29 | import java.util.List; |
30 | 30 | import java.util.Map; |
| 31 | +import java.util.logging.Logger; |
31 | 32 |
|
32 | 33 | import org.apache.servicecomb.foundation.common.utils.ReflectUtils; |
33 | 34 | import org.apache.servicecomb.swagger.SwaggerUtils; |
|
52 | 53 |
|
53 | 54 | @SuppressWarnings("rawtypes") |
54 | 55 | public class TestSwaggerUtils { |
| 56 | + Logger LOGGER = Logger.getLogger(TestSwaggerUtils.class.getName()); |
55 | 57 |
|
56 | 58 | @Test |
57 | 59 | public void testSchemaMethod() { |
@@ -146,7 +148,7 @@ private void testAllType(Class clazz1, Class clazz2) { |
146 | 148 | testExcep(value.getGenericType(), field.getGenericType()); |
147 | 149 | fail("IllegalArgumentException expected"); |
148 | 150 | } catch (IllegalArgumentException e) { |
149 | | - System.out.println(value.getGenericType()+ " " + field.getGenericType() + " " +e.getMessage()); |
| 151 | + LOGGER.warning(value.getGenericType() + " " + field.getGenericType() + " " + e.getMessage()); |
150 | 152 | MatcherAssert.assertThat(e.getMessage(), containsString("duplicate param model:")); |
151 | 153 | } |
152 | 154 | } |
@@ -183,13 +185,11 @@ public void test_resolve_type_schemas_correct() { |
183 | 185 | Assertions.assertEquals("object", schema.getType()); |
184 | 186 |
|
185 | 187 | openAPI = new OpenAPI(); |
186 | | - schema = SwaggerUtils.resolveTypeSchemas(openAPI, TestTypeClass.class); |
187 | | - schema = SwaggerUtils.getSchema(openAPI, schema); // resolve reference |
| 188 | + schema = SwaggerUtils.getSchema(openAPI, SwaggerUtils.resolveTypeSchemas(openAPI, TestTypeClass.class)); // resolve reference |
188 | 189 | Assertions.assertEquals("object", schema.getType()); |
189 | 190 |
|
190 | 191 | openAPI = new OpenAPI(); |
191 | | - schema = SwaggerUtils.resolveTypeSchemas(openAPI, TestTypeRecord.class); |
192 | | - schema = SwaggerUtils.getSchema(openAPI, schema); // resolve reference |
| 192 | + schema = SwaggerUtils.getSchema(openAPI, SwaggerUtils.resolveTypeSchemas(openAPI, TestTypeRecord.class)); // resolve reference |
193 | 193 | Assertions.assertEquals("object", schema.getType()); |
194 | 194 | } |
195 | 195 | } |
0 commit comments