com.thoughtworks.go.plugin.api.exceptions.UnhandledRequestTypeException Java Examples

The following examples show how to use com.thoughtworks.go.plugin.api.exceptions.UnhandledRequestTypeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DummyClassProvidingAnonymousClass.java    From gocd with Apache License 2.0 6 votes vote down vote up
public static GoPlugin getAnonymousClass() {
    return new GoPlugin() {
        @Override
        public void initializeGoApplicationAccessor(GoApplicationAccessor goApplicationAccessor) {
        }

        @Override
        public GoPluginApiResponse handle(GoPluginApiRequest requestMessage) throws UnhandledRequestTypeException {
            return null;
        }

        @Override
        public GoPluginIdentifier pluginIdentifier() {
            return null;
        }
    };
}
 
Example #2
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldContainFilePatternInResponseToGetConfigurationRequest() throws UnhandledRequestTypeException {
    DefaultGoPluginApiRequest getConfigRequest = new DefaultGoPluginApiRequest("configrepo", "1.0", "go.plugin-settings.get-configuration");

    GoPluginApiResponse response = plugin.handle(getConfigRequest);
    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
    JsonObject responseJsonObject = getJsonObjectFromResponse(response);
    JsonElement pattern = responseJsonObject.get("file_pattern");
    assertNotNull(pattern);
    JsonObject patternAsJsonObject = pattern.getAsJsonObject();
    assertThat(patternAsJsonObject.get("display-name").getAsString(), is("Go YAML files pattern"));
    assertThat(patternAsJsonObject.get("default-value").getAsString(), is("**/*.gocd.yaml,**/*.gocd.yml"));
    assertThat(patternAsJsonObject.get("required").getAsBoolean(), is(false));
    assertThat(patternAsJsonObject.get("secure").getAsBoolean(), is(false));
    assertThat(patternAsJsonObject.get("display-order").getAsInt(), is(0));
}
 
Example #3
Source File: DummyClassProvidingAnonymousClass.java    From gocd with Apache License 2.0 6 votes vote down vote up
public static GoPlugin getAnonymousClass() {
    return new GoPlugin() {
        @Override
        public void initializeGoApplicationAccessor(GoApplicationAccessor goApplicationAccessor) {
        }

        @Override
        public GoPluginApiResponse handle(GoPluginApiRequest requestMessage) throws UnhandledRequestTypeException {
            return null;
        }

        @Override
        public GoPluginIdentifier pluginIdentifier() {
            return null;
        }
    };
}
 
Example #4
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldContainValidFieldsInResponseMessage() throws UnhandledRequestTypeException {
    GoApiResponse settingsResponse = DefaultGoApiResponse.success("{}");
    when(goAccessor.submit(any(GoApiRequest.class))).thenReturn(settingsResponse);

    GoPluginApiResponse response = parseAndGetResponseForDir(tempDir.getRoot());

    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
    final JsonParser parser = new JsonParser();
    JsonElement responseObj = parser.parse(response.responseBody());
    assertTrue(responseObj.isJsonObject());
    JsonObject obj = responseObj.getAsJsonObject();
    assertTrue(obj.has("errors"));
    assertTrue(obj.has("pipelines"));
    assertTrue(obj.has("environments"));
    assertTrue(obj.has("target_version"));
}
 
Example #5
Source File: NessusScanTask.java    From gocd-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest request) throws UnhandledRequestTypeException {
    switch (request.requestName()) {
        case "configuration":
        case "go.plugin-settings.get-configuration":
            return handleGetConfigRequest();
        case "validate":
        case "go.plugin-settings.validate-configuration":
            return handleValidation();
        case "execute":
            return handleTaskExecution(request);
        case "view":
        case "go.plugin-settings.get-view":
            return handleTaskView();
        default:
            throw new UnhandledRequestTypeException(request.requestName());
    }
}
 
