This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api.endpoints.products | |
class PostNewProductTests : ApiBaseTest() { | |
private var stubPostProduct: ThreadLocal<StubMapping>? = null | |
@BeforeMethod(alwaysRun = true) | |
fun beforeMethod() { | |
stubPostProduct = ThreadLocal<StubMapping>() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"request": { | |
"method": "POST", | |
"url": "/products" | |
}, | |
"response": { | |
"status": 201, | |
"body": "{\n \"id\": 31,\n \"title\": \"test product\",\n \"price\": 13.5,\n \"description\": \"lorem ipsum set\",\n \"image\": \"https://i.pravatar.cc\",\n \"category\": \"electronic\"\n}\n", | |
"headers": { | |
"Content-Type": "application/json; charset=UTF-8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api.endpoints.users | |
class PostNewUserTests : ApiBaseTest() { | |
private var stubPostUser: StubMapping? = null | |
@BeforeMethod(alwaysRun = true) | |
fun beforeMethod() { | |
stubPostUser = StubMapping() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api.endpoints.users | |
import api.ApiBaseTest | |
import api.controller.model.Sample | |
import api.core.services.mock.UsersMockApiController | |
import api.core.utilitys.SampleReaderUtils | |
import com.github.tomakehurst.wiremock.client.WireMock | |
import com.github.tomakehurst.wiremock.client.WireMock.* | |
import com.github.tomakehurst.wiremock.stubbing.StubMapping | |
import io.restassured.RestAssured.given |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api.core.services.mock | |
import com.github.tomakehurst.wiremock.client.WireMock | |
import com.github.tomakehurst.wiremock.stubbing.StubMapping | |
import java.util.* | |
class UsersMockApiController { | |
companion object { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import api.core.constant.Keywords.* | |
import api.core.utilitys.LogUtils.Companion.logInfo | |
import com.github.tomakehurst.wiremock.client.WireMock | |
import org.testng.annotations.BeforeSuite | |
import java.time.ZoneId | |
import java.util.* | |
open class ApiBaseTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
wiremock: | |
image: "holomekc/wiremock-gui:latest" | |
container_name: my_wiremock | |
ports: | |
# This is just an example of a port mapping | |
- "8089:8089" | |
- "8080:8080" | |
command: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
wiremock: | |
image: "wiremock/wiremock:3.3.1" | |
container_name: my_wiremock | |
ports: | |
- "8080:8080" | |
volumes: | |
- ./__files:/home/wiremock/__files | |
- ./mappings:/home/wiremock/mappings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.wiremock</groupId> | |
<artifactId>wiremock</artifactId> | |
<version>3.3.1</version> | |
</dependency> |
NewerOlder