public Result checkout(String pluginId, final SCMPropertyConfiguration scmConfiguration, final String destinationFolder, final SCMRevision revision) {
        return pluginRequestHelper.submitRequest(pluginId, SCMExtension.REQUEST_CHECKOUT, new DefaultPluginInteractionCallback<>() {
            @Override
            public String requestBody(String resolvedExtensionVersion) {
                return messageHandlerMap.get(resolvedExtensionVersion).requestMessageForCheckout(scmConfiguration, destinationFolder, revision);
            }

            @Override
            public Result onSuccess(String responseBody, Map<String, String> responseHeaders, String resolvedExtensionVersion) {
                return messageHandlerMap.get(resolvedExtensionVersion).responseMessageForCheckout(responseBody);
            }
        });
    }
@Test
    public void shouldTalkToPluginToCheckout() throws Exception {
        String destination = "destination";
        SCMRevision revision = new SCMRevision();
        when(jsonMessageHandler.requestMessageForCheckout(scmPropertyConfiguration, destination, revision)).thenReturn(requestBody);
        Result deserializedResponse = new Result();
        when(jsonMessageHandler.responseMessageForCheckout(responseBody)).thenReturn(deserializedResponse);

        Result response = scmExtension.checkout(PLUGIN_ID, scmPropertyConfiguration, destination, revision);

        assertRequest(requestArgumentCaptor.getValue(), SCM_EXTENSION, "1.0", SCMExtension.REQUEST_CHECKOUT, requestBody);
        verify(jsonMessageHandler).requestMessageForCheckout(scmPropertyConfiguration, destination, revision);
        verify(jsonMessageHandler).responseMessageForCheckout(responseBody);
        assertSame(response, deserializedResponse);
    }