1
0
mirror of https://github.com/firstBitMarksistskaya/jenkins-lib.git synced 2024-12-12 11:25:04 +02:00

Исправление readFile в тестах

This commit is contained in:
Nikita Fedkin 2021-12-03 17:06:54 +03:00
parent 0e48633cb0
commit e45dba097a
No known key found for this signature in database
GPG Key ID: E7AE91471C6FFE04
2 changed files with 6 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class VersionParser implements Serializable {
return ""
}
def configurationText = steps.readFile(filePath, 'UTF-8')
def configurationText = steps.readFile(filePath)
return version(configurationText, regexp)
}

View File

@ -34,6 +34,11 @@ public class TestUtils {
return FileUtils.readFileToString(new File(file), encoding);
});
when(steps.readFile(anyString())).thenAnswer(invocation -> {
String file = invocation.getArgument(0);
return FileUtils.readFileToString(new File(file), StandardCharsets.UTF_8);
});
when(steps.fileExists(anyString())).thenAnswer(invocation -> {
String file = invocation.getArgument(0);
return new File(file).exists();