@Test public void testScan_singleEntryInRepository_assertSingleKey() { final Tx tx1 = TestUtils.makeMessage( TxMessageType.IMF, "12345", "", "*****@*****.**", "*****@*****.**", "", "", ""); final Tx tx2 = TestUtils.makeMessage( TxMessageType.IMF, "67890", "", "*****@*****.**", "*****@*****.**", "", "", ""); final Collection<Tx> txs = Arrays.asList(tx1, tx2); final Exchange exchange = new DefaultExchange(context); exchange.getIn().setBody(txs); final ConcurrentJPAAggregationRepository repo = new ConcurrentJPAAggregationRepository(notifDao); repo.add(context, "12345", exchange); repo.remove(context, "12345", exchange); final Set<String> ids = repo.scan(context); assertEquals(1, ids.size()); assertEquals(exchange.getExchangeId(), ids.iterator().next()); }