本文整理汇总了Java中com.thoughtworks.go.plugin.api.response.Result.withSuccessMessages方法的典型用法代码示例。如果您正苦于以下问题:Java Result.withSuccessMessages方法的具体用法?Java Result.withSuccessMessages怎么用?Java Result.withSuccessMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.thoughtworks.go.plugin.api.response.Result
的用法示例。
在下文中一共展示了Result.withSuccessMessages方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldNotifyInterestedPluginsCorrectly
import com.thoughtworks.go.plugin.api.response.Result; //导入方法依赖的package包/类
@Test
public void shouldNotifyInterestedPluginsCorrectly() throws Exception {
Result result = new Result();
result.withSuccessMessages("success message");
when(notificationPluginRegistry.getPluginsInterestedIn(PIPELINE_STATUS)).thenReturn(new LinkedHashSet<>(asList(PLUGIN_ID_1, PLUGIN_ID_2)));
when(notificationPluginRegistry.getPluginsInterestedIn(STAGE_STATUS)).thenReturn(new LinkedHashSet<>(asList(PLUGIN_ID_3)));
when(notificationExtension.notify(PLUGIN_ID_1, PIPELINE_STATUS, REQUEST_BODY)).thenReturn(result);
when(notificationExtension.notify(PLUGIN_ID_2, PIPELINE_STATUS, REQUEST_BODY)).thenReturn(result);
PluginNotificationService pluginNotificationService = new PluginNotificationService(notificationExtension, notificationPluginRegistry, serverHealthService);
pluginNotificationService.notifyPlugins(new PluginNotificationMessage(PIPELINE_STATUS, REQUEST_BODY));
verify(notificationExtension).notify(PLUGIN_ID_1, PIPELINE_STATUS, REQUEST_BODY);
verify(notificationExtension).notify(PLUGIN_ID_2, PIPELINE_STATUS, REQUEST_BODY);
verify(notificationExtension, never()).notify(PLUGIN_ID_3, PIPELINE_STATUS, REQUEST_BODY);
verify(serverHealthService, times(2)).removeByScope(any(HealthStateScope.class));
}
示例2: checkConnectionToPackage
import com.thoughtworks.go.plugin.api.response.Result; //导入方法依赖的package包/类
@Override
public Result checkConnectionToPackage(PackageConfiguration packageConfigs, RepositoryConfiguration repoConfigs) {
Result response = checkConnectionToRepository(repoConfigs);
if (!response.isSuccessful()) {
LOGGER.info(response.getMessagesForDisplay());
return response;
}
PackageRevision packageRevision = getLatestRevision(packageConfigs, repoConfigs);
response.withSuccessMessages("Found " + packageRevision.getRevision());
return response;
}
示例3: shouldCheckConnectionToSCM
import com.thoughtworks.go.plugin.api.response.Result; //导入方法依赖的package包/类
@Test
public void shouldCheckConnectionToSCM() {
Configuration configuration = new Configuration(ConfigurationPropertyMother.create("KEY1"));
SCM modifiedSCM = new SCM("scm-id", new PluginConfiguration(pluginId, "1"), configuration);
Result expectedResult = new Result();
expectedResult.withSuccessMessages(Arrays.asList("message"));
when(scmExtension.checkConnectionToSCM(eq(modifiedSCM.getPluginConfiguration().getId()), any(SCMPropertyConfiguration.class))).thenReturn(expectedResult);
Result gotResult = pluggableScmService.checkConnection(modifiedSCM);
verify(scmExtension).checkConnectionToSCM(eq(modifiedSCM.getPluginConfiguration().getId()), any(SCMPropertyConfiguration.class));
assertSame(expectedResult, gotResult);
}