Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
@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