@Test
public void fromJsonReturnsExpected() {

    final Connection expected = ConnectivityModelFactory.newConnectionBuilder(ID, TYPE, STATUS, URI)
            .credentials(CREDENTIALS)
            .name(NAME)
            .setSources(addSourceMapping(SOURCES, JAVA_SCRIPT_MAPPING))
            .setTargets(addTargetMapping(TARGETS, STATUS_MAPPING))
            .clientCount(2)
            .payloadMappingDefinition(KNOWN_MAPPING_DEFINITIONS)
            .tags(KNOWN_TAGS)
            .build();
    final Connection actual = ImmutableConnection.fromJson(KNOWN_JSON);
    assertThat(actual).isEqualTo(expected);
}