Changed Mockito usage

This commit is contained in:
Marcin Grzejszczak
2021-07-14 17:12:00 +02:00
parent 5b8b1c9ef3
commit 2bbdcba700
2 changed files with 2 additions and 10 deletions

View File

@@ -16,8 +16,7 @@
package org.springframework.cloud.contract.stubrunner.messaging.amqp
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import spock.lang.Specification
import org.springframework.beans.factory.annotation.Autowired
@@ -37,9 +36,6 @@ class AmqpStubRunnerRabbitListenerSpec extends Specification {
@Autowired
MessageSubscriberRabbitListener messageSubscriber
@Captor
ArgumentCaptor<Person> personArgumentCaptor
def "should trigger stub amqp message consumed by annotated listener"() {
when:
stubTrigger.trigger("contract-test.person.created.event")

View File

@@ -17,17 +17,14 @@
package org.springframework.cloud.contract.stubrunner.messaging.amqp
import org.mockito.ArgumentCaptor
import org.mockito.Captor
import spock.lang.Specification
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootContextLoader
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.mock.mockito.SpyBean
import org.springframework.cloud.contract.spec.Contract
import org.springframework.cloud.contract.stubrunner.StubTrigger
import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner
import org.springframework.test.context.ContextConfiguration
import static org.mockito.BDDMockito.then
@@ -41,8 +38,7 @@ class AmqpStubRunnerSpec extends Specification {
@SpyBean
MessageSubscriber messageSubscriber
@Captor
ArgumentCaptor<Person> personArgumentCaptor
ArgumentCaptor<Person> personArgumentCaptor = ArgumentCaptor.forClass(Person)
def "should trigger stub amqp message"() {
given: