RoutingKeyConverter { RegistrationKey toRegistrationKey(String routingKey) { return toRegistrationKey(Splitter.on(SEPARATOR).splitToList(routingKey)); } @Inject  RoutingKeyConverter(Set<RegistrationKey.Factory> factories);   }
@Test void toRegistrationKeyShouldReturnCorrespondingRoutingKey() { assertThat(testee.toRegistrationKey(ROUTING_KEY_1)) .isEqualTo(REGISTRATION_KEY_1); }
@Test void toRegistrationKeyShouldAcceptSeparator() { assertThat(testee.toRegistrationKey("org.apache.james.mailbox.events.RoutingKeyConverterTest$TestRegistrationKey:a:b")) .isEqualTo(new TestRegistrationKey("a:b")); }
@Test void toRegistrationKeyShouldAcceptEmptyValue() { assertThat(testee.toRegistrationKey("org.apache.james.mailbox.events.RoutingKeyConverterTest$TestRegistrationKey:")) .isEqualTo(new TestRegistrationKey("")); }
@Test void toRegistrationKeyShouldRejectNull() { assertThatThrownBy(() -> testee.toRegistrationKey(null)) .isInstanceOf(NullPointerException.class); }
@Test void toRegistrationKeyShouldRejectEmptyString() { assertThatThrownBy(() -> testee.toRegistrationKey("")) .isInstanceOf(IllegalArgumentException.class); }
@Test void toRegistrationKeyShouldRejectNoSeparator() { assertThatThrownBy(() -> testee.toRegistrationKey("noSeparator")) .isInstanceOf(IllegalArgumentException.class); }
@Test void toRegistrationKeyShouldRejectUnknownRegistrationKeyClass() { assertThatThrownBy(() -> testee.toRegistrationKey("unknown:")) .isInstanceOf(IllegalArgumentException.class); }
@Test void toRegistrationKeyShouldRejectInvalidValue() { assertThatThrownBy(() -> testee.toRegistrationKey("org.apache.james.mailbox.events.MailboxIdRegistrationKey:invalid")) .isInstanceOf(IllegalArgumentException.class); }