@Test public void test() { Beacon processedBeacon = processor.process(Beacon.of(ImmutableMap.of("key1", "value1"))); Assertions.assertThat(processedBeacon.get("key1")).isEqualTo("value2"); Assertions.assertThat(processedBeacon.get("key2")).isEqualTo("value2"); }
@Override public Beacon process(Beacon beacon) { for (BeaconProcessor beaconProcessor : processorList) { try { beacon = beacon.merge(beaconProcessor.process(beacon)); } catch (Exception e) { log.error("BeaconProcessor <{}> encountered an Exception! Ignoring the processor!", beaconProcessor.getClass().getName(), e); } } return beacon; }
CompositeBeaconProcessor implements BeaconProcessor { @Override public Beacon process(Beacon beacon) { for (BeaconProcessor beaconProcessor : processorList) { try { beacon = beacon.merge(beaconProcessor.process(beacon)); } catch (Exception e) { log.error("BeaconProcessor <{}> encountered an Exception! Ignoring the processor!", beaconProcessor.getClass().getName(), e); } } return beacon; } }
CompositeBeaconProcessor implements BeaconProcessor { @Override public Beacon process(Beacon beacon) { for (BeaconProcessor beaconProcessor : processorList) { try { beacon = beacon.merge(beaconProcessor.process(beacon)); } catch (Exception e) { log.error("BeaconProcessor <{}> encountered an Exception! Ignoring the processor!", beaconProcessor.getClass().getName(), e); } } return beacon; }  }
CompositeBeaconProcessor implements BeaconProcessor { @Override public Beacon process(Beacon beacon) { for (BeaconProcessor beaconProcessor : processorList) { try { beacon = beacon.merge(beaconProcessor.process(beacon)); } catch (Exception e) { log.error("BeaconProcessor <{}> encountered an Exception! Ignoring the processor!", beaconProcessor.getClass().getName(), e); } } return beacon; }  @Override Beacon process(Beacon beacon); }
CompositeBeaconProcessor implements BeaconProcessor { @Override public Beacon process(Beacon beacon) { for (BeaconProcessor beaconProcessor : processorList) { try { beacon = beacon.merge(beaconProcessor.process(beacon)); } catch (Exception e) { log.error("BeaconProcessor <{}> encountered an Exception! Ignoring the processor!", beaconProcessor.getClass().getName(), e); } } return beacon; }  @Override Beacon process(Beacon beacon);  }