Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
fba5ffc6
Commit
fba5ffc6
authored
Jun 08, 2021
by
Scott Frederick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix FilePermissionsTests on Windows
See gh-26658
parent
8df6392c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
FilePermissionsTests.java
...work/boot/buildpack/platform/io/FilePermissionsTests.java
+14
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/io/FilePermissionsTests.java
View file @
fba5ffc6
...
...
@@ -27,11 +27,15 @@ import java.util.Collections;
import
java.util.Set
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.condition.DisabledOnOs
;
import
org.junit.jupiter.api.condition.EnabledOnOs
;
import
org.junit.jupiter.api.condition.OS
;
import
org.junit.jupiter.api.io.TempDir
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIOException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalArgumentException
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatIllegalStateException
;
/**
* Tests for {@link FilePermissions}.
...
...
@@ -44,6 +48,7 @@ class FilePermissionsTests {
Path
tempDir
;
@Test
@DisabledOnOs
(
OS
.
WINDOWS
)
void
umaskForPath
()
throws
IOException
{
FileAttribute
<
Set
<
PosixFilePermission
>>
fileAttribute
=
PosixFilePermissions
.
asFileAttribute
(
PosixFilePermissions
.
fromString
(
"rw-r-----"
));
...
...
@@ -52,11 +57,20 @@ class FilePermissionsTests {
}
@Test
@DisabledOnOs
(
OS
.
WINDOWS
)
void
umaskForPathWithNonExistentFile
()
throws
IOException
{
assertThatIOException
()
.
isThrownBy
(()
->
FilePermissions
.
umaskForPath
(
Paths
.
get
(
this
.
tempDir
.
toString
(),
"does-not-exist"
)));
}
@Test
@EnabledOnOs
(
OS
.
WINDOWS
)
void
umaskForPathOnWindowsFails
()
throws
IOException
{
Path
tempFile
=
Files
.
createTempFile
(
"umask"
,
null
);
assertThatIllegalStateException
().
isThrownBy
(()
->
FilePermissions
.
umaskForPath
(
tempFile
))
.
withMessageContaining
(
"Unsupported file type for retrieving Posix attributes"
);
}
@Test
void
umaskForPathWithNullPath
()
throws
IOException
{
assertThatIllegalArgumentException
().
isThrownBy
(()
->
FilePermissions
.
umaskForPath
(
null
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment