### Question:
GitTagTask extends AbstractTask { @Override public Optional<String> run() { try { Ref tag = GitUtils.tag(gitDir, appBuildContext.getTagName(), ""); return Optional.of(tag.getObjectId().getName()); } catch (GitTagFailedException e) { appBuildContext.error(e); return Optional.empty(); } } GitTagTask(AppBuildContext appBuildContext); @Override Optional<String> run(); boolean exists();  }### Answer:
@Test public void tag_success(@TempDir Path tempDir) throws IOException { Path folder = Files.createDirectory(tempDir.resolve(gitRepoDirectory)); AppBuildContext context = new AppBuildContext( folder.toString(), "c:/Users/Administrator/.m2", null, "jack", "app", "0.0.1", "description", "jdk_version"); GitUtils.init(context.getGitRepositoryDirectory(), "jack", "a@a.com"); GitTagTask task = new GitTagTask(context); assertThat(task.run()).isPresent(); }