use of org.incode.module.unittestsupport.dom.repo.FinderInteraction 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;
}
};
}
use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.
the class AgreementRoleTypeRepository_Test method setup.
@Before
public void setup() {
agreementType = new AgreementType();
agreementRoleTypeRepository = new AgreementRoleTypeRepository() {
@Override
protected <T> T firstMatch(Query<T> query) {
finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
return null;
}
@Override
protected List<AgreementRoleType> 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;
}
};
QueryResultsCache.Control control = new QueryResultsCache.Control();
control.on(new FixturesInstallingEvent(new FixtureScriptsDefault()));
final QueryResultsCache queryResultsCache = new QueryResultsCache() {
{
control = new Control();
}
};
agreementRoleTypeRepository.queryResultsCache = queryResultsCache;
}
use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.
the class TaxRateRepository_Test method setup.
@Before
public void setup() {
tax = new Tax();
date = new LocalDate(2013, 4, 1);
taxRateRepository = new TaxRateRepository() {
@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;
}
};
}
use of org.incode.module.unittestsupport.dom.repo.FinderInteraction in project estatio by estatio.
the class NumeratorRepository_Test method setup.
@Before
public void setup() {
propertyBookmark = new Bookmark("PROP", "123");
applicationTenancy = new ApplicationTenancy();
applicationTenancy.setPath("/");
context.checking(new Expectations() {
{
allowing(mockBookmarkService).bookmarkFor(mockProperty);
will(returnValue(propertyBookmark));
}
});
numeratorRepository = new NumeratorRepository() {
@Override
protected <T> T firstMatch(Query<T> query) {
finderInteraction = new FinderInteraction(query, FinderMethod.FIRST_MATCH);
return null;
}
@Override
protected List<Numerator> 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;
}
};
numeratorRepository.bookmarkService = mockBookmarkService;
}
use of org.incode.module.unittestsupport.dom.repo.FinderInteraction 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();
}
Aggregations