test_class.declarator: CONNECTION_ID = TestConstants.createRandomConnectionId()
test_class.modifier: private static final
test_class.original_string: private static final ConnectionId CONNECTION_ID = TestConstants.createRandomConnectionId();
test_class.type: ConnectionId
test_class.var_name: CONNECTION_ID
test_class.declarator: CONFIG =
              TestConstants.CONFIG.withValue("ditto.connectivity.connection.blocked-hostnames",
                      ConfigValueFactory.fromAnyRef("8.8.8.8,2001:4860:4860:0000:0000:0000:0000:0001"))
test_class.modifier: private static final
test_class.original_string: private static final Config CONFIG =
              TestConstants.CONFIG.withValue("ditto.connectivity.connection.blocked-hostnames",
                      ConfigValueFactory.fromAnyRef("8.8.8.8,2001:4860:4860:0000:0000:0000:0000:0001"));
test_class.type: Config
test_class.var_name: CONFIG
test_class.declarator: CONNECTIVITY_CONFIG_WITH_ENABLED_BLOCKLIST =
              DittoConnectivityConfig.of(DefaultScopedConfig.dittoScoped(CONFIG))
test_class.modifier: private static final
test_class.original_string: private static final ConnectivityConfig CONNECTIVITY_CONFIG_WITH_ENABLED_BLOCKLIST =
              DittoConnectivityConfig.of(DefaultScopedConfig.dittoScoped(CONFIG));
test_class.type: ConnectivityConfig
test_class.var_name: CONNECTIVITY_CONFIG_WITH_ENABLED_BLOCKLIST
test_class.declarator: actorSystem
test_class.modifier: private static
test_class.original_string: private static ActorSystem actorSystem;
test_class.type: ActorSystem
test_class.var_name: actorSystem
test_class.declarator: exception = ExpectedException.none()
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final ExpectedException exception = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: exception
test_class.file: services/connectivity/messaging/src/test/java/org/eclipse/ditto/services/connectivity/messaging/validation/ConnectionValidatorTest.java
test_class.identifier: ConnectionValidatorTest
test_case.body: @Test
      public void rejectConnectionWithIllFormedTrustedCertificates() {
          final Connection connection = createConnection(CONNECTION_ID).toBuilder()
                  .trustedCertificates("Wurst")
                  .build();
          final ConnectionValidator underTest = getConnectionValidator();
          assertThatExceptionOfType(ConnectionConfigurationInvalidException.class)
                  .isThrownBy(() -> underTest.validate(connection, DittoHeaders.empty(), actorSystem));
      }
