Grails - Apache Tika plugin test-app failure
<p>I'm learning how to use the <code>Apache Tika plugin</code>. I've just copied the code from <a href="https://github.com/dewarim/tikaParser/blob/master/test/unit/tikaParser/TikaServiceSpec.groovy" rel="nofollow">github</a> and I get failure error when unit testing.</p>

<p>This is the <code>unit test</code></p>

<pre><code>import grails.test.mixin.TestFor
import spock.lang.Specification

/**
 * Test for tikaService: try to parse test data.
 */
@TestFor(TikaService)
class TikaServiceSpec extends Specification {

    def 'Parse a word file to XML'() {
        given:
        def file = new File('parserTest.doc')

        when:
        def xml = service.parseFile(file)

        then:
        def doc = new XmlSlurper().parseText(xml)
        doc.body.p.find{
            it.text() == 'This is a simple test document'
        }
    }
}
</code></pre>

<p>This is the error I get.</p>

<pre><code>Running 5 unit tests... 8 of 8
| Failure:  Parse a word file to XML(com.myApp.TikaServiceSpec)
|  Condition not satisfied:
doc.body.p.find{ it.text() == 'This is a simple test document' }
|   |    | |
|   |    | groovy.util.slurpersupport.NoChildren@4c2a4e84
|   |    Tika Parser Test
|   |    This is a simple test document
|   Tika Parser Test
|   This is a simple test document
Tika Parser Test
This is a simple test document
    at com.myApp.TikaServiceSpec.Parse a word file to XML(TikaServiceSpec.groovy:21)
</code></pre>

<p>What am I doing wrong?</p>

<pre><code>dependencies {
    compile('org.apache.tika:tika-core:0.7')
    compile('org.apache.tika:tika-parsers:0.7') { excludes "xercesImpl", "xmlParserAPIs", "xml-apis", "log4j" }
}
</code></pre>