Search in sources :

Example 11 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class TaxRateMenu_Test method setup.

@Before
public void setup() {
    tax = new Tax();
    date = new LocalDate(2013, 4, 1);
    taxRateMenu = new TaxRateMenu() {

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

        @Override
        protected List<TaxRate> 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 : Tax(org.estatio.module.tax.dom.Tax) List(java.util.List) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Example 12 with FinderInteraction

use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.

the class IndexValueRepository_Test method setup.

@Before
public void setup() {
    index = new Index();
    startDate = new LocalDate(2013, 4, 1);
    indexValueRepository = new IndexValueRepository() {

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

        @Override
        protected List<IndexValue> 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;
        }
    };
    indexValueRepository.queryResultsCache = mockQueryResultsCache;
}
Also used : List(java.util.List) LocalDate(org.joda.time.LocalDate) FinderInteraction(org.incode.module.unittestsupport.dom.repo.FinderInteraction) Before(org.junit.Before)

Aggregations

List (java.util.List)12 FinderInteraction (org.incode.module.unittestsupport.dom.repo.FinderInteraction)12 Before (org.junit.Before)12 LocalDate (org.joda.time.LocalDate)7 Property (org.estatio.module.asset.dom.Property)4 PartyForTesting (org.estatio.module.party.dom.PartyForTesting)4 AgreementType (org.estatio.module.agreement.dom.type.AgreementType)2 InvoiceRepository (org.estatio.module.invoice.dom.InvoiceRepository)2 Lease (org.estatio.module.lease.dom.Lease)2 FixturesInstallingEvent (org.apache.isis.applib.events.system.FixturesInstallingEvent)1 Bookmark (org.apache.isis.applib.services.bookmark.Bookmark)1 ClockService (org.apache.isis.applib.services.clock.ClockService)1 FixtureScriptsDefault (org.apache.isis.applib.services.fixturespec.FixtureScriptsDefault)1 QueryResultsCache (org.apache.isis.applib.services.queryresultscache.QueryResultsCache)1 AgreementRoleType (org.estatio.module.agreement.dom.role.AgreementRoleType)1 EstatioApplicationTenancyRepositoryForProperty (org.estatio.module.asset.dom.EstatioApplicationTenancyRepositoryForProperty)1 FixedAssetForTesting (org.estatio.module.asset.dom.FixedAssetForTesting)1 PropertyRepository (org.estatio.module.asset.dom.PropertyRepository)1 Unit (org.estatio.module.asset.dom.Unit)1 FixedAssetRoleRepository (org.estatio.module.asset.dom.role.FixedAssetRoleRepository)1