Package org.apache.isis.example.application.claims.dom.claim

Examples of org.apache.isis.example.application.claims.dom.claim.Claim$ClaimStatus$ChoicesSpecification


@Fixtures({ @Fixture(ClaimsFixture.class) })
public class ClaimSubmitTest extends AbstractTest {

    @Test
    public void cannotSubmitTwice() throws Exception {
        final Claim tomsSubmittedClaim = tomsSubmittedClaim();
        try {
            final Approver approver = tomEmployee.getDefaultApprover();
            tomsSubmittedClaim.submit(approver);
            fail("Should not be able to submit again");
        } catch (final DisabledException e) {
            assertThat(e.getMessage(), Matchers.containsString("Claim has already been submitted"));
        }
    }
View Full Code Here


        }
    }

    private Claim tomsSubmittedClaim() {
        final List<Claim> tomsClaims = claimRepository.claimsFor(tomEmployee);
        final Claim tomsClaim1 = tomsClaims.get(0);
        tomsClaim1.submit(tomEmployee.getDefaultApprover());
        assertThat(tomsClaim1.getStatus(), is("Submitted"));
        return wrapped(tomsClaim1);
    }
View Full Code Here

@Fixtures({ @Fixture(ClaimsFixture.class) })
public class NewClaimTest extends AbstractTest {

    @Test
    public void whenCreateNewClaimDefaultsOk() throws Exception {
        final Claim newClaim = claimRepository.newClaim(tomEmployee);
        assertThat(newClaim.getDescription(), is("enter a description here"));
        assertThat(newClaim.getStatus(), is("New"));
        assertThat(newClaim.getApprover(), is(tomEmployee.getDefaultApprover()));
        assertThat(newClaim.getItems().size(), is(0));
    }
View Full Code Here

    public void install() {
        final Employee fred = createEmployee("Fred Smith", null);
        final Employee tom = createEmployee("Tom Brown", fred);
        createEmployee("Sam Jones", fred);

        Claim claim = createClaim(tom, -16, "Meeting with client");
        addItem(claim, -16, 38.50, "Lunch with client");
        addItem(claim, -16, 16.50, "Euston - Mayfair (return)");

        claim = createClaim(tom, -18, "Meeting in city office");
        addItem(claim, -16, 18.00, "Car parking");
View Full Code Here

        persist(claimant);
        return claimant;
    }

    private Claim createClaim(final Employee claimant, final int days, final String description) {
        final Claim claim = newTransientInstance(Claim.class);
        claim.setClaimant(claimant);
        claim.setDescription(description);
        Date date = new Date();
        date = date.add(0, 0, days);
        claim.setDate(date);
        persist(claim);
        return claim;
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.example.application.claims.dom.claim.Claim$ClaimStatus$ChoicesSpecification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.