Example #6
Source File: DummyClassWithLocalInnerClass.java    From gocd with Apache License 2.0 6 votes vote down vote up
public void foo() {
    @Extension
    class DummyInnerClassWithExtension implements GoPlugin {
        @Override
        public void initializeGoApplicationAccessor(GoApplicationAccessor goApplicationAccessor) {
            throw new UnsupportedOperationException();
        }

        @Override
        public GoPluginApiResponse handle(GoPluginApiRequest requestMessage) throws UnhandledRequestTypeException {
            throw new UnsupportedOperationException();
        }

        @Override
        public GoPluginIdentifier pluginIdentifier() {
            throw new UnsupportedOperationException();
        }
    }
}
 
Example #7
Source File: GoPluginImpl.java    From script-executor-task with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {
    if (goPluginApiRequest.requestName().equals(REQUEST_CONFIGURATION) || goPluginApiRequest.requestName().equals(REQUEST_CONFIGURATION_2)) {
        return handleConfiguration();
    } else if (goPluginApiRequest.requestName().equals(REQUEST_VALIDATION) || goPluginApiRequest.requestName().equals(REQUEST_VALIDATION_2)) {
        return handleValidation(goPluginApiRequest);
    } else if (goPluginApiRequest.requestName().equals(REQUEST_TASK_VIEW) || goPluginApiRequest.requestName().equals(REQUEST_TASK_VIEW_2)) {
        try {
            return handleView();
        } catch (IOException e) {
            String message = "Failed to find template: " + e.getMessage();
            return renderJSON(500, message);
        }
    } else if (goPluginApiRequest.requestName().equals(REQUEST_EXECUTION)) {
        return handleExecute(goPluginApiRequest);
    }
    return null;
}
 
Example #8
Source File: S3PackageMaterialPoller.java    From gocd-s3-artifacts with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {
    if (goPluginApiRequest.requestName().equals(REQUEST_REPOSITORY_CONFIGURATION)) {
        return handleRepositoryConfiguration();
    } else if (goPluginApiRequest.requestName().equals(REQUEST_PACKAGE_CONFIGURATION)) {
        return handlePackageConfiguration();
    } else if (goPluginApiRequest.requestName().equals(REQUEST_VALIDATE_REPOSITORY_CONFIGURATION)) {
        return handleRepositoryValidation(goPluginApiRequest);
    } else if (goPluginApiRequest.requestName().equals(REQUEST_VALIDATE_PACKAGE_CONFIGURATION)) {
        return handlePackageValidation();
    } else if (goPluginApiRequest.requestName().equals(REQUEST_CHECK_REPOSITORY_CONNECTION)) {
        return handleRepositoryCheckConnection(goPluginApiRequest);
    } else if (goPluginApiRequest.requestName().equals(REQUEST_CHECK_PACKAGE_CONNECTION)) {
        return handlePackageCheckConnection(goPluginApiRequest);
    } else if (goPluginApiRequest.requestName().equals(REQUEST_LATEST_REVISION)) {
        return handleGetLatestRevision(goPluginApiRequest);
    } else if (goPluginApiRequest.requestName().equals(REQUEST_LATEST_REVISION_SINCE)) {
        return handleLatestRevisionSince(goPluginApiRequest);
    }
    return null;
}
 
Example #9
Source File: InvalidXmlPlugin.java    From go-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {
    return new GoPluginApiResponse() {
        @Override
        public int responseCode() {
            return 200;
        }

        @Override
        public Map<String, String> responseHeaders() {
            return null;
        }

        @Override
        public String responseBody() {
            return "{}";
        }
    };
}
 
Example #10
Source File: PluginWithMultipleLoadMethods.java    From go-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {
    return new GoPluginApiResponse() {
        @Override
        public int responseCode() {
            return 200;
        }

        @Override
        public Map<String, String> responseHeaders() {
            return null;
        }

        @Override
        public String responseBody() {
            return "{}";
        }
    };
}
 
Example #11
Source File: PluginWithInvalidId.java    From go-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {
    return new GoPluginApiResponse() {
        @Override
        public int responseCode() {
            return 200;
        }

        @Override
        public Map<String, String> responseHeaders() {
            return null;
        }

        @Override
        public String responseBody() {
            return "{}";
        }
    };
}
 
