@Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {

        String[] parts = remaining.split(":");

        if (parts.length < 3) {
            throw new IllegalArgumentException(
                    "Google PubSub Lite Endpoint format \"projectId:location:destinationName[:subscriptionName]\"");

        }

        GooglePubsubLiteEndpoint pubsubEndpoint = new GooglePubsubLiteEndpoint(uri, this);
        LOG.debug("Google Cloud ProjectId {}", parts[0]);
        pubsubEndpoint.setProjectId(parts[0]);
        LOG.debug("Google Cloud LocationId {}", parts[1]);
        pubsubEndpoint.setLocation(parts[1]);
        LOG.debug("Google Cloud DestinationName {}", parts[2]);
        pubsubEndpoint.setDestinationName(parts[2]);
        LOG.debug("Google Cloud ServiceAccountKey {}", serviceAccountKey);
        pubsubEndpoint.setServiceAccountKey(serviceAccountKey);

        setProperties(pubsubEndpoint, parameters);

        return pubsubEndpoint;
    }
@Test
    public void testCreateEndpointMissingFields() {
        String uri = "google-pubsub-lite:123456789012:europe-west3";
        String remaining = "123456789012:europe-west3";
        Map<String, Object> parameters = new HashMap<>();

        Exception exception = assertThrows(IllegalArgumentException.class,
                () -> googlePubsubLiteComponent.createEndpoint(uri, remaining, parameters));

        String expectedMessage = "Google PubSub Lite Endpoint format \"projectId:location:destinationName[:subscriptionName]\"";
        String actualMessage = exception.getMessage();
        assertTrue(actualMessage.contains(expectedMessage));
    }