Skip to content

Commit e1ba634

Browse files
authored
Add method overload to equals with diff (#71)
1 parent 20254d9 commit e1ba634

File tree

1 file changed

+2
-4
lines changed
  • src/main/java/com/assertthat/selenium_shutterbug/core

1 file changed

+2
-4
lines changed

src/main/java/com/assertthat/selenium_shutterbug/core/Snapshot.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ public boolean equals(BufferedImage image, double deviation) {
277277
* @return true if the the provided image and current image are strictly equal.
278278
*/
279279
public boolean equalsWithDiff(BufferedImage image, String resultingImagePath) {
280-
if (this.getImage() == image) return true;
281-
return getImage() != null ? ImageProcessor.imagesAreEqualsWithDiff(getImage(), image, resultingImagePath, 0) : image == null;
280+
return equalsWithDiff(image, resultingImagePath,0);
282281
}
283282

284283
/**
@@ -298,8 +297,7 @@ public boolean equalsWithDiff(BufferedImage image, String resultingImagePath, do
298297
* @return true if the the provided image and current image are strictly equal.
299298
*/
300299
public boolean equalsWithDiff(Snapshot image, String resultingImagePath) {
301-
if (this == image) return true;
302-
return getImage() != null ? ImageProcessor.imagesAreEqualsWithDiff(getImage(), image.getImage(),resultingImagePath, 0) : image == null;
300+
return equalsWithDiff(image, resultingImagePath,0);
303301
}
304302

305303
/**

0 commit comments

Comments
 (0)