@Test public void getSingletons() { Set<Object> results = q2TRestApp.getSingletons(); assertThat(results).hasSize(2); }
@Override public Set<Object> getSingletons() { Config config = serviceLocator.getServices().stream() .filter(Config.class::isInstance) .map(Config.class::cast) .findAny() .get(); TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.create(); TransactionManager transactionManager = transactionManagerFactory.create(config); TransactionResource transactionResource = new TransactionResource(transactionManager); RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager); return Set.of(transactionResource, rawTransactionResource); }
Q2TRestApp extends TesseraRestApplication { @Override public Set<Object> getSingletons() { Config config = serviceLocator.getServices().stream() .filter(Config.class::isInstance) .map(Config.class::cast) .findAny() .get(); TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.create(); TransactionManager transactionManager = transactionManagerFactory.create(config); TransactionResource transactionResource = new TransactionResource(transactionManager); RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager); return Set.of(transactionResource, rawTransactionResource); } }
Q2TRestApp extends TesseraRestApplication { @Override public Set<Object> getSingletons() { Config config = serviceLocator.getServices().stream() .filter(Config.class::isInstance) .map(Config.class::cast) .findAny() .get(); TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.create(); TransactionManager transactionManager = transactionManagerFactory.create(config); TransactionResource transactionResource = new TransactionResource(transactionManager); RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager); return Set.of(transactionResource, rawTransactionResource); } Q2TRestApp();  Q2TRestApp(ServiceLocator serviceLocator); }
Q2TRestApp extends TesseraRestApplication { @Override public Set<Object> getSingletons() { Config config = serviceLocator.getServices().stream() .filter(Config.class::isInstance) .map(Config.class::cast) .findAny() .get(); TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.create(); TransactionManager transactionManager = transactionManagerFactory.create(config); TransactionResource transactionResource = new TransactionResource(transactionManager); RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager); return Set.of(transactionResource, rawTransactionResource); } Q2TRestApp();  Q2TRestApp(ServiceLocator serviceLocator); @Override Set<Object> getSingletons(); @Override AppType getAppType(); }
Q2TRestApp extends TesseraRestApplication { @Override public Set<Object> getSingletons() { Config config = serviceLocator.getServices().stream() .filter(Config.class::isInstance) .map(Config.class::cast) .findAny() .get(); TransactionManagerFactory transactionManagerFactory = TransactionManagerFactory.create(); TransactionManager transactionManager = transactionManagerFactory.create(config); TransactionResource transactionResource = new TransactionResource(transactionManager); RawTransactionResource rawTransactionResource = new RawTransactionResource(transactionManager); return Set.of(transactionResource, rawTransactionResource); } Q2TRestApp();  Q2TRestApp(ServiceLocator serviceLocator); @Override Set<Object> getSingletons(); @Override AppType getAppType();  }