@Test public void testHandleChargingStationPlacedEvent() { ChargingStation cs = repository.findOne(CHARGING_STATION_ID.getId()); assertNull(cs.getLatitude()); assertNull(cs.getLongitude()); assertNull(cs.getAddressLine1()); assertNull(cs.getAddressLine2()); assertNull(cs.getPostalCode()); assertNull(cs.getCity()); assertNull(cs.getRegion()); assertNull(cs.getCountry()); assertNull(cs.getAccessibility()); listener.handle(new ChargingStationPlacedEvent(CHARGING_STATION_ID, COORDINATES, null, Accessibility.PUBLIC, IDENTITY_CONTEXT)); cs = repository.findOne(CHARGING_STATION_ID.getId()); assertNotNull(cs.getLatitude()); assertNotNull(cs.getLongitude()); assertNotNull(cs.getAccessibility()); listener.handle(new ChargingStationPlacedEvent(CHARGING_STATION_ID, null, ADDRESS, Accessibility.PUBLIC, IDENTITY_CONTEXT)); cs = repository.findOne(CHARGING_STATION_ID.getId()); assertNotNull(cs.getAddressLine1()); assertNotNull(cs.getAddressLine2()); assertNotNull(cs.getPostalCode()); assertNotNull(cs.getCity()); assertNotNull(cs.getRegion()); assertNotNull(cs.getCountry()); assertEquals(Accessibility.PUBLIC, cs.getAccessibility()); }
@EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId()); ChargingStation station = new ChargingStation(event.getChargingStationId().getId()); repository.createOrUpdate(station); }
ChargingStationEventListener { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId()); ChargingStation station = new ChargingStation(event.getChargingStationId().getId()); repository.createOrUpdate(station); } }
ChargingStationEventListener { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId()); ChargingStation station = new ChargingStation(event.getChargingStationId().getId()); repository.createOrUpdate(station); }  }
ChargingStationEventListener { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId()); ChargingStation station = new ChargingStation(event.getChargingStationId().getId()); repository.createOrUpdate(station); }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(ChargingStationBootedEvent event); @EventHandler void handle(ChargingStationAcceptedEvent event); @EventHandler void handle(ChargingStationPlacedEvent event); @EventHandler void handle(ChargingStationMovedEvent event); @EventHandler void handle(ChargingStationLocationImprovedEvent event); @EventHandler void handle(ChargingStationOpeningTimesSetEvent event); @EventHandler void handle(ChargingStationOpeningTimesAddedEvent event); @EventHandler void handle(ChargingStationConfiguredEvent event); @EventHandler void handle(ChargingStationMadeReservableEvent event); @EventHandler void handle(ChargingStationMadeNotReservableEvent event); @EventHandler void handle(ChargingStationStatusNotificationReceivedEvent event); @EventHandler void handle(ComponentStatusNotificationReceivedEvent event); @EventHandler void handle(ConfigurationItemsReceivedEvent event); @EventHandler void handle(AuthorizationListVersionReceivedEvent event); @EventHandler void handle(AuthorizationListChangedEvent event); @EventHandler void handle(ChargingStationAvailabilityChangedToInoperativeEvent event); @EventHandler void handle(ChargingStationAvailabilityChangedToOperativeEvent event); @EventHandler void handle(ComponentAvailabilityChangedToInoperativeEvent event); @EventHandler void handle(ComponentAvailabilityChangedToOperativeEvent event); void setRepository(ChargingStationRepository repository); }
ChargingStationEventListener { @EventHandler public void handle(ChargingStationCreatedEvent event) { LOG.debug("ChargingStationCreatedEvent creates [{}] in operator api repo", event.getChargingStationId()); ChargingStation station = new ChargingStation(event.getChargingStationId().getId()); repository.createOrUpdate(station); }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(ChargingStationBootedEvent event); @EventHandler void handle(ChargingStationAcceptedEvent event); @EventHandler void handle(ChargingStationPlacedEvent event); @EventHandler void handle(ChargingStationMovedEvent event); @EventHandler void handle(ChargingStationLocationImprovedEvent event); @EventHandler void handle(ChargingStationOpeningTimesSetEvent event); @EventHandler void handle(ChargingStationOpeningTimesAddedEvent event); @EventHandler void handle(ChargingStationConfiguredEvent event); @EventHandler void handle(ChargingStationMadeReservableEvent event); @EventHandler void handle(ChargingStationMadeNotReservableEvent event); @EventHandler void handle(ChargingStationStatusNotificationReceivedEvent event); @EventHandler void handle(ComponentStatusNotificationReceivedEvent event); @EventHandler void handle(ConfigurationItemsReceivedEvent event); @EventHandler void handle(AuthorizationListVersionReceivedEvent event); @EventHandler void handle(AuthorizationListChangedEvent event); @EventHandler void handle(ChargingStationAvailabilityChangedToInoperativeEvent event); @EventHandler void handle(ChargingStationAvailabilityChangedToOperativeEvent event); @EventHandler void handle(ComponentAvailabilityChangedToInoperativeEvent event); @EventHandler void handle(ComponentAvailabilityChangedToOperativeEvent event); void setRepository(ChargingStationRepository repository);  }