@Test public void testResolveRoutingKeyCommunicationWithChargingStationEvent() { EventMessage message = new GenericEventMessage<>(new HardResetChargingStationRequestedEvent(CHARGING_STATION_ID, PROTOCOL, ROOT_IDENTITY_CONTEXT)); String routingKey = resolver.resolveRoutingKey(message); String expected = routingKeyPrefix + PROTOCOL; assertEquals(expected, routingKey); }
@Override public String resolveRoutingKey(EventMessage eventMessage) { if (eventMessage.getPayload() instanceof CommunicationWithChargingStationRequestedEvent) { CommunicationWithChargingStationRequestedEvent event = (CommunicationWithChargingStationRequestedEvent) eventMessage.getPayload(); return ROUTING_KEY_PREFIX + event.getProtocol(); } else { return this.routingKeyResolver.resolveRoutingKey(eventMessage); } }
MotownRoutingKeyResolver implements RoutingKeyResolver { @Override public String resolveRoutingKey(EventMessage eventMessage) { if (eventMessage.getPayload() instanceof CommunicationWithChargingStationRequestedEvent) { CommunicationWithChargingStationRequestedEvent event = (CommunicationWithChargingStationRequestedEvent) eventMessage.getPayload(); return ROUTING_KEY_PREFIX + event.getProtocol(); } else { return this.routingKeyResolver.resolveRoutingKey(eventMessage); } } }
MotownRoutingKeyResolver implements RoutingKeyResolver { @Override public String resolveRoutingKey(EventMessage eventMessage) { if (eventMessage.getPayload() instanceof CommunicationWithChargingStationRequestedEvent) { CommunicationWithChargingStationRequestedEvent event = (CommunicationWithChargingStationRequestedEvent) eventMessage.getPayload(); return ROUTING_KEY_PREFIX + event.getProtocol(); } else { return this.routingKeyResolver.resolveRoutingKey(eventMessage); } } MotownRoutingKeyResolver(); }
MotownRoutingKeyResolver implements RoutingKeyResolver { @Override public String resolveRoutingKey(EventMessage eventMessage) { if (eventMessage.getPayload() instanceof CommunicationWithChargingStationRequestedEvent) { CommunicationWithChargingStationRequestedEvent event = (CommunicationWithChargingStationRequestedEvent) eventMessage.getPayload(); return ROUTING_KEY_PREFIX + event.getProtocol(); } else { return this.routingKeyResolver.resolveRoutingKey(eventMessage); } } MotownRoutingKeyResolver(); @Override String resolveRoutingKey(EventMessage eventMessage); }
MotownRoutingKeyResolver implements RoutingKeyResolver { @Override public String resolveRoutingKey(EventMessage eventMessage) { if (eventMessage.getPayload() instanceof CommunicationWithChargingStationRequestedEvent) { CommunicationWithChargingStationRequestedEvent event = (CommunicationWithChargingStationRequestedEvent) eventMessage.getPayload(); return ROUTING_KEY_PREFIX + event.getProtocol(); } else { return this.routingKeyResolver.resolveRoutingKey(eventMessage); } } MotownRoutingKeyResolver(); @Override String resolveRoutingKey(EventMessage eventMessage);  }