Skip to content

Commit 26d7fbc

Browse files
committed
Fix GitCommitIdPluginIntegrationTest failing due to unexpected commit id mode
`CommitIdGenerationMode.FLAT` is the default but some of the tests seem to erroneously expect the full format by default. This was previously not detected because that test class was using `assertThat` incorrectly.
1 parent 4c1b3a7 commit 26d7fbc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/java/pl/project13/core/GitCommitIdPluginIntegrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void shouldIncludeExpectedProperties(boolean useNativeGit) throws Excepti
8585
assertThat(properties).containsKeys(
8686
"git.branch",
8787
"git.dirty",
88-
"git.commit.id.full",
88+
"git.commit.id",
8989
"git.commit.id.abbrev",
9090
"git.build.user.name",
9191
"git.build.user.email",
@@ -131,7 +131,7 @@ public void shouldExcludeAsConfiguredProperties(boolean useNativeGit) throws Exc
131131
// these stay
132132
assertThat(properties).containsKeys(
133133
"git.branch",
134-
"git.commit.id.full",
134+
"git.commit.id",
135135
"git.commit.id.abbrev",
136136
"git.commit.message.full",
137137
"git.commit.message.short",
@@ -149,7 +149,7 @@ public void shouldIncludeOnlyAsConfiguredProperties(boolean useNativeGit) throws
149149
new GitCommitIdTestCallback()
150150
.setDotGitDirectory(dotGitDirectory)
151151
.setUseNativeGit(useNativeGit)
152-
.setIncludeOnlyProperties(Arrays.asList("git.remote.origin.url", ".*.user.*", "^git.commit.id.full$"))
152+
.setIncludeOnlyProperties(Arrays.asList("git.remote.origin.url", ".*.user.*", "^git.commit.id$"))
153153
.build();
154154
Properties properties = new Properties();
155155

@@ -163,7 +163,7 @@ public void shouldIncludeOnlyAsConfiguredProperties(boolean useNativeGit) throws
163163
assertThat(properties).containsKeys(
164164
"git.build.user.name",
165165
"git.build.user.email",
166-
"git.commit.id.full",
166+
"git.commit.id",
167167
"git.commit.user.name",
168168
"git.commit.user.email"
169169
);
@@ -214,7 +214,7 @@ public void shouldExcludeAndIncludeAsConfiguredProperties(boolean useNativeGit)
214214
// these excluded
215215
assertThat(properties).doesNotContainKeys(
216216
"git.branch",
217-
"git.commit.id.full",
217+
"git.commit.id",
218218
"git.commit.id.abbrev",
219219
"git.commit.message.full",
220220
"git.commit.message.short",
@@ -1578,7 +1578,7 @@ private void assertGitPropertiesPresentInProject(Properties properties) {
15781578
"git.build.time",
15791579
"git.build.host",
15801580
"git.branch",
1581-
"git.commit.id.full",
1581+
"git.commit.id",
15821582
"git.commit.id.abbrev",
15831583
"git.commit.id.describe",
15841584
"git.build.user.name",

0 commit comments

Comments
 (0)