Example #12
Source File: Plugin2.java    From go-plugins with Apache License 2.0 6 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {

    if ("configuration".equals(goPluginApiRequest.requestName())) {
        HashMap<String, Object> config = new HashMap<>();

        HashMap<String, Object> url = new HashMap<>();
        url.put("display-order", "0");
        url.put("display-name", "Url");
        url.put("required", true);
        config.put("Url", url);
        return DefaultGoPluginApiResponse.success(new GsonBuilder().create().toJson(config));
    } else if ("view".equals(goPluginApiRequest.requestName())) {
        return getViewRequest();
    }
    throw new UnhandledRequestTypeException(goPluginApiRequest.requestName());
}
 
Example #13
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldRespondSuccessWithErrorMessagesToParseDirectoryRequestWhenParsingErrorCaseFile() throws UnhandledRequestTypeException, IOException {
    GoPluginApiResponse response = parseAndGetResponseForDir(setupCase("invalid-materials"));

    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
    JsonObject responseJsonObject = getJsonObjectFromResponse(response);
    JsonArray pipelines = responseJsonObject.get("pipelines").getAsJsonArray();
    assertThat(pipelines.size(), is(0));
    assertFirstError(responseJsonObject, "Error parsing YAML. : Line 21, column 0: Expected a 'block end' but found: scalar : ", "invalid-materials.gocd.yaml");
}
 
Example #14
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldValidateFetchArtifactConfig() throws UnhandledRequestTypeException, JSONException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer. REQUEST_FETCH_ARTIFACT_VALIDATE.getRequestName());
    when(request.requestBody()).thenReturn("{}");

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    final String expectedJson = "[{\"key\":\"Path\",\"message\":\"must be provided.\"}]";
    assertThat(response.responseCode()).isEqualTo(200);
    JSONAssert.assertEquals(expectedJson,response.responseBody(),true);
}
 
Example #15
Source File: ValidInnerClassPlugin.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {

    if ("configuration".equals(goPluginApiRequest.requestName())) {
        return new GetTaskPluginConfig().execute();
    } else if ("view".equals(goPluginApiRequest.requestName())) {
        return getViewRequest();
    }
    throw new UnhandledRequestTypeException(goPluginApiRequest.requestName());
}
 
Example #16
Source File: YamlConfigPlugin.java    From gocd-yaml-config-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest request) throws UnhandledRequestTypeException {
    String requestName = request.requestName();

    switch (requestName) {
        case REQ_PLUGIN_SETTINGS_GET_CONFIGURATION:
            return handleGetPluginSettingsConfiguration();
        case REQ_CONFIG_FILES:
            return handleGetConfigFiles(request);
        case REQ_PLUGIN_SETTINGS_GET_VIEW:
            try {
                return handleGetPluginSettingsView();
            } catch (IOException e) {
                return error(gson.toJson(format("Failed to find template: %s", e.getMessage())));
            }
        case REQ_PLUGIN_SETTINGS_VALIDATE_CONFIGURATION:
            return handleValidatePluginSettingsConfiguration();
        case REQ_PARSE_CONTENT:
            return handleParseContentRequest(request);
        case REQ_PARSE_DIRECTORY:
            ensureConfigured();
            return handleParseDirectoryRequest(request);
        case REQ_PIPELINE_EXPORT:
            return handlePipelineExportRequest(request);
        case REQ_GET_CAPABILITIES:
            return success(gson.toJson(new Capabilities()));
        case REQ_PLUGIN_SETTINGS_CHANGED:
            configurePlugin(PluginSettings.fromJson(request.requestBody()));
            return new DefaultGoPluginApiResponse(SUCCESS_RESPONSE_CODE, "");
        case REQ_GET_ICON:
            return handleGetIconRequest();
        default:
            throw new UnhandledRequestTypeException(requestName);
    }
}
 
Example #17
Source File: DoNothingPlugin.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {

    if ("configuration".equals(goPluginApiRequest.requestName())) {
        return new GetTaskPluginConfig().execute();
    } else if ("view".equals(goPluginApiRequest.requestName())) {
        return getViewRequest();
    }
    throw new UnhandledRequestTypeException(goPluginApiRequest.requestName());
}
 
