Last active
April 13, 2018 20:12
-
-
Save BatuhanKucukali/79e3be25c8b5c7de0ba9393699527e9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootTest | |
class ImageRecognitionServiceTest extends Specification { | |
@Autowired | |
ImageRecognitionService imageRecognitionService | |
def "detect text expected null"() { | |
given: | |
def image = new FileInputStream("src/test/resources/static/amazon-go-shelf.png") | |
when: | |
def text = imageRecognitionService.detectText(image.getBytes()) | |
then: | |
text == null | |
} | |
def "detect text expected text"() { | |
given: | |
def image = new FileInputStream("src/test/resources/static/amazon-go-logo.jpg") | |
when: | |
def text = imageRecognitionService.detectText(image.getBytes()) | |
then: | |
text.contains("amazongo") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment