当前位置: 首页>>代码示例>>Java>>正文


Java Result.withSuccessMessages方法代码示例

本文整理汇总了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));
}
 
开发者ID:gocd,项目名称:gocd,代码行数:19,代码来源:PluginNotificationServiceTest.java

示例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;
}
 
开发者ID:varchev,项目名称:go-npm-poller,代码行数:12,代码来源:NpmPoller.java

示例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);
}
 
开发者ID:gocd,项目名称:gocd,代码行数:14,代码来源:PluggableScmServiceTest.java


注:本文中的com.thoughtworks.go.plugin.api.response.Result.withSuccessMessages方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。