本文整理汇总了Java中com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty类的典型用法代码示例。如果您正苦于以下问题:Java PackageMaterialProperty类的具体用法?Java PackageMaterialProperty怎么用?Java PackageMaterialProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PackageMaterialProperty类属于com.thoughtworks.go.plugin.api.material.packagerepository包,在下文中一共展示了PackageMaterialProperty类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: shouldConstructPackageConfigurationFromApiRepositoryConfiguration
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldConstructPackageConfigurationFromApiRepositoryConfiguration() throws Exception {
RepositoryConfiguration configuration = new RepositoryConfiguration();
configuration.add(new PackageMaterialProperty("k1", "v1").with(Property.SECURE, Boolean.TRUE));
PackageConfigurations packageConfigurations = new PackageConfigurations(configuration);
assertThat(packageConfigurations.list().size(), is(1));
assertThat(packageConfigurations.list().get(0).getKey(), is("k1"));
assertThat(packageConfigurations.list().get(0).getValue(), is("v1"));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.REQUIRED), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.PART_OF_IDENTITY), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.SECURE), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.DISPLAY_NAME), is(""));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.DISPLAY_ORDER), is(0));
}
开发者ID:gocd,项目名称:gocd,代码行数:17,代码来源:PackageConfigurationsTest.java
示例2: shouldConstructPackageConfigurationFromApiPackageConfiguration
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldConstructPackageConfigurationFromApiPackageConfiguration() throws Exception {
com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration configuration = new com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration();
configuration.add(new PackageMaterialProperty("k1", "v1").with(Property.SECURE, Boolean.TRUE));
PackageConfigurations packageConfigurations = new PackageConfigurations(configuration);
assertThat(packageConfigurations.list().size(), is(1));
assertThat(packageConfigurations.list().get(0).getKey(), is("k1"));
assertThat(packageConfigurations.list().get(0).getValue(), is("v1"));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.REQUIRED), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.PART_OF_IDENTITY), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.SECURE), is(true));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.DISPLAY_NAME), is(""));
assertThat(packageConfigurations.list().get(0).getOption(PackageConfiguration.DISPLAY_ORDER), is(0));
}
开发者ID:gocd,项目名称:gocd,代码行数:17,代码来源:PackageConfigurationsTest.java
示例3: setUp
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
extension = mock(PackageRepositoryExtension.class);
com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageSettings = new com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration();
packageSettings.add(new PackageMaterialProperty("username", null).with(Property.REQUIRED, true).with(Property.SECURE, false).with(Property.PART_OF_IDENTITY, false).with(Property.DISPLAY_NAME, "foo").with(Property.DISPLAY_ORDER, 1));
packageSettings.add(new PackageMaterialProperty("password", null).with(Property.REQUIRED, true).with(Property.SECURE, true).with(Property.DISPLAY_ORDER, 2));
RepositoryConfiguration repoSettings = new RepositoryConfiguration();
repoSettings.add(new PackageMaterialProperty("foo", null).with(Property.REQUIRED, true).with(Property.SECURE, false).with(Property.DISPLAY_ORDER, 1));
repoSettings.add(new PackageMaterialProperty("bar", null).with(Property.REQUIRED, true).with(Property.SECURE, true).with(Property.DISPLAY_ORDER, 2));
stub(extension.getPackageConfiguration("plugin1")).toReturn(packageSettings);
stub(extension.getRepositoryConfiguration("plugin1")).toReturn(repoSettings);
stub(extension.getPluginSettingsView("plugin1")).toReturn("some-html");
PluginSettingsConfiguration pluginSettingsConfiguration = new PluginSettingsConfiguration();
pluginSettingsConfiguration.add(new PluginSettingsProperty("k1", null).with(Property.REQUIRED, true).with(Property.SECURE, false).with(Property.DISPLAY_ORDER, 3));
stub(extension.getPluginSettingsConfiguration("plugin1")).toReturn(pluginSettingsConfiguration);
}
开发者ID:gocd,项目名称:gocd,代码行数:20,代码来源:PackageMaterialPluginInfoBuilderTest.java
示例4: setUp
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
initMocks(this);
extension = new PackageRepositoryExtension(pluginManager);
pluginSettingsConfiguration = new PluginSettingsConfiguration();
repositoryConfiguration = new RepositoryConfiguration();
repositoryConfiguration.add(new PackageMaterialProperty("key-one", "value-one"));
repositoryConfiguration.add(new PackageMaterialProperty("key-two", "value-two"));
packageConfiguration = new com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration();
packageConfiguration.add(new PackageMaterialProperty("key-three", "value-three"));
packageConfiguration.add(new PackageMaterialProperty("key-four", "value-four"));
requestArgumentCaptor = ArgumentCaptor.forClass(GoPluginApiRequest.class);
when(pluginManager.resolveExtensionVersion(PLUGIN_ID, asList("1.0"))).thenReturn("1.0");
}
开发者ID:gocd,项目名称:gocd,代码行数:19,代码来源:PackageRepositoryExtensionTest.java
示例5: shouldTalkToPluginToGetRepositoryConfiguration
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldTalkToPluginToGetRepositoryConfiguration() throws Exception {
String expectedRequestBody = null;
String expectedResponseBody = "{" +
"\"key-one\":{}," +
"\"key-two\":{\"default-value\":\"two\",\"part-of-identity\":true,\"secure\":true,\"required\":true,\"display-name\":\"display-two\",\"display-order\":\"1\"}," +
"\"key-three\":{\"default-value\":\"three\",\"part-of-identity\":false,\"secure\":false,\"required\":false,\"display-name\":\"display-three\",\"display-order\":\"2\"}" +
"}";
when(pluginManager.isPluginOfType(PACKAGE_MATERIAL_EXTENSION, PLUGIN_ID)).thenReturn(true);
when(pluginManager.submitTo(eq(PLUGIN_ID), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success(expectedResponseBody));
RepositoryConfiguration repositoryConfiguration = extension.getRepositoryConfiguration(PLUGIN_ID);
assertRequest(requestArgumentCaptor.getValue(), PACKAGE_MATERIAL_EXTENSION, "1.0", PackageRepositoryExtension.REQUEST_REPOSITORY_CONFIGURATION, expectedRequestBody);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-one"), "key-one", null, true, true, false, "", 0);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-two"), "key-two", "two", true, true, true, "display-two", 1);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-three"), "key-three", "three", false, false, false, "display-three", 2);
}
开发者ID:gocd,项目名称:gocd,代码行数:21,代码来源:PackageRepositoryExtensionTest.java
示例6: shouldTalkToPluginToGetPackageConfiguration
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldTalkToPluginToGetPackageConfiguration() throws Exception {
String expectedRequestBody = null;
String expectedResponseBody = "{" +
"\"key-one\":{}," +
"\"key-two\":{\"default-value\":\"two\",\"part-of-identity\":true,\"secure\":true,\"required\":true,\"display-name\":\"display-two\",\"display-order\":\"1\"}," +
"\"key-three\":{\"default-value\":\"three\",\"part-of-identity\":false,\"secure\":false,\"required\":false,\"display-name\":\"display-three\",\"display-order\":\"2\"}" +
"}";
when(pluginManager.isPluginOfType(PACKAGE_MATERIAL_EXTENSION, PLUGIN_ID)).thenReturn(true);
when(pluginManager.submitTo(eq(PLUGIN_ID), requestArgumentCaptor.capture())).thenReturn(DefaultGoPluginApiResponse.success(expectedResponseBody));
com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageConfiguration = extension.getPackageConfiguration(PLUGIN_ID);
assertRequest(requestArgumentCaptor.getValue(), PACKAGE_MATERIAL_EXTENSION, "1.0", PackageRepositoryExtension.REQUEST_PACKAGE_CONFIGURATION, expectedRequestBody);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-one"), "key-one", null, true, true, false, "", 0);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-two"), "key-two", "two", true, true, true, "display-two", 1);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-three"), "key-three", "three", false, false, false, "display-three", 2);
}
开发者ID:gocd,项目名称:gocd,代码行数:20,代码来源:PackageRepositoryExtensionTest.java
示例7: shouldFailValidationIfSpuriousPropertiesAreConfigured
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldFailValidationIfSpuriousPropertiesAreConfigured() {
ValidationResult validationResult = new ValidationResult();
PackageConfiguration packageConfigurations = new PackageConfiguration();
RepositoryConfiguration repositoryConfiguration = new RepositoryConfiguration();
packageConfigurations.add(new PackageMaterialProperty("PACKAGE_NAME", "foo"));
packageConfigurations.add(new PackageMaterialProperty("foo1", "foo"));
packageConfigurations.add(new PackageMaterialProperty("foo2", "foo"));
repositoryConfiguration.add(new PackageMaterialProperty("bar1", "bar"));
repositoryConfiguration.add(new PackageMaterialProperty("bar2", "bar"));
repositoryConfiguration.add(new PackageMaterialProperty("REPO_URL", "http://asdsa"));
new DebRepositoryConfiguration().validate(packageConfigurations, repositoryConfiguration, validationResult);
assertThat(validationResult.isSuccessful(), is(false));
assertThat(validationResult.getErrors().contains(new ValidationError("", "Unsupported key(s) found : bar1, bar2. Allowed key(s) are : REPO_URL")), is(true));
assertThat(validationResult.getErrors().contains(new ValidationError("", "Unsupported key(s) found : foo1, foo2. Allowed key(s) are : PACKAGE_NAME, VERSION_SPEC, ARCHITECTURE")), is(true));
}
开发者ID:gocd-contrib,项目名称:deb-repo-poller,代码行数:17,代码来源:DebRepositoryConfigurationTest.java
示例8: shouldThrowExceptionGivenEmptyRepo_getLatestRevision
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldThrowExceptionGivenEmptyRepo_getLatestRevision() throws Exception {
RepositoryConfiguration repositoryPackageConfigurations = new RepositoryConfiguration();
File emptyRepo = new File(getClass().getResource("/repos/emptyrepo").toURI());
repositoryPackageConfigurations.add(new PackageMaterialProperty(Constants.REPO_URL, "file://" + emptyRepo.getAbsolutePath()));
PackageConfiguration packagePackageConfigurations = new PackageConfiguration();
packagePackageConfigurations.add(new PackageMaterialProperty(Constants.PACKAGE_NAME, "crap-artifact"));
try {
poller.getLatestRevision(packagePackageConfigurations, repositoryPackageConfigurations);
fail("");
} catch (RuntimeException e) {
String expectedMessage = "Invalid file path.";
String actualMessage = e.getMessage();
assertThat(actualMessage.startsWith(expectedMessage), is((true)));
}
}
开发者ID:gocd-contrib,项目名称:deb-repo-poller,代码行数:17,代码来源:DebRepositoryPollerTest.java
示例9: shouldRejectUnsupportedTagsInRepoConfig
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldRejectUnsupportedTagsInRepoConfig() {
RepositoryConfiguration repoConfig = new RepositoryConfiguration();
repoConfig.add(new PackageMaterialProperty(RepoUrl.REPO_URL, "http://registry.npmjs.org"));
repoConfig.add(new PackageMaterialProperty("unsupported_key", "value"));
assertForRepositoryConfigurationErrors(
repoConfig,
asList(new ValidationError("Unsupported key: unsupported_key. Valid keys: " + Arrays.toString(NpmRepoConfig.getValidKeys()))),
false);
}
开发者ID:varchev,项目名称:go-npm-poller,代码行数:12,代码来源:PluginConfigTest.java
示例10: shouldRejectUnsupportedTagsInPkgConfig
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldRejectUnsupportedTagsInPkgConfig() {
PackageConfiguration pkgConfig = new PackageConfiguration();
pkgConfig.add(new PackageMaterialProperty(PACKAGE_ID, "abc"));
pkgConfig.add(new PackageMaterialProperty("unsupported_key", "value"));
assertForPackageConfigurationErrors(
pkgConfig,
asList(new ValidationError("Unsupported key: unsupported_key. Valid keys: " + Arrays.toString(NpmPackageConfig.getValidKeys()))),
false);
}
开发者ID:varchev,项目名称:go-npm-poller,代码行数:11,代码来源:PluginConfigTest.java
示例11: assertForPackageConfigurationErrors
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
private void assertForPackageConfigurationErrors(PackageConfiguration packageConfiguration, List<ValidationError> expectedErrors, boolean expectedValidationResult) {
final RepositoryConfiguration repoConfig = new RepositoryConfiguration();
repoConfig.add(new PackageMaterialProperty(RepoUrl.REPO_URL, "http://registry.npmjs.org"));
ValidationResult errors = pluginConfig.isPackageConfigurationValid(packageConfiguration, repoConfig);
assertThat(errors.isSuccessful(), is(expectedValidationResult));
assertThat(errors.getErrors().size(), is(expectedErrors.size()));
assertThat(errors.getErrors().containsAll(expectedErrors), is(true));
}
开发者ID:varchev,项目名称:go-npm-poller,代码行数:9,代码来源:PluginConfigTest.java
示例12: PollerShouldExcuteCorrectCmd
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void PollerShouldExcuteCorrectCmd(){
NpmPoller poller = new NpmPoller();
NpmPoller spy = spy(poller);
RepositoryConfiguration repoCfgs = mock(RepositoryConfiguration.class);
PackageConfiguration pkgCfgs = mock(PackageConfiguration.class);
String repoUrlStr = "http://google.com";//something valid to satisfy connection check
when(repoCfgs.get(RepoUrl.REPO_URL)).thenReturn(new PackageMaterialProperty(RepoUrl.REPO_URL, repoUrlStr));
String user = "user";
when(repoCfgs.get(RepoUrl.USERNAME)).thenReturn(new PackageMaterialProperty(RepoUrl.USERNAME, user));
String password = "passwrod";
when(repoCfgs.get(RepoUrl.PASSWORD)).thenReturn(new PackageMaterialProperty(RepoUrl.PASSWORD, password));
String packageId = "express";
Property property = new PackageMaterialProperty(NpmPackageConfig.PACKAGE_ID, packageId);
when(pkgCfgs.get(NpmPackageConfig.PACKAGE_ID)).thenReturn(property);
PackageRevision dummyResult = new PackageRevision("1.0", new Date(),"user");
RepoUrl repoUrl = RepoUrl.create(repoUrlStr, user, password);
final NpmParams params = new NpmParams(repoUrl, packageId, null, null, null);
Matcher<NpmParams> npmParamsMatcher = new BaseMatcher<NpmParams>() {
NpmParams expected = params;
@Override
public boolean matches(Object item) {
NpmParams npmParams = (NpmParams) item;
return expected.getPackageId().equals(npmParams.getPackageId()) &&
expected.getRepoUrl().equals(npmParams.getRepoUrl());
}
@Override
public void describeTo(Description description) {
description.appendText(expected.getPackageId());
}
};
doReturn(dummyResult).when(spy).poll(argThat(npmParamsMatcher));
//actual test
spy.getLatestRevision(pkgCfgs, repoCfgs);
verify(spy).poll(argThat(npmParamsMatcher));
}
开发者ID:varchev,项目名称:go-npm-poller,代码行数:38,代码来源:NpmPollerTest.java
示例13: getPackageConfiguration
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
/**
* Supply the fields for the package configuration. The package
* configuration extends the repository information with Docker-image
* specific information. This information must be supplied when the material
* is fetched.
*
* @return PackageConfiguration
*/
@Override
public PackageConfiguration getPackageConfiguration() {
PackageConfiguration packageConfiguration = new PackageConfiguration();
packageConfiguration.add(new PackageMaterialProperty(Constants.REPOSITORY).
with(DISPLAY_NAME, "Repository").with(DISPLAY_ORDER, 0));
packageConfiguration.add(new PackageMaterialProperty(Constants.TAG, "latest").
with(REQUIRED, false).with(DISPLAY_NAME, "Tag").with(DISPLAY_ORDER, 1));
return packageConfiguration;
}
开发者ID:decoomanj,项目名称:gocd-docker-material-poller,代码行数:18,代码来源:DockerMaterialConfiguration.java
示例14: shouldRejectUnsupportedTagsInRepoConfig
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldRejectUnsupportedTagsInRepoConfig() {
RepositoryConfiguration repoConfig = new RepositoryConfiguration();
repoConfig.add(new PackageMaterialProperty(RepoUrl.REPO_URL, "http://artifactory.example.org/artifactory"));
repoConfig.add(new PackageMaterialProperty("unsupported_key", "value"));
assertForRepositoryConfigurationErrors(
repoConfig,
asList(new ValidationError("Unsupported key: unsupported_key. Valid keys: " + Arrays.toString(GenericArtifactoryRepoConfig.getValidKeys()))),
false);
}
开发者ID:varchev,项目名称:go-generic-artifactory-poller,代码行数:12,代码来源:PluginConfigTest.java
示例15: shouldRejectUnsupportedTagsInPkgConfig
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldRejectUnsupportedTagsInPkgConfig() {
PackageConfiguration pkgConfig = new PackageConfiguration();
pkgConfig.add(new PackageMaterialProperty(PACKAGE_ID, "abc"));
pkgConfig.add(new PackageMaterialProperty(PACKAGE_PATH, "Path/To/Artifact"));
pkgConfig.add(new PackageMaterialProperty("unsupported_key", "value"));
assertForPackageConfigurationErrors(
pkgConfig,
asList(new ValidationError("Unsupported key: unsupported_key. Valid keys: " + Arrays.toString(GenericArtifactoryPackageConfig.getValidKeys()))),
false);
}
开发者ID:varchev,项目名称:go-generic-artifactory-poller,代码行数:12,代码来源:PluginConfigTest.java
示例16: assertForPackageConfigurationErrors
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
private void assertForPackageConfigurationErrors(PackageConfiguration packageConfiguration, List<ValidationError> expectedErrors, boolean expectedValidationResult) {
final RepositoryConfiguration repoConfig = new RepositoryConfiguration();
repoConfig.add(new PackageMaterialProperty(RepoUrl.REPO_URL, "http://artifactory.example.org/artifactory"));
ValidationResult errors = pluginConfig.isPackageConfigurationValid(packageConfiguration, repoConfig);
assertThat(errors.isSuccessful(), is(expectedValidationResult));
assertThat(errors.getErrors().size(), is(expectedErrors.size()));
assertThat(errors.getErrors().containsAll(expectedErrors), is(true));
}
开发者ID:varchev,项目名称:go-generic-artifactory-poller,代码行数:10,代码来源:PluginConfigTest.java
示例17: configurations
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
private PackageConfiguration configurations(String key, String value) {
PackageConfiguration packageConfiguration = new PackageConfiguration();
packageConfiguration.add(new PackageMaterialProperty(PACKAGE_PATH, "Path/To/Artifact"));
packageConfiguration.add(new PackageMaterialProperty(REPO_ID, "repo-id"));
packageConfiguration.add(new PackageMaterialProperty(key, value));
return packageConfiguration;
}
开发者ID:varchev,项目名称:go-generic-artifactory-poller,代码行数:8,代码来源:PluginConfigTest.java
示例18: setUp
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
messageHandler = new JsonMessageHandler1_0();
repositoryConfiguration = new RepositoryConfiguration();
repositoryConfiguration.add(new PackageMaterialProperty("key-one", "value-one"));
repositoryConfiguration.add(new PackageMaterialProperty("key-two", "value-two"));
packageConfiguration = new PackageConfiguration();
packageConfiguration.add(new PackageMaterialProperty("key-three", "value-three"));
packageConfiguration.add(new PackageMaterialProperty("key-four", "value-four"));
}
开发者ID:gocd,项目名称:gocd,代码行数:12,代码来源:JsonMessageHandler1_0Test.java
示例19: shouldBuildRepositoryConfigurationFromResponseBody
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldBuildRepositoryConfigurationFromResponseBody() throws Exception {
String responseBody = "{" +
"\"key-one\":{}," +
"\"key-two\":{\"default-value\":\"two\",\"part-of-identity\":true,\"secure\":true,\"required\":true,\"display-name\":\"display-two\",\"display-order\":\"1\"}," +
"\"key-three\":{\"default-value\":\"three\",\"part-of-identity\":false,\"secure\":false,\"required\":false,\"display-name\":\"display-three\",\"display-order\":\"2\"}" +
"}";
RepositoryConfiguration repositoryConfiguration = messageHandler.responseMessageForRepositoryConfiguration(responseBody);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-one"), "key-one", null, true, true, false, "", 0);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-two"), "key-two", "two", true, true, true, "display-two", 1);
assertPropertyConfiguration((PackageMaterialProperty) repositoryConfiguration.get("key-three"), "key-three", "three", false, false, false, "display-three", 2);
}
开发者ID:gocd,项目名称:gocd,代码行数:14,代码来源:JsonMessageHandler1_0Test.java
示例20: shouldBuildPackageConfigurationFromResponseBody
import com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty; //导入依赖的package包/类
@Test
public void shouldBuildPackageConfigurationFromResponseBody() throws Exception {
String responseBody = "{" +
"\"key-one\":{}," +
"\"key-two\":{\"default-value\":\"two\",\"part-of-identity\":true,\"secure\":true,\"required\":true,\"display-name\":\"display-two\",\"display-order\":\"1\"}," +
"\"key-three\":{\"default-value\":\"three\",\"part-of-identity\":false,\"secure\":false,\"required\":false,\"display-name\":\"display-three\",\"display-order\":\"2\"}" +
"}";
com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageConfiguration = messageHandler.responseMessageForPackageConfiguration(responseBody);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-one"), "key-one", null, true, true, false, "", 0);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-two"), "key-two", "two", true, true, true, "display-two", 1);
assertPropertyConfiguration((PackageMaterialProperty) packageConfiguration.get("key-three"), "key-three", "three", false, false, false, "display-three", 2);
}
开发者ID:gocd,项目名称:gocd,代码行数:14,代码来源:JsonMessageHandler1_0Test.java
注:本文中的com.thoughtworks.go.plugin.api.material.packagerepository.PackageMaterialProperty类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论