Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import spock.lang.Specification
  2.  
  3.  
  4. class ParsingServiceTest extends Specification {
  5.  
  6. ParsingService parsingService
  7. File file
  8. InputStream inputStream
  9.  
  10. def setup() {
  11. File file = openDocxFile("example")
  12. InputStream inputStream = new FileInputStream(file)
  13. parsingService = new ParsingService()
  14. }
  15.  
  16. def "check if parsing method returns not empty String"() {
  17. given:
  18. parsingService.putFileToParse(inputStream)
  19. when:
  20. String output = parsingService.getParsedFile()
  21. then:
  22. !output.isEmpty()
  23. }
  24.  
  25. def openDocxFile(String fileName) {
  26. new File("src/main/resources/files/" + fileName +".docx")
  27. }
  28.  
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement