|
27 | 27 |
|
28 | 28 | import java.io.File; |
29 | 29 | import java.io.IOException; |
30 | | -import java.nio.file.Paths; |
31 | 30 | import java.util.Map; |
32 | 31 | import java.util.Properties; |
33 | 32 |
|
@@ -220,19 +219,19 @@ private void assertShortDescribe(String commitDescribe, String expectedShortDesc |
220 | 219 | public void testCraftPropertiesOutputFileWithRelativePath() throws IOException { |
221 | 220 | GitCommitIdMojo commitIdMojo = new GitCommitIdMojo(); |
222 | 221 | File baseDir = new File("."); |
223 | | - String targetDir = baseDir.getCanonicalPath(); |
224 | | - String generateGitPropertiesFilename = Paths.get(targetDir, "target", "classes", "git.properties").toString(); |
| 222 | + String targetDir = baseDir.getCanonicalPath() + "/"; |
| 223 | + String generateGitPropertiesFilename = "target/classes/git.properties"; |
225 | 224 |
|
226 | 225 | File result = commitIdMojo.craftPropertiesOutputFile(baseDir, generateGitPropertiesFilename); |
227 | | - assertThat(result.getCanonicalPath()).isEqualTo(generateGitPropertiesFilename); |
| 226 | + assertThat(result.getCanonicalPath()).isEqualTo(targetDir + generateGitPropertiesFilename); |
228 | 227 | } |
229 | 228 |
|
230 | 229 | @Test |
231 | 230 | public void testCraftPropertiesOutputFileWithFullPath() throws IOException { |
232 | 231 | GitCommitIdMojo commitIdMojo = new GitCommitIdMojo(); |
233 | 232 | File baseDir = new File("."); |
234 | | - String targetDir = baseDir.getCanonicalPath(); |
235 | | - String generateGitPropertiesFilename = Paths.get(targetDir, "target", "classes", "git.properties").toString(); |
| 233 | + String targetDir = baseDir.getCanonicalPath() + "/"; |
| 234 | + String generateGitPropertiesFilename = targetDir + "target/classes/git.properties"; |
236 | 235 |
|
237 | 236 | File result = commitIdMojo.craftPropertiesOutputFile(baseDir, generateGitPropertiesFilename); |
238 | 237 | assertThat(result.getCanonicalPath()).isEqualTo(generateGitPropertiesFilename); |
|
0 commit comments