mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Mock working directory for extract test
Prior to this change, this test would create files in the project directory. This can cause issues with Gradle caching and up-to-date checks. To address this, the value of the working directory is mocked to a temporary directory like all the other tests. See gh-37395
This commit is contained in:
parent
98acca9633
commit
a2be276dd8
@ -167,6 +167,7 @@ class ExtractCommandTests {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
given(this.context.getArchiveFile()).willReturn(this.jarFile);
|
given(this.context.getArchiveFile()).willReturn(this.jarFile);
|
||||||
|
given(this.context.getWorkingDir()).willReturn(this.extract);
|
||||||
assertThatIllegalStateException()
|
assertThatIllegalStateException()
|
||||||
.isThrownBy(() -> this.command.run(Collections.emptyMap(), Collections.emptyList()))
|
.isThrownBy(() -> this.command.run(Collections.emptyMap(), Collections.emptyList()))
|
||||||
.withMessageContaining("Entry 'e/../../e.jar' would be written");
|
.withMessageContaining("Entry 'e/../../e.jar' would be written");
|
||||||
|
Loading…
Reference in New Issue
Block a user