@Before public void setUp() throws Exception { initMocks(this); scmExtension = new SCMExtension(pluginManager); scmExtension.getPluginSettingsMessageHandlerMap().put("1.0", pluginSettingsJSONMessageHandler); scmExtension.getMessageHandlerMap().put("1.0", jsonMessageHandler); pluginSettingsConfiguration = new PluginSettingsConfiguration(); scmPropertyConfiguration = new SCMPropertyConfiguration(); materialData = new HashMap<>(); requestArgumentCaptor = ArgumentCaptor.forClass(GoPluginApiRequest.class); when(pluginManager.resolveExtensionVersion(PLUGIN_ID, SCM_EXTENSION, asList("1.0"))).thenReturn("1.0"); when(pluginManager.isPluginOfType(SCM_EXTENSION, PLUGIN_ID)).thenReturn(true); when(pluginManager.submitTo(eq(PLUGIN_ID), eq(SCM_EXTENSION), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success(responseBody)); }