Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #13 from bonnetb/patch-1
  • Loading branch information
marcrohlfs committed Jan 10, 2018
2 parents 04f8423 + d261e7c commit b6febe0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Expand Up @@ -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());
Expand Down
Expand Up @@ -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);
Expand Down

0 comments on commit b6febe0

Please sign in to comment.