Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package contracts
- org.springframework.cloud.contract.spec.Contract.make {
- request {
- method 'GET'
- url '/gls/v1/global-lookups?catalog=amenities'
- body("")
- }
- response {
- status 200
- body(""
- )
- headers {
- contentType(applicationJsonUtf8())
- }
- }
- }
- package org.springframework.cloud.contract.verifier.tests;
- public class ContractVerifierTest {
- @Test
- public void validate_shouldGetAmenities() throws Exception {
- // given:
- MockMvcRequestSpecification request = given()
- .body("""");
- // when:
- ResponseOptions response = given().spec(request)
- .get("/gls/v1/global-lookups?catalog=amenities");
- // then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json;charset=UTF-8.*");
- // and:
- String responseBody = response.getBody().asString();
- assertThat(responseBody).isEqualTo("");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement