-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed multiple contract files, checkstyle config, and other small things
- Loading branch information
Showing
9 changed files
with
288 additions
and
292 deletions.
There are no files selected for viewing
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
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
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
92 changes: 46 additions & 46 deletions
92
src/test/resources/contracts/tripmanagement/query/ShouldGetAllTrips.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
package tripmanagement.query | ||
|
||
import org.springframework.cloud.contract.spec.* | ||
|
||
Contract.make { | ||
description("When a Get request for all the trips should get all the trips") | ||
request { | ||
method 'GET' | ||
url '/api/v1/trips' | ||
} | ||
response { | ||
status 200 | ||
body(""" | ||
[ | ||
{ | ||
"id": "f849769e-2534-84a6-d475-5c2d701343ab", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "STARTED" | ||
}, | ||
{ | ||
"id": "5b842415-9447-4b9b-85c6-2e1075214cc4", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "CREATED" | ||
}, | ||
{ | ||
"id": "7a7d1e99-4823-4aa5-9d3b-2307e88cee0d", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "COMPLETED" | ||
}, | ||
{ | ||
"id": "7a7d1e99-4823-4aa5-9d3b-2307e88cee08", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "CANCELED" | ||
} | ||
] | ||
""" | ||
) | ||
headers { | ||
contentType(applicationJson()) | ||
[ | ||
Contract.make { | ||
description("When a Get request for all the trips should get all the trips") | ||
request { | ||
method 'GET' | ||
url '/api/v1/trips' | ||
} | ||
response { | ||
status 200 | ||
body(""" | ||
[ | ||
{ | ||
"id": "f849769e-2534-84a6-d475-5c2d701343ab", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "STARTED" | ||
}, | ||
{ | ||
"id": "5b842415-9447-4b9b-85c6-2e1075214cc4", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "CREATED" | ||
}, | ||
{ | ||
"id": "7a7d1e99-4823-4aa5-9d3b-2307e88cee0d", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "COMPLETED" | ||
}, | ||
{ | ||
"id": "7a7d1e99-4823-4aa5-9d3b-2307e88cee08", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "CANCELED" | ||
} | ||
] | ||
""" | ||
) | ||
headers { | ||
contentType(applicationJson()) | ||
} | ||
} | ||
} | ||
} | ||
|
||
] |
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
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
40 changes: 20 additions & 20 deletions
40
src/test/resources/contracts/tripmanagement/query/ShouldGetTrip.groovy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package tripmanagement.query | ||
|
||
import org.springframework.cloud.contract.spec.* | ||
|
||
Contract.make { | ||
description("When a Get request with a TripId is made, the corresponding trip is returned") | ||
request { | ||
method 'GET' | ||
url '/api/v1/trip/f849769e-2534-84a6-d475-5c2d701343ab' | ||
} | ||
response { | ||
status 200 | ||
body( | ||
"id": "f849769e-2534-84a6-d475-5c2d701343ab", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "STARTED" | ||
) | ||
headers { | ||
contentType(applicationJson()) | ||
[ | ||
Contract.make { | ||
description("When a Get request with a TripId is made, the corresponding trip is returned") | ||
request { | ||
method 'GET' | ||
url '/api/v1/trip/f849769e-2534-84a6-d475-5c2d701343ab' | ||
} | ||
response { | ||
status 200 | ||
body( | ||
"id": "f849769e-2534-84a6-d475-5c2d701343ab", | ||
"userId": "123e4567-e89b-12d3-a456-426655440000", | ||
"originAddress": "from some place over there", | ||
"destinationAddress": "to this other place", | ||
"status": "STARTED" | ||
) | ||
headers { | ||
contentType(applicationJson()) | ||
} | ||
} | ||
} | ||
} | ||
|
||
] |
Oops, something went wrong.