Skip to content

Commit b5627be

Browse files
authored
Merge pull request #40 from MarkEWaite/prep-for-git-plugin-5.0
Adapt test for git plugin 5.0
2 parents c2d0f8b + 01b9885 commit b5627be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/org/jenkinsci/plugins/workflow/libs/LibraryStepTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ public class LibraryStepTest {
8585
null, null, Collections.<GitSCMExtension>emptyList())));
8686
s.setChangelog(false);
8787
r.assertEqualDataBoundBeans(s, stepTester.configRoundTrip(s));
88-
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])");
88+
if (r.jenkins.get().getPlugin("git").getWrapper().getVersion().startsWith("4.")) {
89+
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])");
90+
} else {
91+
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM(scmGit(branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]))");
92+
}
8993
}
9094

9195
@Test public void vars() throws Exception {

0 commit comments

Comments
 (0)