Exemplo n.º 1
0
  @Test
  public void chargingStationConfiguredEvent() {
    eventHandler.handle(
        new ChargingStationCreatedEvent(
            CHARGING_STATION_ID, USER_IDENTITIES_WITH_ALL_PERMISSIONS, NULL_USER_IDENTITY_CONTEXT));
    ChargingStation cs = chargingStationRepository.findOne(CHARGING_STATION_ID.getId());
    assertFalse(cs.isConfigured());
    assertNotSame(cs.getNumberOfEvses(), EVSES.size());

    eventHandler.handle(
        new ChargingStationConfiguredEvent(CHARGING_STATION_ID, EVSES, NULL_USER_IDENTITY_CONTEXT));

    cs = chargingStationRepository.findOne(CHARGING_STATION_ID.getId());
    assertTrue(cs.isConfigured());
    assertEquals(cs.getNumberOfEvses(), EVSES.size());
  }
Exemplo n.º 2
0
  @Test
  public void unknownChargingStationConfiguredEvent() {
    eventHandler.handle(
        new ChargingStationConfiguredEvent(CHARGING_STATION_ID, EVSES, NULL_USER_IDENTITY_CONTEXT));

    ChargingStation cs = chargingStationRepository.findOne(CHARGING_STATION_ID.getId());
    assertTrue(cs.isConfigured());
    assertEquals(cs.getNumberOfEvses(), EVSES.size());
  }