Skip to content
Permalink
Browse files
Merge pull request #13 from bonnetb/patch-1
  • Loading branch information
marcrohlfs committed Jan 10, 2018
2 parents 04f8423 + d261e7c commit b6febe082a523f8ef217aa1693b1540d6b6c1822
@@ -77,6 +77,11 @@ public MavenMetadataParameterValue(String name, String description, String group
this.artifactUrl = artifactUrl;
}

@Override
public Object getValue() {
return getVersion();
}

@Override
public void buildEnvironment(Run<?, ?> build, EnvVars env) {
env.put(getName() + GROUP_ID_SUFFIX, getGroupId());
@@ -195,6 +195,14 @@ public void testGetCurrentArtifactInfoPatternWithoutUrl() {
this.executeTestGetCurrentArtifactInfoPattern(null, "My Label", "Plugin Version: ([\\S]+)", "");
}

@Test
public void testGetValueForPipeline() {
MavenMetadataParameterDefinition definition = new MavenMetadataParameterDefinition("variable", "void", getLocalWebServerUrl(), "com.acme", "single", "jar", "", "", "DESC",
"null", "10", "", "", "", null);
MavenMetadataParameterValue result = (MavenMetadataParameterValue) definition.createValue(null, "1.6-SNAPSHOT");
assertEquals("version","1.6-SNAPSHOT",result.getValue());
}

private void executeTestGetCurrentArtifactInfoPattern(String url, String label, String pattern, String expectedResult) {
MavenMetadataParameterDefinition definition =
new MavenMetadataParameterDefinition("", "", getLocalWebServerUrl(), "", "", "", "", "", "DESC", "", "", url, label, pattern, null);

0 comments on commit b6febe0

Please sign in to comment.