@@ -34,6 +34,8 @@ class JsonServiceTest {
3434
3535 private lateinit var proc: Process
3636
37+
38+
3739 @BeforeAll
3840 fun boot () {
3941 proc = startService(" netty" , port, closeGracePeriodMillis, closeTimeoutMillis, requestBodyLimit, projectDir)
@@ -65,7 +67,6 @@ class JsonServiceTest {
6567
6668 @Test
6769 fun `checks http-label` () {
68- val json = Json { }
6970 val response = sendRequest(
7071 " $baseUrl /http-label/labelValue" ,
7172 " GET" ,
@@ -77,7 +78,7 @@ class JsonServiceTest {
7778 assertIs<HttpResponse <String >>(response)
7879
7980 assertEquals(200 , response.statusCode(), " Expected 200" )
80- val body = json .decodeFromString(
81+ val body = Json .decodeFromString(
8182 HttpLabelTestOutputResponse .serializer(),
8283 response.body(),
8384 )
@@ -86,7 +87,6 @@ class JsonServiceTest {
8687
8788 @Test
8889 fun `checks http-query` () {
89- val json = Json { }
9090 val response = sendRequest(
9191 " $baseUrl /http-query?query=123&qqq=kotlin" ,
9292 " DELETE" ,
@@ -98,7 +98,7 @@ class JsonServiceTest {
9898 assertIs<HttpResponse <String >>(response)
9999
100100 assertEquals(200 , response.statusCode(), " Expected 200" )
101- val body = json .decodeFromString(
101+ val body = Json .decodeFromString(
102102 HttpQueryTestOutputResponse .serializer(),
103103 response.body(),
104104 )
@@ -123,9 +123,7 @@ class JsonServiceTest {
123123
124124 @Test
125125 fun `checks http-payload structure` () {
126- val json = Json { }
127-
128- val requestJson = json.encodeToJsonElement(
126+ val requestJson = Json .encodeToJsonElement(
129127 HttpStructurePayloadTestStructure .serializer(),
130128 HttpStructurePayloadTestStructure (
131129 " content" ,
@@ -144,7 +142,7 @@ class JsonServiceTest {
144142 )
145143 assertIs<HttpResponse <String >>(response)
146144 assertEquals(201 , response.statusCode(), " Expected 201" )
147- val body = json .decodeFromString(
145+ val body = Json .decodeFromString(
148146 HttpStructurePayloadTestStructure .serializer(),
149147 response.body(),
150148 )
@@ -155,9 +153,7 @@ class JsonServiceTest {
155153
156154 @Test
157155 fun `checks timestamp` () {
158- val json = Json { }
159-
160- val requestJson = json.encodeToJsonElement(
156+ val requestJson = Json .encodeToJsonElement(
161157 TimestampTestRequestResponse .serializer(),
162158 TimestampTestRequestResponse (
163159 1515531081.123 ,
@@ -177,7 +173,7 @@ class JsonServiceTest {
177173 )
178174 assertIs<HttpResponse <String >>(response)
179175 assertEquals(201 , response.statusCode(), " Expected 201" )
180- val body = json .decodeFromString(
176+ val body = Json .decodeFromString(
181177 TimestampTestRequestResponse .serializer(),
182178 response.body(),
183179 )
@@ -189,9 +185,7 @@ class JsonServiceTest {
189185
190186 @Test
191187 fun `checks json name` () {
192- val json = Json { }
193-
194- val requestJson = json.encodeToJsonElement(
188+ val requestJson = Json .encodeToJsonElement(
195189 JsonNameTestRequest .serializer(),
196190 JsonNameTestRequest (" Hello Kotlin Team" ),
197191 )
@@ -206,7 +200,7 @@ class JsonServiceTest {
206200 )
207201 assertIs<HttpResponse <String >>(response)
208202 assertEquals(201 , response.statusCode(), " Expected 201" )
209- val body = json .decodeFromString(
203+ val body = Json .decodeFromString(
210204 JsonNameTestResponse .serializer(),
211205 response.body(),
212206 )
0 commit comments