Updated docs with a fast intro

This commit is contained in:
Marcin Grzejszczak
2016-07-15 14:27:03 +02:00
parent bc22227fe3
commit a8a1bc1f2e
16 changed files with 253 additions and 106 deletions

View File

@@ -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();
}

View File

@@ -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[]
}