@Override
    public List<PluginConfiguration> getSecretsConfigMetadata(String pluginId) {
        return pluginRequestHelper.submitRequest(pluginId, REQUEST_GET_SECRETS_CONFIG_METADATA,
            new DefaultPluginInteractionCallback<>() {
                @Override
                public List<PluginConfiguration> onSuccess(String responseBody, Map<String, String> responseHeaders,
                                                           String resolvedExtensionVersion) {
                    return secretsMessageConverterV1.getSecretsConfigMetadataFromResponse(responseBody);
                }
            });
    }
@Test
    void shouldTalkToPlugin_toFetchSecretsConfigMetadata() {
        String responseBody = "[{\"key\":\"Username\",\"metadata\":{\"required\":true,\"secure\":false}},{\"key\":\"Password\",\"metadata\":{\"required\":true,\"secure\":true}}]";
        when(pluginManager.submitTo(eq(PLUGIN_ID), eq(SECRETS_EXTENSION), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success(responseBody));

        final List<PluginConfiguration> metadata = secretsExtensionV1.getSecretsConfigMetadata(PLUGIN_ID);

        assertThat(metadata).hasSize(2);
        assertThat(metadata).contains(new PluginConfiguration("Username", new Metadata(true, false)), new PluginConfiguration("Password", new Metadata(true, true)));

        assertExtensionRequest(REQUEST_GET_SECRETS_CONFIG_METADATA, null);
    }