Polishing
This commit is contained in:
parent
736bf1c502
commit
86580b2358
|
@ -4,8 +4,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
|
||||
/**
|
||||
|
@ -22,20 +21,20 @@ class BeanFactoryExtensionsTests {
|
|||
@Test
|
||||
fun `getBean with KClass`() {
|
||||
bf.getBean(Foo::class)
|
||||
verify(bf, Mockito.times(1)).getBean(Foo::class.java)
|
||||
verify(bf, times(1)).getBean(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBean with reified type parameters`() {
|
||||
bf.getBean<Foo>()
|
||||
verify(bf, Mockito.times(1)).getBean(Foo::class.java)
|
||||
verify(bf, times(1)).getBean(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBean with String and reified type parameters`() {
|
||||
val name = "foo"
|
||||
bf.getBean<Foo>(name)
|
||||
verify(bf, Mockito.times(1)).getBean(name, Foo::class.java)
|
||||
verify(bf, times(1)).getBean(name, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -43,7 +42,7 @@ class BeanFactoryExtensionsTests {
|
|||
val arg1 = "arg1"
|
||||
val arg2 = "arg2"
|
||||
bf.getBean(Foo::class, arg1, arg2)
|
||||
verify(bf, Mockito.times(1)).getBean(Foo::class.java, arg1, arg2)
|
||||
verify(bf, times(1)).getBean(Foo::class.java, arg1, arg2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -51,7 +50,7 @@ class BeanFactoryExtensionsTests {
|
|||
val arg1 = "arg1"
|
||||
val arg2 = "arg2"
|
||||
bf.getBean<Foo>(arg1, arg2)
|
||||
verify(bf, Mockito.times(1)).getBean(Foo::class.java, arg1, arg2)
|
||||
verify(bf, times(1)).getBean(Foo::class.java, arg1, arg2)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -4,7 +4,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ import org.mockito.junit.MockitoJUnitRunner
|
|||
* @author Sebastien Deleuze
|
||||
*/
|
||||
@RunWith(MockitoJUnitRunner::class)
|
||||
class ListenableBeanFactoryExtensionsTests {
|
||||
class ListableBeanFactoryExtensionsTests {
|
||||
|
||||
@Mock(answer = Answers.RETURNS_MOCKS)
|
||||
lateinit var lbf: ListableBeanFactory
|
||||
|
@ -21,111 +21,111 @@ class ListenableBeanFactoryExtensionsTests {
|
|||
@Test
|
||||
fun `getBeanNamesForType with KClass`() {
|
||||
lbf.getBeanNamesForType(Foo::class)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, true , true)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, true , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForType with KClass and Boolean`() {
|
||||
lbf.getBeanNamesForType(Foo::class, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, false , true)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, false , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForType with KClass, Boolean and Boolean`() {
|
||||
lbf.getBeanNamesForType(Foo::class, false, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, false , false)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, false , false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForType with reified type parameters`() {
|
||||
lbf.getBeanNamesForType<Foo>()
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, true , true)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, true , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForType with reified type parameters and Boolean`() {
|
||||
lbf.getBeanNamesForType<Foo>(false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, false , true)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, false , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForType with reified type parameters, Boolean and Boolean`() {
|
||||
lbf.getBeanNamesForType<Foo>(false, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForType(Foo::class.java, false , false)
|
||||
verify(lbf, times(1)).getBeanNamesForType(Foo::class.java, false , false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with KClass`() {
|
||||
lbf.getBeansOfType(Foo::class)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, true , true)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, true , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with KClass and Boolean`() {
|
||||
lbf.getBeansOfType(Foo::class, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, false , true)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, false , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with KClass, Boolean and Boolean`() {
|
||||
lbf.getBeansOfType(Foo::class, false, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, false , false)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, false , false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with reified type parameters`() {
|
||||
lbf.getBeansOfType<Foo>()
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, true , true)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, true , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with reified type parameters and Boolean`() {
|
||||
lbf.getBeansOfType<Foo>(false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, false , true)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, false , true)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansOfType with reified type parameters, Boolean and Boolean`() {
|
||||
lbf.getBeansOfType<Foo>(false, false)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansOfType(Foo::class.java, false , false)
|
||||
verify(lbf, times(1)).getBeansOfType(Foo::class.java, false , false)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForAnnotation with KClass`() {
|
||||
lbf.getBeanNamesForAnnotation(Bar::class)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForAnnotation(Bar::class.java)
|
||||
verify(lbf, times(1)).getBeanNamesForAnnotation(Bar::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeanNamesForAnnotation with reified type parameters`() {
|
||||
lbf.getBeanNamesForAnnotation<Bar>()
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeanNamesForAnnotation(Bar::class.java)
|
||||
verify(lbf, times(1)).getBeanNamesForAnnotation(Bar::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansWithAnnotation with KClass`() {
|
||||
lbf.getBeansWithAnnotation(Bar::class)
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansWithAnnotation(Bar::class.java)
|
||||
verify(lbf, times(1)).getBeansWithAnnotation(Bar::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getBeansWithAnnotation with reified type parameters`() {
|
||||
lbf.getBeansWithAnnotation<Bar>()
|
||||
Mockito.verify(lbf, Mockito.times(1)).getBeansWithAnnotation(Bar::class.java)
|
||||
verify(lbf, times(1)).getBeansWithAnnotation(Bar::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `findAnnotationOnBean with String and KClass`() {
|
||||
val name = "bar"
|
||||
lbf.findAnnotationOnBean(name, Bar::class)
|
||||
Mockito.verify(lbf, Mockito.times(1)).findAnnotationOnBean(name, Bar::class.java)
|
||||
verify(lbf, times(1)).findAnnotationOnBean(name, Bar::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `findAnnotationOnBean with String and reified type parameters`() {
|
||||
val name = "bar"
|
||||
lbf.findAnnotationOnBean<Bar>(name)
|
||||
Mockito.verify(lbf, Mockito.times(1)).findAnnotationOnBean(name, Bar::class.java)
|
||||
verify(lbf, times(1)).findAnnotationOnBean(name, Bar::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -38,7 +38,7 @@ class KotlinAutowiredTests {
|
|||
bpp.setBeanFactory(bf)
|
||||
bf.addBeanPostProcessor(bpp)
|
||||
var bd = RootBeanDefinition(KotlinBean::class.java)
|
||||
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE)
|
||||
bd.scope = RootBeanDefinition.SCOPE_PROTOTYPE
|
||||
bf.registerBeanDefinition("annotatedBean", bd)
|
||||
var tb = TestBean()
|
||||
bf.registerSingleton("testBean", tb)
|
||||
|
@ -56,7 +56,7 @@ class KotlinAutowiredTests {
|
|||
bpp.setBeanFactory(bf)
|
||||
bf.addBeanPostProcessor(bpp)
|
||||
var bd = RootBeanDefinition(KotlinBean::class.java)
|
||||
bd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE)
|
||||
bd.scope = RootBeanDefinition.SCOPE_PROTOTYPE
|
||||
bf.registerBeanDefinition("annotatedBean", bd)
|
||||
|
||||
var kb = bf.getBean("annotatedBean", KotlinBean::class.java)
|
||||
|
|
|
@ -5,8 +5,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
import org.springframework.http.HttpEntity
|
||||
import org.springframework.http.HttpMethod
|
||||
|
@ -30,7 +29,7 @@ class RestOperationsExtensionsTests {
|
|||
val var1 = "var1"
|
||||
val var2 = "var2"
|
||||
template.getForObject<Foo>(url, var1, var2)
|
||||
verify(template, Mockito.times(1)).getForObject(url, Foo::class.java, var1, var2)
|
||||
verify(template, times(1)).getForObject(url, Foo::class.java, var1, var2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -38,14 +37,14 @@ class RestOperationsExtensionsTests {
|
|||
val url = "https://spring.io"
|
||||
val vars = mapOf(Pair("key1", "value1"), Pair("key2", "value2"))
|
||||
template.getForObject<Foo>(url, vars)
|
||||
verify(template, Mockito.times(1)).getForObject(url, Foo::class.java, vars)
|
||||
verify(template, times(1)).getForObject(url, Foo::class.java, vars)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getForObject with reified type parameters and URI`() {
|
||||
val url = URI("https://spring.io")
|
||||
template.getForObject<Foo>(url)
|
||||
verify(template, Mockito.times(1)).getForObject(url, Foo::class.java)
|
||||
verify(template, times(1)).getForObject(url, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -54,7 +53,7 @@ class RestOperationsExtensionsTests {
|
|||
val var1 = "var1"
|
||||
val var2 = "var2"
|
||||
template.getForEntity<Foo>(url, var1, var2)
|
||||
verify(template, Mockito.times(1)).getForEntity(url, Foo::class.java, var1, var2)
|
||||
verify(template, times(1)).getForEntity(url, Foo::class.java, var1, var2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -64,7 +63,7 @@ class RestOperationsExtensionsTests {
|
|||
val var1 = "var1"
|
||||
val var2 = "var2"
|
||||
template.postForObject<Foo>(url, body, var1, var2)
|
||||
verify(template, Mockito.times(1)).postForObject(url, body, Foo::class.java, var1, var2)
|
||||
verify(template, times(1)).postForObject(url, body, Foo::class.java, var1, var2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -73,7 +72,7 @@ class RestOperationsExtensionsTests {
|
|||
val body: Any = "body"
|
||||
val vars = mapOf(Pair("key1", "value1"), Pair("key2", "value2"))
|
||||
template.postForObject<Foo>(url, body, vars)
|
||||
verify(template, Mockito.times(1)).postForObject(url, body, Foo::class.java, vars)
|
||||
verify(template, times(1)).postForObject(url, body, Foo::class.java, vars)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -81,7 +80,7 @@ class RestOperationsExtensionsTests {
|
|||
val url = "https://spring.io"
|
||||
val body: Any = "body"
|
||||
template.postForObject<Foo>(url, body)
|
||||
verify(template, Mockito.times(1)).postForObject(url, body, Foo::class.java)
|
||||
verify(template, times(1)).postForObject(url, body, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -91,7 +90,7 @@ class RestOperationsExtensionsTests {
|
|||
val var1 = "var1"
|
||||
val var2 = "var2"
|
||||
template.postForEntity<Foo>(url, body, var1, var2)
|
||||
verify(template, Mockito.times(1)).postForEntity(url, body, Foo::class.java, var1, var2)
|
||||
verify(template, times(1)).postForEntity(url, body, Foo::class.java, var1, var2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -100,7 +99,7 @@ class RestOperationsExtensionsTests {
|
|||
val body: Any = "body"
|
||||
val vars = mapOf(Pair("key1", "value1"), Pair("key2", "value2"))
|
||||
template.postForEntity<Foo>(url, body, vars)
|
||||
verify(template, Mockito.times(1)).postForEntity(url, body, Foo::class.java, vars)
|
||||
verify(template, times(1)).postForEntity(url, body, Foo::class.java, vars)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -108,7 +107,7 @@ class RestOperationsExtensionsTests {
|
|||
val url = "https://spring.io"
|
||||
val body: Any = "body"
|
||||
template.postForEntity<Foo>(url, body)
|
||||
verify(template, Mockito.times(1)).postForEntity(url, body, Foo::class.java)
|
||||
verify(template, times(1)).postForEntity(url, body, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -119,7 +118,7 @@ class RestOperationsExtensionsTests {
|
|||
val var1 = "var1"
|
||||
val var2 = "var2"
|
||||
template.exchange<Foo>(url, method, entity, var1, var2)
|
||||
verify(template, Mockito.times(1)).exchange(url, method, entity, Foo::class.java, var1, var2)
|
||||
verify(template, times(1)).exchange(url, method, entity, Foo::class.java, var1, var2)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -129,7 +128,7 @@ class RestOperationsExtensionsTests {
|
|||
val entity = mock<HttpEntity<Foo>>()
|
||||
val vars = mapOf(Pair("key1", "value1"), Pair("key2", "value2"))
|
||||
template.exchange<Foo>(url, method, entity, vars)
|
||||
verify(template, Mockito.times(1)).exchange(url, method, entity, Foo::class.java, vars)
|
||||
verify(template, times(1)).exchange(url, method, entity, Foo::class.java, vars)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -138,15 +137,14 @@ class RestOperationsExtensionsTests {
|
|||
val method = HttpMethod.GET
|
||||
val entity = mock<HttpEntity<Foo>>()
|
||||
template.exchange<Foo>(url, method, entity)
|
||||
verify(template, Mockito.times(1)).exchange(url, method, entity, Foo::class.java)
|
||||
verify(template, times(1)).exchange(url, method, entity, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `exchange with reified type parameters, String, HttpEntity`() {
|
||||
val url = "https://spring.io"
|
||||
val entity = mock<RequestEntity<Foo>>()
|
||||
template.exchange<Foo>(entity)
|
||||
verify(template, Mockito.times(1)).exchange(entity, Foo::class.java)
|
||||
verify(template, times(1)).exchange(entity, Foo::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -4,8 +4,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
|
||||
/**
|
||||
|
@ -22,25 +21,25 @@ class ClientResponseExtensionsTests {
|
|||
@Test
|
||||
fun `bodyToMono with KClass`() {
|
||||
response.bodyToMono(Foo::class)
|
||||
verify(response, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(response, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToMono with reified type parameters`() {
|
||||
response.bodyToMono<Foo>()
|
||||
verify(response, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(response, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToFlux with KClass`() {
|
||||
response.bodyToFlux(Foo::class)
|
||||
verify(response, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(response, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToFlux with reified type parameters`() {
|
||||
response.bodyToFlux<Foo>()
|
||||
verify(response, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(response, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -5,8 +5,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
import org.reactivestreams.Publisher
|
||||
|
||||
|
@ -29,55 +28,55 @@ class WebClientExtensionsTests {
|
|||
fun `RequestBodySpec#body with Publisher and reified type parameters`() {
|
||||
val body = mock<Publisher<Foo>>()
|
||||
requestBodySpec.body(body)
|
||||
verify(requestBodySpec, Mockito.times(1)).body(body, Foo::class.java)
|
||||
verify(requestBodySpec, times(1)).body(body, Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#bodyToMono with KClass`() {
|
||||
responseSpec.bodyToMono(Foo::class)
|
||||
verify(responseSpec, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(responseSpec, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#bodyToMono with reified type parameters`() {
|
||||
responseSpec.bodyToMono<Foo>()
|
||||
verify(responseSpec, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(responseSpec, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#bodyToFlux with KClass`() {
|
||||
responseSpec.bodyToFlux(Foo::class)
|
||||
verify(responseSpec, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(responseSpec, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#bodyToFlux with reified type parameters`() {
|
||||
responseSpec.bodyToFlux<Foo>()
|
||||
verify(responseSpec, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(responseSpec, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#toEntity with KClass`() {
|
||||
responseSpec.toEntity(Foo::class)
|
||||
verify(responseSpec, Mockito.times(1)).toEntity(Foo::class.java)
|
||||
verify(responseSpec, times(1)).toEntity(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#toEntity with reified type parameters`() {
|
||||
responseSpec.toEntity<Foo>()
|
||||
verify(responseSpec, Mockito.times(1)).toEntity(Foo::class.java)
|
||||
verify(responseSpec, times(1)).toEntity(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#toEntityList with KClass`() {
|
||||
responseSpec.toEntityList(Foo::class)
|
||||
verify(responseSpec, Mockito.times(1)).toEntityList(Foo::class.java)
|
||||
verify(responseSpec, times(1)).toEntityList(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `ResponseSpec#toEntityList with reified type parameters`() {
|
||||
responseSpec.toEntityList<Foo>()
|
||||
verify(responseSpec, Mockito.times(1)).toEntityList(Foo::class.java)
|
||||
verify(responseSpec, times(1)).toEntityList(Foo::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -4,8 +4,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.verify
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
import org.springframework.web.reactive.function.server.ServerRequest
|
||||
import org.springframework.web.reactive.function.server.bodyToFlux
|
||||
|
@ -25,25 +24,25 @@ class ServerRequestExtensionsTests {
|
|||
@Test
|
||||
fun `bodyToMono with KClass`() {
|
||||
request.bodyToMono(Foo::class)
|
||||
verify(request, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(request, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToMono with reified type parameters`() {
|
||||
request.bodyToMono<Foo>()
|
||||
verify(request, Mockito.times(1)).bodyToMono(Foo::class.java)
|
||||
verify(request, times(1)).bodyToMono(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToFlux with KClass`() {
|
||||
request.bodyToFlux(Foo::class)
|
||||
verify(request, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(request, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bodyToFlux with reified type parameters`() {
|
||||
request.bodyToFlux<Foo>()
|
||||
verify(request, Mockito.times(1)).bodyToFlux(Foo::class.java)
|
||||
verify(request, times(1)).bodyToFlux(Foo::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.junit.Test
|
|||
import org.junit.runner.RunWith
|
||||
import org.mockito.Answers
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito
|
||||
import org.mockito.Mockito.*
|
||||
import org.mockito.junit.MockitoJUnitRunner
|
||||
import org.reactivestreams.Publisher
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ServerResponseExtensionsTests {
|
|||
fun `BodyBuilder#body with Publisher and reified type parameters`() {
|
||||
val body = mock<Publisher<Foo>>()
|
||||
bodyBuilder.body(body)
|
||||
Mockito.verify(bodyBuilder, Mockito.times(1)).body(body, Foo::class.java)
|
||||
verify(bodyBuilder, times(1)).body(body, Foo::class.java)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
|
Loading…
Reference in New Issue