@Test public void chargingStationOpeningTimesAddedEvent() { chargingStationRepository.createOrUpdate(getRegisteredAndConfiguredChargingStation()); eventHandler.handle(new ChargingStationOpeningTimesAddedEvent(CHARGING_STATION_ID, OPENING_TIMES, IDENTITY_CONTEXT)); ChargingStation chargingStation = getTestChargingStationFromRepository(); assertEquals(OPENING_TIMES.size(), chargingStation.getOpeningTimes().size()); OpeningTime[] cOT = OPENING_TIMES.toArray(new OpeningTime[OPENING_TIMES.size()]); io.motown.vas.viewmodel.persistence.entities.OpeningTime[] vOT = chargingStation.getOpeningTimes().toArray(new io.motown.vas.viewmodel.persistence.entities.OpeningTime[chargingStation.getOpeningTimes().size()]); assertEquals(cOT[0].getDay().value(), vOT[0].getDay().value()); assertEquals(cOT[0].getTimeStart().getHourOfDay(), vOT[0].getTimeStart() / 60); assertEquals(cOT[0].getTimeStart().getMinutesInHour(), vOT[0].getTimeStart() % 60); assertEquals(cOT[0].getTimeStop().getHourOfDay(), vOT[0].getTimeStop() / 60); assertEquals(cOT[0].getTimeStop().getMinutesInHour(), vOT[0].getTimeStop() % 60); }
@EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.info("Handling ChargingStationCreatedEvent"); String chargingStationId = event.getChargingStationId().getId(); ChargingStation chargingStation = chargingStationRepository.findOne(chargingStationId); if (chargingStation == null) { chargingStation = new ChargingStation(chargingStationId); } chargingStationRepository.createOrUpdate(chargingStation); }
VasEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.info("Handling ChargingStationCreatedEvent"); String chargingStationId = event.getChargingStationId().getId(); ChargingStation chargingStation = chargingStationRepository.findOne(chargingStationId); if (chargingStation == null) { chargingStation = new ChargingStation(chargingStationId); } chargingStationRepository.createOrUpdate(chargingStation); } }
VasEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.info("Handling ChargingStationCreatedEvent"); String chargingStationId = event.getChargingStationId().getId(); ChargingStation chargingStation = chargingStationRepository.findOne(chargingStationId); if (chargingStation == null) { chargingStation = new ChargingStation(chargingStationId); } chargingStationRepository.createOrUpdate(chargingStation); }  }
VasEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.info("Handling ChargingStationCreatedEvent"); String chargingStationId = event.getChargingStationId().getId(); ChargingStation chargingStation = chargingStationRepository.findOne(chargingStationId); if (chargingStation == null) { chargingStation = new ChargingStation(chargingStationId); } chargingStationRepository.createOrUpdate(chargingStation); }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(ChargingStationAcceptedEvent event); @EventHandler void handle(ChargingStationConfiguredEvent event); @EventHandler void handle(ChargingStationPlacedEvent event); @EventHandler void handle(ChargingStationLocationImprovedEvent event); @EventHandler void handle(ChargingStationMovedEvent event); @EventHandler void handle(ChargingStationOpeningTimesSetEvent event); @EventHandler void handle(ChargingStationOpeningTimesAddedEvent event); @EventHandler void handle(ChargingStationMadeReservableEvent event); @EventHandler void handle(ChargingStationMadeNotReservableEvent event); @EventHandler void handle(ChargingStationStatusNotificationReceivedEvent event); @EventHandler void handle(ComponentStatusNotificationReceivedEvent event); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setConfigurationConversionService(ConfigurationConversionService configurationConversionService); void setSubscriberService(VasSubscriberService subscriberService); }
VasEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.info("Handling ChargingStationCreatedEvent"); String chargingStationId = event.getChargingStationId().getId(); ChargingStation chargingStation = chargingStationRepository.findOne(chargingStationId); if (chargingStation == null) { chargingStation = new ChargingStation(chargingStationId); } chargingStationRepository.createOrUpdate(chargingStation); }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(ChargingStationAcceptedEvent event); @EventHandler void handle(ChargingStationConfiguredEvent event); @EventHandler void handle(ChargingStationPlacedEvent event); @EventHandler void handle(ChargingStationLocationImprovedEvent event); @EventHandler void handle(ChargingStationMovedEvent event); @EventHandler void handle(ChargingStationOpeningTimesSetEvent event); @EventHandler void handle(ChargingStationOpeningTimesAddedEvent event); @EventHandler void handle(ChargingStationMadeReservableEvent event); @EventHandler void handle(ChargingStationMadeNotReservableEvent event); @EventHandler void handle(ChargingStationStatusNotificationReceivedEvent event); @EventHandler void handle(ComponentStatusNotificationReceivedEvent event); void setChargingStationRepository(ChargingStationRepository chargingStationRepository); void setConfigurationConversionService(ConfigurationConversionService configurationConversionService); void setSubscriberService(VasSubscriberService subscriberService);  }