public static List<SqlGatewayEndpoint> createSqlGatewayEndpoint(
            SqlGatewayService service, Configuration configuration) {
        List<String> identifiers = configuration.get(SQL_GATEWAY_ENDPOINT_TYPE);

        if (identifiers == null || identifiers.isEmpty()) {
            throw new ValidationException(
                    String.format(
                            "Endpoint options do not contain an option key '%s' for discovering an endpoint.",
                            SQL_GATEWAY_ENDPOINT_TYPE.key()));
        }
        validateSpecifiedEndpointsAreUnique(identifiers);

        List<SqlGatewayEndpoint> endpoints = new ArrayList<>();
        for (String identifier : identifiers) {
            final SqlGatewayEndpointFactory factory =
                    FactoryUtil.discoverFactory(
                            Thread.currentThread().getContextClassLoader(),
                            SqlGatewayEndpointFactory.class,
                            identifier);

            endpoints.add(
                    factory.createSqlGatewayEndpoint(
                            new DefaultEndpointFactoryContext(
                                    service,
                                    configuration,
                                    getEndpointConfig(configuration, identifier))));
        }
        return endpoints;
    }
@Test
    public void testCreateEndpoints() {
        String id = UUID.randomUUID().toString();
        Map<String, String> config = getDefaultConfig(id);
        config.put("sql-gateway.endpoint.type", "mocked;fake");
        List<SqlGatewayEndpoint> actual =
                createSqlGatewayEndpoint(
                        new MockedSqlGatewayService(), Configuration.fromMap(config));
        MockedSqlGatewayEndpoint expectedMocked =
                new MockedSqlGatewayEndpoint(id, "localhost", 9999, "Hello World.");
        assertThat(actual)
                .isEqualTo(Arrays.asList(expectedMocked, FakeSqlGatewayEndpoint.INSTANCE));
    }