Skip to content

Instantly share code, notes, and snippets.

@BatuhanKucukali
Last active April 13, 2018 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BatuhanKucukali/79e3be25c8b5c7de0ba9393699527e9c to your computer and use it in GitHub Desktop.
Save BatuhanKucukali/79e3be25c8b5c7de0ba9393699527e9c to your computer and use it in GitHub Desktop.
@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