Example #18
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldReturnFetchArtifactView() throws UnhandledRequestTypeException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_FETCH_ARTIFACT_VIEW.getRequestName());

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    final Map<String, String> expectedTemplate = Collections.singletonMap("template", ResourceReader.read("/fetch-artifact.template.html"));
    assertThat(response.responseCode()).isEqualTo(200);
    assertThat(response.responseBody()).isEqualTo(new Gson().toJson(expectedTemplate));
}
 
Example #19
Source File: ValidStaticClassPlugin.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest goPluginApiRequest) throws UnhandledRequestTypeException {

    if ("configuration".equals(goPluginApiRequest.requestName())) {
        return new GetTaskPluginConfig().execute();
    } else if ("view".equals(goPluginApiRequest.requestName())) {
        return getViewRequest();
    }
    throw new UnhandledRequestTypeException(goPluginApiRequest.requestName());
}
 
Example #20
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldRespondSuccessToGetConfigurationRequest() throws UnhandledRequestTypeException {
    DefaultGoPluginApiRequest getConfigRequest = new DefaultGoPluginApiRequest("configrepo", "1.0", "go.plugin-settings.get-configuration");

    GoPluginApiResponse response = plugin.handle(getConfigRequest);
    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
}
 
Example #21
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldReturnPublishArtifactView() throws UnhandledRequestTypeException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_PUBLISH_ARTIFACT_VIEW.getRequestName());

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    final Map<String, String> expectedTemplate = Collections.singletonMap("template", ResourceReader.read("/publish-artifact.template.html"));
    assertThat(response.responseCode()).isEqualTo(200);
    assertThat(response.responseBody()).isEqualTo(new Gson().toJson(expectedTemplate));
}
 
Example #22
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldReturnPublishArtifactMetadata() throws UnhandledRequestTypeException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_PUBLISH_ARTIFACT_METADATA.getRequestName());

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    String expectedMetadata = "[{\"key\":\"Source\",\"metadata\":{\"required\":true,\"secure\":false}},{\"key\":\"Destination\",\"metadata\":{\"required\":true,\"secure\":false}}]";
    assertThat(response.responseCode()).isEqualTo(200);
    assertThat(response.responseBody()).isEqualTo(expectedMetadata);
}
 
Example #23
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldValidateArtifactStoreConfig() throws UnhandledRequestTypeException, JSONException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_STORE_CONFIG_VALIDATE.getRequestName());
    when(request.requestBody()).thenReturn(GSON.toJson(Collections.singletonMap("Url", "httpd://foo/bar")));

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    final String expectedJson = "[{\"key\":\"Username\",\"message\":\"must be provided.\"},{\"key\":\"Password\",\"message\":\"must be provided.\"}]";
    assertThat(response.responseCode()).isEqualTo(200);
    JSONAssert.assertEquals(expectedJson,response.responseBody(),true);
}
 
Example #24
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldReturnArtifactStoreView() throws UnhandledRequestTypeException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_STORE_CONFIG_VIEW.getRequestName());

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    final Map<String, String> expectedTemplate = Collections.singletonMap("template", ResourceReader.read("/artifact-store.template.html"));
    assertThat(response.responseCode()).isEqualTo(200);
    assertThat(response.responseBody()).isEqualTo(new Gson().toJson(expectedTemplate));
}
 
