### Question:
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);  }### Answer:
@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); }
@Test public void handlePermissionGrantedEvent() { commandAuthorizationEventHandler.handle(new PermissionGrantedEvent(CHARGING_STATION_ID, USER_IDENTITY, COMMAND_CLASS, IDENTITY_CONTEXT)); verify(commandAuthorizationRepository).createOrUpdate(CHARGING_STATION_ID.getId(), USER_IDENTITY.getId(), COMMAND_CLASS); }
@Test public void handlePermissionRevokedEvent() { commandAuthorizationEventHandler.handle(new PermissionRevokedEvent(CHARGING_STATION_ID, USER_IDENTITY, COMMAND_CLASS, IDENTITY_CONTEXT)); verify(commandAuthorizationRepository).remove(CHARGING_STATION_ID.getId(), USER_IDENTITY.getId(), COMMAND_CLASS); }