Cleanup kotlin sources
1. remove unused import 2. remove redundant semicolon 3. remove redundant empty constructor and SAM-constructor 4. remove unnecessary type argument 5. adjust indent See gh-31913
This commit is contained in:
committed by
Stéphane Nicoll
parent
28a7b6103a
commit
7474af4f09
@@ -281,8 +281,8 @@ class CoRouterFunctionDslTests {
|
||||
listOf(mapOf("foo" to "bar"), mapOf("foo" to "n1")),
|
||||
listOf(mapOf("baz" to "qux"), mapOf("foo" to "n1")),
|
||||
listOf(mapOf("foo" to "n3"), mapOf("foo" to "n2"), mapOf("foo" to "n1"))
|
||||
);
|
||||
assertThat(visitor.visitCount()).isEqualTo(7);
|
||||
)
|
||||
assertThat(visitor.visitCount()).isEqualTo(7)
|
||||
}
|
||||
|
||||
private fun sampleRouter() = coRouter {
|
||||
|
||||
@@ -27,7 +27,6 @@ import org.springframework.http.MediaType.*
|
||||
import org.springframework.web.reactive.function.server.support.ServerRequestWrapper
|
||||
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest.*
|
||||
import org.springframework.web.testfixture.server.MockServerWebExchange
|
||||
import org.springframework.web.reactive.function.server.AttributesTestVisitor
|
||||
import reactor.core.publisher.Mono
|
||||
import reactor.test.StepVerifier
|
||||
import java.security.Principal
|
||||
@@ -167,8 +166,8 @@ class RouterFunctionDslTests {
|
||||
listOf(mapOf("foo" to "bar"), mapOf("foo" to "n1")),
|
||||
listOf(mapOf("baz" to "qux"), mapOf("foo" to "n1")),
|
||||
listOf(mapOf("foo" to "n3"), mapOf("foo" to "n2"), mapOf("foo" to "n1"))
|
||||
);
|
||||
assertThat(visitor.visitCount()).isEqualTo(7);
|
||||
)
|
||||
assertThat(visitor.visitCount()).isEqualTo(7)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -52,7 +52,7 @@ class InvocableHandlerMethodKotlinTests {
|
||||
|
||||
private var exchange = MockServerWebExchange.from(get("http://localhost:8080/path"))
|
||||
|
||||
private val resolvers = mutableListOf<HandlerMethodArgumentResolver>(ContinuationHandlerMethodArgumentResolver(),
|
||||
private val resolvers = mutableListOf(ContinuationHandlerMethodArgumentResolver(),
|
||||
RequestParamMethodArgumentResolver(null, ReactiveAdapterRegistry.getSharedInstance(), false))
|
||||
|
||||
@Test
|
||||
|
||||
@@ -55,7 +55,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Suspending handler method`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/suspend", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/suspend", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foo")
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Handler method returning Deferred`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/deferred", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/deferred", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foo")
|
||||
}
|
||||
@@ -73,7 +73,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Suspending ResponseEntity handler method`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/suspend-response-entity", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/suspend-response-entity", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("{\"value\":\"foo\"}")
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Handler method returning Flow`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/flow", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/flow", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foobar")
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Suspending handler method returning Flow`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/suspending-flow", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/suspending-flow", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foobar")
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
startServer(httpServer)
|
||||
|
||||
assertThatExceptionOfType(HttpServerErrorException.InternalServerError::class.java).isThrownBy {
|
||||
performGet<String>("/error", HttpHeaders.EMPTY, String::class.java)
|
||||
performGet("/error", HttpHeaders.EMPTY, String::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
startServer(httpServer)
|
||||
|
||||
assertThatExceptionOfType(HttpServerErrorException.InternalServerError::class.java).isThrownBy {
|
||||
performGet<String>("/flow-error", HttpHeaders.EMPTY, String::class.java)
|
||||
performGet("/flow-error", HttpHeaders.EMPTY, String::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/entity-flux", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/entity-flux", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foobar")
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
fun `Suspending handler method returning ResponseEntity of Flow`(httpServer: HttpServer) {
|
||||
startServer(httpServer)
|
||||
|
||||
val entity = performGet<String>("/entity-flow", HttpHeaders.EMPTY, String::class.java)
|
||||
val entity = performGet("/entity-flow", HttpHeaders.EMPTY, String::class.java)
|
||||
assertThat(entity.statusCode).isEqualTo(HttpStatus.OK)
|
||||
assertThat(entity.body).isEqualTo("foobar")
|
||||
}
|
||||
@@ -195,7 +195,7 @@ class CoroutinesIntegrationTests : AbstractRequestMappingIntegrationTests() {
|
||||
|
||||
@GetMapping("/entity-flux")
|
||||
suspend fun entityFlux() : ResponseEntity<Flux<String>> {
|
||||
val strings = Flux.just("foo", "bar");
|
||||
val strings = Flux.just("foo", "bar")
|
||||
delay(1)
|
||||
return ResponseEntity.ok().body(strings)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import org.springframework.web.testfixture.server.MockServerWebExchange
|
||||
import reactor.test.StepVerifier
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.time.Duration
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Kotlin unit tests for [AbstractMessageWriterResultHandler].
|
||||
|
||||
Reference in New Issue
Block a user