@Test public void testHandleReservationRejectedEvent() { ChargingStation cs = new ChargingStation(CHARGING_STATION_ID.getId()); cs.setEvses(ImmutableSet.<Evse>builder().add(new Evse("1", ComponentStatus.AVAILABLE)).build()); chargingStationRepository.createOrUpdate(cs); listener.handle(new ReservationRejectedEvent(CHARGING_STATION_ID, EVSE_ID, IDENTITY_CONTEXT)); Reservation reservation = repository.findByChargingStationIdEvseIdUserId(CHARGING_STATION_ID, EVSE_ID, IDENTITY_CONTEXT.getUserIdentity()); assertNotNull(reservation); assert(ReservationStatus.REJECTED.equals(reservation.getStatus())); }
@EventHandler public void handle(ReservedNowEvent event) { LOG.debug("ReservedNowEvent for [{}] received!", event.getChargingStationId()); createReservation(event.getChargingStationId(), ReservationStatus.ACCEPTED, event.getReservationId().getId(), event.getIdentityContext().getUserIdentity(), event.getEvseId(), event.getExpiryDate()); }
ReservationEventListener { @EventHandler public void handle(ReservedNowEvent event) { LOG.debug("ReservedNowEvent for [{}] received!", event.getChargingStationId()); createReservation(event.getChargingStationId(), ReservationStatus.ACCEPTED, event.getReservationId().getId(), event.getIdentityContext().getUserIdentity(), event.getEvseId(), event.getExpiryDate()); } }
ReservationEventListener { @EventHandler public void handle(ReservedNowEvent event) { LOG.debug("ReservedNowEvent for [{}] received!", event.getChargingStationId()); createReservation(event.getChargingStationId(), ReservationStatus.ACCEPTED, event.getReservationId().getId(), event.getIdentityContext().getUserIdentity(), event.getEvseId(), event.getExpiryDate()); }  }
ReservationEventListener { @EventHandler public void handle(ReservedNowEvent event) { LOG.debug("ReservedNowEvent for [{}] received!", event.getChargingStationId()); createReservation(event.getChargingStationId(), ReservationStatus.ACCEPTED, event.getReservationId().getId(), event.getIdentityContext().getUserIdentity(), event.getEvseId(), event.getExpiryDate()); }  void setRepository(ReservationRepository repository); @EventHandler void handle(ReservedNowEvent event); @EventHandler void handle(ReservationFaultedEvent event); @EventHandler void handle(ReservationRejectedEvent event); @EventHandler void handle(ChargingStationUnavailableEvent event); @EventHandler void handle(ChargingStationOccupiedEvent event); @EventHandler void handle(ReservationCancelledEvent event); }
ReservationEventListener { @EventHandler public void handle(ReservedNowEvent event) { LOG.debug("ReservedNowEvent for [{}] received!", event.getChargingStationId()); createReservation(event.getChargingStationId(), ReservationStatus.ACCEPTED, event.getReservationId().getId(), event.getIdentityContext().getUserIdentity(), event.getEvseId(), event.getExpiryDate()); }  void setRepository(ReservationRepository repository); @EventHandler void handle(ReservedNowEvent event); @EventHandler void handle(ReservationFaultedEvent event); @EventHandler void handle(ReservationRejectedEvent event); @EventHandler void handle(ChargingStationUnavailableEvent event); @EventHandler void handle(ChargingStationOccupiedEvent event); @EventHandler void handle(ReservationCancelledEvent event);  }