Search in sources :

Example 1 with PartyForTesting

use of org.estatio.module.party.dom.PartyForTesting in project estatio by estatio.

the class FixedAssetRoleRepository_Test method setup.

@Before
public void setup() {
    asset = new FixedAssetForTesting();
    party = new PartyForTesting();
    type = FixedAssetRoleTypeEnum.ASSET_MANAGER;
    startDate = new LocalDate(2013, 1, 4);
    endDate = new LocalDate(2013, 2, 5);
    fixedAssetRoleRepository = new FixedAssetRoleRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<FixedAssetRole> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
}
Also used : List(java.util.List) FixedAssetRoleRepository(org.estatio.module.asset.dom.role.FixedAssetRoleRepository) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 2 with PartyForTesting

use of org.estatio.module.party.dom.PartyForTesting in project estatio by estatio.

the class InvoiceRepository_Test method setup.

@Before
public void setup() {
    seller = new PartyForTesting();
    buyer = new PartyForTesting();
    paymentMethod = PaymentMethod.BANK_TRANSFER;
    lease = new Lease() {

        @Override
        public Property getProperty() {
            return null;
        }
    };
    invoiceStatus = InvoiceStatus.APPROVED;
    dueDate = new LocalDate(2013, 4, 1);
    invoiceRepository = new InvoiceRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Invoice> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    invoiceForLeaseRepository = new InvoiceForLeaseRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<InvoiceForLease> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    estatioNumeratorRepository = new NumeratorForCollectionRepository();
}
Also used : Lease(org.estatio.module.lease.dom.Lease) InvoiceRepository(org.estatio.module.invoice.dom.InvoiceRepository) List(java.util.List) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) Property(org.estatio.module.asset.dom.Property) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 3 with PartyForTesting

use of org.estatio.module.party.dom.PartyForTesting in project estatio by estatio.

the class NumeratorCollectionRepository_Test method setup.

@Before
public void setup() {
    seller = new PartyForTesting();
    buyer = new PartyForTesting();
    paymentMethod = PaymentMethod.BANK_TRANSFER;
    lease = new Lease() {

        @Override
        public Property getProperty() {
            return null;
        }
    };
    invoiceStatus = InvoiceStatus.APPROVED;
    dueDate = new LocalDate(2013, 4, 1);
    invoiceRepository = new InvoiceRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderInteraction.FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Invoice> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderInteraction.FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderInteraction.FinderMethod.ALL_MATCHES);
            return null;
        }
    };
    invoiceForLeaseRepository = new InvoiceForLeaseRepository() {
    };
    estatioNumeratorRepository = new NumeratorForCollectionRepository();
}
Also used : Lease(org.estatio.module.lease.dom.Lease) InvoiceRepository(org.estatio.module.invoice.dom.InvoiceRepository) List(java.util.List) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) Property(org.estatio.module.asset.dom.Property) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 4 with PartyForTesting

use of org.estatio.module.party.dom.PartyForTesting in project estatio by estatio.

the class AgreementRepository_Test method setup.

@Before
public void setup() {
    agreementType = new AgreementType();
    agreementRoleType = new AgreementRoleType();
    party = new PartyForTesting();
    agreementRepository = new AgreementRepository() {

        @Override
        protected <T> T firstMatch(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
            return null;
        }

        @Override
        protected List<Agreement> allInstances() {
            finderInteraction = new FinderInteraction(null, FinderMethod.ALL_INSTANCES);
            return null;
        }

        @Override
        protected <T> List<T> allMatches(Query<T> query) {
            finderInteraction = new FinderInteraction(query, FinderMethod.ALL_MATCHES);
            return null;
        }
    };
}
Also used : AgreementType(org.estatio.module.agreement.dom.type.AgreementType) AgreementRoleType(org.estatio.module.agreement.dom.role.AgreementRoleType) List(java.util.List) PartyForTesting(org.estatio.module.party.dom.PartyForTesting) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Aggregations

List (java.util.List)4 PartyForTesting (org.estatio.module.party.dom.PartyForTesting)4 FinderInteraction (org.incode.module.unittestsupport.dom.repo.FinderInteraction)4 Before (org.junit.Before)4 LocalDate (org.joda.time.LocalDate)3 Property (org.estatio.module.asset.dom.Property)2 InvoiceRepository (org.estatio.module.invoice.dom.InvoiceRepository)2 Lease (org.estatio.module.lease.dom.Lease)2 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 AgreementType (org.estatio.module.agreement.dom.type.AgreementType)1 FixedAssetRoleRepository (org.estatio.module.asset.dom.role.FixedAssetRoleRepository)1