Skip to content

Instantly share code, notes, and snippets.

@burcuakkayaa
Created December 8, 2023 13:45
Show Gist options
  • Save burcuakkayaa/5208175fefe38e2956d9ed4d260fead0 to your computer and use it in GitHub Desktop.
Save burcuakkayaa/5208175fefe38e2956d9ed4d260fead0 to your computer and use it in GitHub Desktop.
package api
import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.client.WireMock.*
import com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig
import com.github.tomakehurst.wiremock.junit.WireMockRule
import kotlinx.serialization.builtins.serializer
import org.testng.annotations.Test
class WireMockIntegration {
var wireMockRule = WireMockRule(8089)
@Test
fun exampleTest() {
wireMockRule.start()
stubFor(
post("/my/resource")
.withHeader("Content-Type", containing("xml"))
.willReturn(
ok()
.withHeader("Content-Type", "text/xml")
.withBody("<response>SUCCESS</response>")
)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment