use of org.apache.isis.applib.services.queryresultscache.QueryResultsCache 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.apache.isis.applib.services.queryresultscache.QueryResultsCache in project estatio by estatio.
the class PaymentBatch_Test method setUp.
@Before
public void setUp() throws Exception {
paymentBatch = new PaymentBatch() {
@Override
public String getId() {
// say
return "97834";
}
};
paymentBatch.setCreatedOn(new DateTime(2017, 7, 14, 15, 50));
paymentBatch.setApprovalState(PaymentBatchApprovalState.NEW);
paymentBatch.serviceRegistry2 = mockServiceRegistry2;
paymentBatch.queryResultsCache = new QueryResultsCache() {
@Override
public <T> T execute(final Callable<T> callable, final Class<?> callingClass, final String methodName, final Object... keys) {
try {
return callable.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
};
this.seller1 = newOrganisation("ACME", "/FRA");
this.seller2 = newOrganisation("YOUKEA", "/FRA");
this.seller1BankAccount = newBankAccount("NL42RBOS0601349900", "INGBFRPP", seller1);
this.seller2BankAccount = newBankAccount("NL46RABO0370675415", "BSPFFRPPXXX", seller2);
}
Aggregations