ReleaseUtil { public static String getNextDevelopmentVersion(String version, Optional<String> defaultDevelopmentVersion, Optional<Prompter> prompter, VersionUpgradeStrategy upgradeStrategy) { if (defaultDevelopmentVersion.isPresent()) { return defaultDevelopmentVersion.get(); } String devVersion = MavenVersionUtil.calculateNextSnapshotVersion(version, upgradeStrategy); if (prompter.isPresent()) { try { devVersion = prompter.get().prompt("Please specify the next development version", devVersion); } catch (PrompterException e) { } } return devVersion; }  static String getReleaseVersion(String version, Optional<String> defaultReleaseVersion,
      Optional<Prompter> prompter); static String getNextDevelopmentVersion(String version, Optional<String> defaultDevelopmentVersion,
      Optional<Prompter> prompter, VersionUpgradeStrategy upgradeStrategy); static String getTagName(String pattern, MavenProject project, PluginParameterExpressionEvaluator evaluator); static boolean isIntegrationtest(); static File getMavenHome(Optional<String> userDefined);  }
@Test @DataProvider({ "1-SNAPSHOT,null,2-SNAPSHOT", "1.0.0-SNAPSHOT,null,1.0.1-SNAPSHOT", "3.1,null,3.2-SNAPSHOT", "3.Alpha1-SNAPSHOT,null,3.Alpha2-SNAPSHOT", "2.4,3-SNAPSHOT,3-SNAPSHOT", "2.1.Alpha-SNAPSHOT,null,2.2.Alpha-SNAPSHOT" }) public void testGetNextDevelopmentVersion(String version, String defaultDevVersion, String expected) { Assert.assertEquals(expected, ReleaseUtil.getNextDevelopmentVersion(version, Optional.fromNullable(defaultDevVersion), Optional.<Prompter> absent(), VersionUpgradeStrategy.DEFAULT)); }
@Test @DataProvider({ "1-SNAPSHOT,null,4-SNAPSHOT,4-SNAPSHOT", "2-SNAPSHOT,8-SNAPSHOT,4-SNAPSHOT,8-SNAPSHOT" }) public void testGetNextDevelopmentVersion_Prompter(String version, String defaultReleaseVersion, String userInput, String expected) throws Exception { Prompter prompter = Mockito.mock(Prompter.class); Mockito.when(prompter.prompt((String) Matchers.notNull(), (String) Matchers.notNull())).thenReturn(userInput); Assert.assertEquals(expected, ReleaseUtil.getNextDevelopmentVersion(version, Optional.fromNullable(defaultReleaseVersion), Optional.of(prompter), VersionUpgradeStrategy.DEFAULT)); }