Skip to content

Commit

Permalink
fixed APITests
Browse files Browse the repository at this point in the history
  • Loading branch information
nashjain committed Aug 12, 2024
1 parent f35393f commit a6690de
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
10 changes: 1 addition & 9 deletions src/test/kotlin/com/component/orders/ApiTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,18 @@ package com.component.orders

import com.fasterxml.jackson.databind.ObjectMapper
import io.specmatic.kafka.mock.KafkaMock
import io.specmatic.kafka.mock.model.Expectation
import io.specmatic.stub.ContractStub
import io.specmatic.stub.createStub
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterAll
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.client.TestRestTemplate
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.test.context.junit.jupiter.SpringExtension
import org.springframework.http.*
import java.io.File

//@ExtendWith(SpringExtension::class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
class ApiTests {
companion object {
Expand Down
21 changes: 21 additions & 0 deletions src/test/resources/stub_products_200.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"http-request": {
"method": "GET",
"path": "/products",
"query": {
"type": "gadget"
}
},
"http-response": {
"status": 200,
"body": [
{
"id": 1,
"name": "Iphone",
"inventory": 10,
"type": "gadget"
}
],
"status-text": "OK"
}
}

0 comments on commit a6690de

Please sign in to comment.