@Test public void childrenHaveHorribleCredit() throws Exception { // Build the request message Applicant applicant = new Applicant(); applicant.setName("Peter Gibbons"); applicant.setAge(8); // Invoke the service service.operation("process").sendInOut(applicant); // validate the results Assert.assertEquals(160, applicant.getCreditScore()); }
@Test public void goodCredit() throws Exception { // Build the request message Applicant applicant = new Applicant(); applicant.setName("Bill Lumbergh"); applicant.setCreditScore(700); // Invoke the service service.operation("process").sendInOut(applicant); // validate the results Assert.assertTrue(applicant.isApproved()); }
@Test public void lowCredit() throws Exception { // Build the request message Applicant applicant = new Applicant(); applicant.setName("Peter Gibbons"); applicant.setCreditScore(400); // Invoke the service Applicant reply = service.operation("process").sendInOut(applicant).getContent(Applicant.class); // validate the results Assert.assertTrue(!reply.isApproved()); }
@Test public void adultsAreResponsible() throws Exception { // Build the request message Applicant request = new Applicant(); request.setName("Bill Lumbergh"); request.setAge(39); // Invoke the service Applicant reply = service.operation("process").sendInOut(request).getContent(Applicant.class); // validate the results Assert.assertNotSame(780, reply.getCreditScore()); }