Skip to content

Commit

Permalink
Merge pull request #533 from jonesbusy/feature/add-title
Browse files Browse the repository at this point in the history
Add missing title for last java 8 update
  • Loading branch information
jonesbusy authored Dec 30, 2024
2 parents 135870b + 3b6ae1d commit f75d736
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe
@param Plugin plugin
@param Recipe recipe
Require ${plugin.getMetadata().getJenkinsVersion()}
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ public void testFriendlyPrTitleUpgradeToLatestJava11CoreVersion() {
assertEquals("Require 2.462.3", result);
}

@Test
public void testFriendlyPrTitleUpgradeToLatestJava8CoreVersion() {

// Mocks
Plugin plugin = mock(Plugin.class);
PluginMetadata metadata = mock(PluginMetadata.class);
Recipe recipe = mock(Recipe.class);

doReturn(metadata).when(plugin).getMetadata();
doReturn("2.346.3").when(metadata).getJenkinsVersion();
doReturn("io.jenkins.tools.pluginmodernizer.UpgradeToLatestJava8CoreVersion")
.when(recipe)
.getName();

// Test
String result = TemplateUtils.renderPullRequestTitle(plugin, recipe);

// Assert
assertEquals("Require 2.346.3", result);
}

@Test
public void testFriendlyPrTitleUpgradeNextMajorParentVersion() {

Expand Down

0 comments on commit f75d736

Please sign in to comment.