mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2024-12-12 11:25:04 +02:00
Исправление readFile в тестах
This commit is contained in:
parent
0e48633cb0
commit
e45dba097a
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user