fixing sonar
This commit is contained in:
parent
e5c724e2eb
commit
6e74272258
2 changed files with 9 additions and 1 deletions
|
@ -0,0 +1,7 @@
|
|||
package com.provectus.kafka.ui.screenshots;
|
||||
|
||||
public class NoReferenceScreenshotFoundException extends Throwable {
|
||||
public NoReferenceScreenshotFoundException(String name) {
|
||||
super(("no reference screenshot found for %s".formatted(name)));
|
||||
}
|
||||
}
|
|
@ -56,6 +56,7 @@ public class Screenshooter {
|
|||
compareScreenshots(name, false);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public void compareScreenshots(String name, boolean shouldUpdateScreenshotIfDiffer) {
|
||||
if (TURN_OFF_SCREENSHOTS) {
|
||||
return;
|
||||
|
@ -64,7 +65,7 @@ public class Screenshooter {
|
|||
if (SHOULD_SAVE_SCREENSHOTS_IF_NOT_EXIST) {
|
||||
updateActualScreenshot(name);
|
||||
} else {
|
||||
fail("no reference screenshot found for %s".formatted(name));
|
||||
throw new NoReferenceScreenshotFoundException(name);
|
||||
}
|
||||
} else {
|
||||
makeImageDiff(name, shouldUpdateScreenshotIfDiffer);
|
||||
|
|
Loading…
Add table
Reference in a new issue