title: Spock interaction based test: too few invocation on a method
body: <p>I have a method below which is pretty straightforward. It calls another method that soft deletes an API key and then calls another method to create a new one and returns it.</p>
  
  <p>Test is below also which just checks that the two methods were called correctly. But still getting 0 invocation error on both methods though. What causes this problem?</p>
  
  <pre><code>AuthApiKeyPair updateApiKeyPair(AuthApiKeyPair apiKeyPair, Boolean createNewKey) {
  
      AuthApiKeyPair newKeyPair
  
      if (createNewKey) {
          deleteApiKeyPair(apiKeyPair)
  
          //The key will be created with the same info as the previous key.
          newKeyPair = createApiKeyPair(apiKeyPair.label, apiKeyPair.accountMode, apiKeyPair.source)
      }
  
      newKeyPair
  }
  </code></pre>
  
  <p>TEST:</p>
  
  <pre><code>def "should soft delete key pair and create new one"() {
      setup:
      AuthApiKeyPair apiKeyPair = AuthApiKeyPair.build(acquirerId: 123, source: PaymentSource.BOARDING_API, label: 'Boarding API key')
  
      when:
      service.updateApiKeyPair(apiKeyPair, true)
  
      then:
      1 * service.deleteApiKeyPair(apiKeyPair)
      1 * service.createApiKeyPair(apiKeyPair.label, apiKeyPair.accountMode, apiKeyPair.source)
  }
  </code></pre>