use of org.springframework.cloud.contract.spec.internal.Cookies in project spring-cloud-contract by spring-cloud.
the class CookieElementProcessor method processCookies.
default void processCookies(SingleContractMetadata metadata) {
Response response = metadata.getContract().getResponse();
Cookies cookies = response.getCookies();
Iterator<Cookie> iterator = cookies.getEntries().iterator();
while (iterator.hasNext()) {
Cookie cookie = iterator.next();
String text = processCookieElement(cookie.getKey(), cookie.getServerValue() instanceof NotToEscapePattern ? cookie.getServerValue() : MapConverter.getTestSideValues(cookie.getServerValue()));
if (iterator.hasNext()) {
blockBuilder().addLine(text).addEndingIfNotPresent();
} else {
blockBuilder().addIndented(text).addEndingIfNotPresent();
}
}
}
Aggregations