test_case.class_method_signature: ConnectionValidatorTest.rejectConnectionWithIllFormedTrustedCertificates()
test_case.full_signature: @Test public void rejectConnectionWithIllFormedTrustedCertificates()
test_case.identifier: rejectConnectionWithIllFormedTrustedCertificates
test_case.invocations: build trustedCertificates toBuilder createConnection getConnectionValidator isThrownBy assertThatExceptionOfType validate empty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void rejectConnectionWithIllFormedTrustedCertificates()
focal_class.declarator: specMap
focal_class.modifier: private final
focal_class.original_string: private final Map<ConnectionType, AbstractProtocolValidator> specMap;
focal_class.type: Map<ConnectionType, AbstractProtocolValidator>
focal_class.var_name: specMap
focal_class.declarator: queryFilterCriteriaFactory
focal_class.modifier: private final
focal_class.original_string: private final QueryFilterCriteriaFactory queryFilterCriteriaFactory;
focal_class.type: QueryFilterCriteriaFactory
focal_class.var_name: queryFilterCriteriaFactory
focal_class.declarator: mappingNumberLimitSource
focal_class.modifier: private final
focal_class.original_string: private final int mappingNumberLimitSource;
focal_class.type: int
focal_class.var_name: mappingNumberLimitSource
focal_class.declarator: mappingNumberLimitTarget
focal_class.modifier: private final
focal_class.original_string: private final int mappingNumberLimitTarget;
focal_class.type: int
focal_class.var_name: mappingNumberLimitTarget
focal_class.declarator: hostValidator
focal_class.modifier: private final
focal_class.original_string: private final HostValidator hostValidator;
focal_class.type: HostValidator
focal_class.var_name: hostValidator
focal_class.file: services/connectivity/messaging/src/main/java/org/eclipse/ditto/services/connectivity/messaging/validation/ConnectionValidator.java
focal_class.identifier: ConnectionValidator
focal_class.class_method_signature: ConnectionValidator.ConnectionValidator(
              final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.full_signature: private  ConnectionValidator(
              final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.identifier: ConnectionValidator
focal_class.modifiers: private
focal_class.parameters: (
              final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.signature:  ConnectionValidator(
              final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.class_method_signature: ConnectionValidator.of(final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.full_signature: public static ConnectionValidator of(final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.return: ConnectionValidator
focal_class.signature: ConnectionValidator of(final ConnectivityConfig connectivityConfig,
              LoggingAdapter loggingAdapter, final AbstractProtocolValidator... connectionSpecs)
focal_class.class_method_signature: ConnectionValidator.validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_class.full_signature:  void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_class.identifier: validate
focal_class.parameters: (final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_class.return: void
focal_class.signature: void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_class.class_method_signature: ConnectionValidator.checkMappingNumberOfSourcesAndTargets(final DittoHeaders dittoHeaders, final Connection connection)
focal_class.full_signature: private void checkMappingNumberOfSourcesAndTargets(final DittoHeaders dittoHeaders, final Connection connection)
focal_class.identifier: checkMappingNumberOfSourcesAndTargets
focal_class.modifiers: private
focal_class.parameters: (final DittoHeaders dittoHeaders, final Connection connection)
focal_class.return: void
focal_class.signature: void checkMappingNumberOfSourcesAndTargets(final DittoHeaders dittoHeaders, final Connection connection)
focal_class.class_method_signature: ConnectionValidator.checkPayloadMappingLimit(final PayloadMapping mapping, final int limit, final String entity,
              final String address, final DittoHeaders dittoHeaders)
focal_class.full_signature: private void checkPayloadMappingLimit(final PayloadMapping mapping, final int limit, final String entity,
              final String address, final DittoHeaders dittoHeaders)
focal_class.identifier: checkPayloadMappingLimit
focal_class.modifiers: private
focal_class.parameters: (final PayloadMapping mapping, final int limit, final String entity,
              final String address, final DittoHeaders dittoHeaders)
focal_class.return: void
focal_class.signature: void checkPayloadMappingLimit(final PayloadMapping mapping, final int limit, final String entity,
              final String address, final DittoHeaders dittoHeaders)
focal_class.class_method_signature: ConnectionValidator.validateSourceAndTargetAddressesAreNonempty(final Connection connection,
              final DittoHeaders dittoHeaders)
focal_class.full_signature: private void validateSourceAndTargetAddressesAreNonempty(final Connection connection,
              final DittoHeaders dittoHeaders)
focal_class.identifier: validateSourceAndTargetAddressesAreNonempty
focal_class.modifiers: private
focal_class.parameters: (final Connection connection,
              final DittoHeaders dittoHeaders)
focal_class.return: void
focal_class.signature: void validateSourceAndTargetAddressesAreNonempty(final Connection connection,
              final DittoHeaders dittoHeaders)
focal_class.class_method_signature: ConnectionValidator.validateFormatOfCertificates(final Connection connection, final DittoHeaders dittoHeaders)
focal_class.full_signature: private static void validateFormatOfCertificates(final Connection connection, final DittoHeaders dittoHeaders)
focal_class.identifier: validateFormatOfCertificates
focal_class.modifiers: private static
focal_class.parameters: (final Connection connection, final DittoHeaders dittoHeaders)
focal_class.return: void
focal_class.signature: void validateFormatOfCertificates(final Connection connection, final DittoHeaders dittoHeaders)
focal_class.class_method_signature: ConnectionValidator.emptyAddressesError(final String location, final DittoHeaders dittoHeaders)
focal_class.full_signature: private static DittoRuntimeException emptyAddressesError(final String location, final DittoHeaders dittoHeaders)
focal_class.identifier: emptyAddressesError
focal_class.modifiers: private static
focal_class.parameters: (final String location, final DittoHeaders dittoHeaders)
focal_class.return: DittoRuntimeException
focal_class.signature: DittoRuntimeException emptyAddressesError(final String location, final DittoHeaders dittoHeaders)
focal_method.body: void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem) {
          final AbstractProtocolValidator spec = specMap.get(connection.getConnectionType());
          validateSourceAndTargetAddressesAreNonempty(connection, dittoHeaders);
          checkMappingNumberOfSourcesAndTargets(dittoHeaders, connection);
          validateFormatOfCertificates(connection, dittoHeaders);
          hostValidator.validateHostname(connection.getHostname(), dittoHeaders);
          if (spec != null) {
              // throw error at validation site for clarity of stack trace
              spec.validate(connection, dittoHeaders, actorSystem);
          } else {
              throw new IllegalStateException("Unknown connection type: " + connection);
          }
      }
focal_method.class_method_signature: ConnectionValidator.validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_method.full_signature:  void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_method.identifier: validate
focal_method.invocations: get getConnectionType validateSourceAndTargetAddressesAreNonempty checkMappingNumberOfSourcesAndTargets validateFormatOfCertificates validateHostname getHostname validate
focal_method.parameters: (final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)
focal_method.return: void
focal_method.signature: void validate(final Connection connection, final DittoHeaders dittoHeaders, final ActorSystem actorSystem)