Remove charset from pact sample contract media type. Switch to explicitly

returning charset media type for other samples.
This commit is contained in:
Olga Maciaszek-Sharma
2019-05-29 20:50:34 +02:00
parent bd29f8193f
commit e0fc7aeca8
8 changed files with 14 additions and 10 deletions

View File

@@ -16,6 +16,7 @@
package com.example.fraud;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
@@ -40,7 +41,7 @@ class FraudNameController {
this.fraudVerifier = fraudVerifier;
}
@PutMapping(value = "/frauds/name")
@PutMapping(value = "/frauds/name", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public NameResponse checkByName(@RequestBody NameRequest request) {
boolean fraud = this.fraudVerifier.isFraudByName(request.getName());
if (fraud) {
@@ -50,7 +51,7 @@ class FraudNameController {
"Don't worry " + request.getName() + " you're not a fraud");
}
@GetMapping(value = "/frauds/name")
@GetMapping(value = "/frauds/name", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String checkByName(@CookieValue("name") String value,
@CookieValue("name2") String value2) {
return value + " " + value2;