Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import spock.lang.Specification
- class ParsingServiceTest extends Specification {
- ParsingService parsingService
- File file
- InputStream inputStream
- def setup() {
- File file = openDocxFile("example")
- InputStream inputStream = new FileInputStream(file)
- parsingService = new ParsingService()
- }
- def "check if parsing method returns not empty String"() {
- given:
- parsingService.putFileToParse(inputStream)
- when:
- String output = parsingService.getParsedFile()
- then:
- !output.isEmpty()
- }
- def openDocxFile(String fileName) {
- new File("src/main/resources/files/" + fileName +".docx")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement