@Test
public void invalidSpecificOptionsThrowConnectionConfigurationInvalidException() {

    final Map<String, String> specificOptions = new HashMap<>();
    specificOptions.put("failover.unknown.option", "100");
    specificOptions.put("failover.nested.amqp.vhost", "ditto");
    final Connection connection = ConnectivityModelFactory.newConnectionBuilder(createRandomConnectionId(),
            ConnectionType.AMQP_10, ConnectivityStatus.OPEN, TestConstants.getUriOfNewMockServer())
            .specificConfig(specificOptions)
            .sources(singletonList(
                    ConnectivityModelFactory.newSourceBuilder()
                            .authorizationContext(Authorization.AUTHORIZATION_CONTEXT)
                            .address("source1")
                            .build()))
            .build();
    final ThrowableAssert.ThrowingCallable props1 =
            () -> AmqpClientActor.propsForTests(connection, ActorRef.noSender(), null, null);
    final ThrowableAssert.ThrowingCallable props2 =
            () -> AmqpClientActor.propsForTests(connection, ActorRef.noSender(), null, jmsConnectionFactory);
    Stream.of(props1, props2).forEach(throwingCallable ->
            assertThatExceptionOfType(ConnectionConfigurationInvalidException.class)
                    .isThrownBy(throwingCallable)
                    .withMessageContaining("unknown.option"));
}