Updated docs with a fast intro
This commit is contained in:
@@ -43,10 +43,12 @@ public class LoanApplicationService {
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
httpHeaders.add(HttpHeaders.CONTENT_TYPE, FRAUD_SERVICE_JSON_VERSION_1);
|
||||
|
||||
// tag::client_call_server[]
|
||||
ResponseEntity<FraudServiceResponse> response =
|
||||
restTemplate.exchange("http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
|
||||
new HttpEntity<>(request, httpHeaders),
|
||||
FraudServiceResponse.class);
|
||||
// end::client_call_server[]
|
||||
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class LoanApplicationServiceSpec extends Specification {
|
||||
loanApplication.rejectionReason == null
|
||||
}
|
||||
|
||||
// tag::client_tdd[]
|
||||
def 'should be rejected due to abnormal loan amount'() {
|
||||
given:
|
||||
LoanApplication application =
|
||||
@@ -40,5 +41,6 @@ class LoanApplicationServiceSpec extends Specification {
|
||||
loanApplication.loanApplicationStatus == LoanApplicationStatus.LOAN_APPLICATION_REJECTED
|
||||
loanApplication.rejectionReason == 'Amount too high'
|
||||
}
|
||||
// end::client_tdd[]
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user