Fixed broken JaxRs cookie test

This commit is contained in:
Marcin Grzejszczak
2018-04-11 16:00:08 +02:00
parent 6ace68284c
commit 264757d114

View File

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import java.math.BigDecimal;
import static org.springframework.cloud.frauddetection.model.FraudCheckStatus.FRAUD;
@@ -31,6 +32,13 @@ public class FraudDetectionController {
return new FraudCheckResult(OK, NO_REASON);
}
@GET
@Path("/frauds/name")
public String cookie(@CookieParam("name") Cookie name,
@CookieParam("name2") Cookie name2) {
return name.getValue() + " " + name2.getValue();
}
private boolean amountGreaterThanThreshold(FraudCheck fraudCheck) {
return MAX_AMOUNT.compareTo(fraudCheck.getLoanAmount()) < 0;
}