11/*
2- * Copyright 2019 the original authors
2+ * Copyright 2019-2020 the original authors
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ import com.github.hauner.openapi.spring.model.datatypes.CollectionDataType
2525import com.github.hauner.openapi.spring.model.datatypes.DataTypeConstraints
2626import com.github.hauner.openapi.spring.model.datatypes.DoubleDataType
2727import com.github.hauner.openapi.spring.model.datatypes.FloatDataType
28- import com.github.hauner.openapi.spring.model.datatypes.InlineObjectDataType
2928import com.github.hauner.openapi.spring.model.datatypes.IntegerDataType
3029import com.github.hauner.openapi.spring.model.datatypes.ListDataType
3130import com.github.hauner.openapi.spring.model.datatypes.LongDataType
@@ -87,8 +86,12 @@ class MethodWriterSpec extends Specification {
8786
8887 void " writes parameter less method with inline object response type" () {
8988 def endpoint = new Endpoint (path : ' /inline' , method : HttpMethod . GET , responses : [
90- new Response (contentType : ' application/json' ,
91- responseType : new InlineObjectDataType ())
89+ new Response (contentType : ' application/json' ,
90+ responseType : new ObjectDataType (
91+ type : ' GetInlineResponse' , properties : [
92+ foo1 : new StringDataType (),
93+ foo2 : new StringDataType ()
94+ ]))
9295 ])
9396
9497 when :
@@ -97,7 +100,7 @@ class MethodWriterSpec extends Specification {
97100 then :
98101 target. toString () == """ \
99102 @GetMapping(path = "${ endpoint.path} ", produces = {"${ endpoint.response.contentType} "})
100- ResponseEntity<Map<String, Object> > getInline();
103+ ResponseEntity<GetInlineResponse > getInline();
101104"""
102105 }
103106
0 commit comments