HttpPushValidator extends AbstractProtocolValidator { @Override protected void validateSource(final Source source, final DittoHeaders dittoHeaders, final Supplier<String> sourceDescription) { final String errorMessage = String.format("A connection of type '%s' may not have any source.", type().getName()); throw ConnectionConfigurationInvalidException.newBuilder(errorMessage) .dittoHeaders(dittoHeaders) .build(); }  static HttpPushValidator newInstance(); @Override ConnectionType type(); @Override void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem);  }
@Test public void testSourcesAreInvalid() { final Source source = ConnectivityModelFactory.newSource(AUTHORIZATION_CONTEXT, "any"); assertThatExceptionOfType(ConnectionConfigurationInvalidException.class) .isThrownBy(() -> underTest.validateSource(source, DittoHeaders.empty(), () -> "")); }