Grails Spock failed to create object for Mocked class
<p>I have readCSV() method in Microsoft365Offer, that I have mocked. But due to that I can't create object of Microsoft365Offer class.</p>

<pre><code>GroovyMock(Microsoft365Offer, global: true)

            Microsoft365Offer.readCSV(_,_) &gt;&gt; {
                Microsoft365Offer microsoft365Offer =  new Microsoft365Offer(
                        "name"                  : "any thing as product name",
                        "offerURI"              : "4A-FAEA24541538",
                        "resellerPrice"         : 1.6,
                        "fob"                   : 1.41,
                        "includedQuantities"    : 0,
                        "minimumValue"          : 0,
                        "taxesPISD"             : 0,
                        "defaultTaxesISS"       : 0)

                println "=====coming in here========$microsoft365Offer"
                return ["1":microsoft365Offer ]
            }
</code></pre>

<p>Output =====coming in here========null</p>

<p>How I can resolve this issue? Thanks in advance.</p>