Example #25
Source File: DockerRegistryArtifactPlugin.java    From docker-registry-artifact-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest request) {
    try {
        switch (Request.fromString(request.requestName())) {
            case REQUEST_GET_PLUGIN_ICON:
                return new GetPluginIconExecutor().execute();
            case REQUEST_GET_PLUGIN_CAPABILITIES:
                return new GetCapabilitiesExecutor().execute();
            case REQUEST_STORE_CONFIG_METADATA:
                return new GetArtifactStoreConfigMetadataExecutor().execute();
            case REQUEST_STORE_CONFIG_VIEW:
                return new GetArtifactStoreViewExecutor().execute();
            case REQUEST_STORE_CONFIG_VALIDATE:
                return new ValidateArtifactStoreConfigExecutor(request).execute();
            case REQUEST_PUBLISH_ARTIFACT_METADATA:
                return new GetPublishArtifactConfigMetadataExecutor().execute();
            case REQUEST_PUBLISH_ARTIFACT_VIEW:
                return new GetPublishArtifactViewExecutor().execute();
            case REQUEST_PUBLISH_ARTIFACT_VALIDATE:
                return new ValidatePublishArtifactConfigExecutor(request).execute();
            case REQUEST_FETCH_ARTIFACT_METADATA:
                return new GetFetchArtifactMetadataExecutor().execute();
            case REQUEST_FETCH_ARTIFACT_VIEW:
                return new GetFetchArtifactViewExecutor().execute();
            case REQUEST_FETCH_ARTIFACT_VALIDATE:
                return new ValidateFetchArtifactConfigExecutor(request).execute();
            case REQUEST_PUBLISH_ARTIFACT:
                return new PublishArtifactExecutor(request, consoleLogger).execute();
            case REQUEST_FETCH_ARTIFACT:
                return new FetchArtifactExecutor(request, consoleLogger).execute();
            default:
                throw new UnhandledRequestTypeException(request.requestName());
        }
    } catch (Exception e) {
        LOG.error("Error while executing request " + request.requestName(), e);
        throw new RuntimeException(e);
    }
}
 
Example #26
Source File: DummyArtifactPluginTest.java    From go-plugins with Apache License 2.0 5 votes vote down vote up
@Test
void shouldReturnCapabilitiesOfThePlugin() throws UnhandledRequestTypeException {
    final GoPluginApiRequest request = mock(GoPluginApiRequest.class);
    when(request.requestName()).thenReturn(RequestFromServer.REQUEST_GET_CAPABILITIES.getRequestName());

    final GoPluginApiResponse response = new DummyArtifactPlugin().handle(request);

    assertThat(response.responseCode()).isEqualTo(200);
    assertThat(response.responseBody()).isEqualTo("{}");
}
 
Example #27
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldRespondSuccessToGetViewRequest() throws UnhandledRequestTypeException {
    DefaultGoPluginApiRequest getConfigRequest = new DefaultGoPluginApiRequest("configrepo", "1.0", "go.plugin-settings.get-view");

    GoPluginApiResponse response = plugin.handle(getConfigRequest);
    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
}
 
Example #28
Source File: YamlConfigPluginIntegrationTest.java    From gocd-yaml-config-plugin with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldRespondSuccessToValidateConfigRequest() throws UnhandledRequestTypeException {
    DefaultGoPluginApiRequest validateRequest = new DefaultGoPluginApiRequest("configrepo", "1.0", "go.plugin-settings.validate-configuration");

    GoPluginApiResponse response = plugin.handle(validateRequest);
    assertThat(response.responseCode(), is(SUCCESS_RESPONSE_CODE));
}
 
Example #29
Source File: PublishTask.java    From gocd-s3-artifacts with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse handle(GoPluginApiRequest request) throws UnhandledRequestTypeException {
    if ("configuration".equals(request.requestName())) {
        return handleGetConfigRequest();
    } else if ("validate".equals(request.requestName())) {
        return handleValidation(request);
    } else if ("execute".equals(request.requestName())) {
        return handleTaskExecution(request);
    } else if ("view".equals(request.requestName())) {
        return handleTaskView();
    }
    throw new UnhandledRequestTypeException(request.requestName());
}
 
Example #30
Source File: DefaultPluginManager.java    From gocd with Apache License 2.0 5 votes vote down vote up
@Override
public GoPluginApiResponse submitTo(final String pluginId, String extensionType, final GoPluginApiRequest apiRequest) {
    return goPluginOSGiFramework.doOn(GoPlugin.class, pluginId, extensionType, (plugin, pluginDescriptor) -> {
        ensureInitializerInvoked(pluginDescriptor, plugin, extensionType);
        try {
            return plugin.handle(apiRequest);
        } catch (UnhandledRequestTypeException e) {
            LOGGER.error(e.getMessage());
            LOGGER.debug(e.getMessage(), e);
            throw new RuntimeException(e);
        }
    });
}