@Test public void handleChargingStationCreatedEvent() { commandAuthorizationEventHandler.handle(new ChargingStationCreatedEvent(CHARGING_STATION_ID, USER_IDENTITIES_WITH_ALL_PERMISSIONS, IDENTITY_CONTEXT)); verify(commandAuthorizationRepository).createOrUpdate(CHARGING_STATION_ID.getId(), ROOT_USER_IDENTITY.getId(), AllPermissions.class); }
@EventHandler public void handle(ChargingStationCreatedEvent event) { for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) { commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class); } }
CommandAuthorizationEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) { commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class); } } }
CommandAuthorizationEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) { commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class); } }  }
CommandAuthorizationEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) { commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class); } }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(PermissionGrantedEvent event); @EventHandler void handle(PermissionRevokedEvent event); void setCommandAuthorizationRepository(CommandAuthorizationRepository commandAuthorizationRepository); }
CommandAuthorizationEventHandler { @EventHandler public void handle(ChargingStationCreatedEvent event) { for (UserIdentity userIdentity : event.getUserIdentitiesWithAllPermissions()) { commandAuthorizationRepository.createOrUpdate(event.getChargingStationId().getId(), userIdentity.getId(), AllPermissions.class); } }  @EventHandler void handle(ChargingStationCreatedEvent event); @EventHandler void handle(PermissionGrantedEvent event); @EventHandler void handle(PermissionRevokedEvent event); void setCommandAuthorizationRepository(CommandAuthorizationRepository commandAuthorizationRepository);  }