@Test
public void getBuilderFromConnectionCoversAllFields() {

    final Connection connection = ImmutableConnection.getBuilder(ID, TYPE, STATUS, URI)
            .sources(SOURCES)
            .targets(TARGETS)
            .connectionStatus(ConnectivityStatus.OPEN)
            .name("connection")
            .clientCount(5)
            .tag("AAA")
            .trustedCertificates("certs")
            .processorPoolSize(8)
            .credentials(ClientCertificateCredentials.newBuilder()
                    .clientKey("clientkey")
                    .clientCertificate("certificate")
                    .build())
            .validateCertificate(true)
            .uri("amqps://some.amqp.org:5672")
            .id(ID)
            .payloadMappingDefinition(
                    ConnectivityModelFactory.newPayloadMappingDefinition("test", KNOWN_JAVA_MAPPING_CONTEXT))
            .build();
    assertThat(ImmutableConnection.getBuilder(connection).build()).isEqualTo(connection);
}