Cleanup kotlin sources
1. remove unused imports 2. remove redundant semicolon 3. remove empty class body 4. remove redundant 'constructor' keyword 5. remove redundant 'Unit' return type 6. use non-null type if possible See gh-38708
This commit is contained in:
committed by
Moritz Halbritter
parent
4ad9f1174f
commit
ebfbc0ef05
@@ -40,7 +40,7 @@ class DevProfileSecurityConfiguration {
|
||||
|
||||
// tag::customizer[]
|
||||
private fun <T> yourCustomAuthorization(): Customizer<T> {
|
||||
return Customizer.withDefaults<T>()
|
||||
return Customizer.withDefaults()
|
||||
}
|
||||
// end::customizer[]
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class MyProperties {
|
||||
|
||||
var remoteAddress: @NotNull InetAddress? = null
|
||||
|
||||
val security: @Valid Security? = Security()
|
||||
val security: @Valid Security = Security()
|
||||
|
||||
class Security {
|
||||
var username: @NotEmpty String? = null
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.
|
||||
|
||||
import org.springframework.boot.devtools.restart.RestartScope
|
||||
import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.testcontainers.containers.MongoDBContainer
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.boot.docs.features.testcontainers.atdevelopmenttime.dynamicproperties
|
||||
|
||||
import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.test.context.DynamicPropertyRegistry
|
||||
import org.testcontainers.containers.MongoDBContainer
|
||||
|
||||
@@ -27,8 +27,8 @@ class MyContainersConfiguration {
|
||||
@Bean
|
||||
fun monogDbContainer(properties: DynamicPropertyRegistry): MongoDBContainer {
|
||||
var container = MongoDBContainer("mongo:5.0")
|
||||
properties.add("spring.data.mongodb.host", container::getHost);
|
||||
properties.add("spring.data.mongodb.port", container::getFirstMappedPort);
|
||||
properties.add("spring.data.mongodb.host", container::getHost)
|
||||
properties.add("spring.data.mongodb.port", container::getFirstMappedPort)
|
||||
return container
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,4 @@ import org.springframework.boot.testcontainers.context.ImportTestcontainers
|
||||
|
||||
@TestConfiguration(proxyBeanMethods = false)
|
||||
@ImportTestcontainers(MyContainers::class)
|
||||
class MyContainersConfiguration {
|
||||
|
||||
}
|
||||
class MyContainersConfiguration
|
||||
|
||||
@@ -31,7 +31,7 @@ class MyRestClientTests(
|
||||
@Autowired val server: MockRestServiceServer) {
|
||||
|
||||
@Test
|
||||
fun getVehicleDetailsWhenResultIsSuccessShouldReturnDetails(): Unit {
|
||||
fun getVehicleDetailsWhenResultIsSuccessShouldReturnDetails() {
|
||||
server.expect(MockRestRequestMatchers.requestTo("/greet/details"))
|
||||
.andRespond(MockRestResponseCreators.withSuccess("hello", MediaType.TEXT_PLAIN))
|
||||
val greeting = service.callRestService()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.boot.docs.features.testing.springbootapplications.userconfigurationandslicing
|
||||
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing;
|
||||
import org.springframework.data.mongodb.config.EnableMongoAuditing
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableMongoAuditing
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.boot.docs.features.testing.springbootapplications.us
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.test.context.SpringBootTest.UseMainMethod
|
||||
import org.springframework.context.annotation.Import
|
||||
|
||||
@SpringBootTest(useMainMethod = UseMainMethod.ALWAYS)
|
||||
class MyApplicationTests {
|
||||
|
||||
@@ -26,6 +26,6 @@ class MyApplication
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<MyApplication>(*args) {
|
||||
setBannerMode(Banner.Mode.OFF)
|
||||
setAdditionalProfiles("myprofile");
|
||||
setAdditionalProfiles("myprofile")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.boot.docs.features.testing.testcontainers.servicecon
|
||||
|
||||
import org.springframework.boot.test.context.TestConfiguration
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.testcontainers.containers.GenericContainer
|
||||
|
||||
@TestConfiguration(proxyBeanMethods = false)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.docs.web.graphql.runtimewiring;
|
||||
package org.springframework.boot.docs.web.graphql.runtimewiring
|
||||
|
||||
import org.springframework.graphql.data.method.annotation.Argument
|
||||
import org.springframework.graphql.data.method.annotation.QueryMapping
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.boot.docs.web.security.springwebflux
|
||||
import org.springframework.boot.autoconfigure.security.reactive.PathRequest
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.security.config.Customizer
|
||||
import org.springframework.security.config.Customizer.withDefaults
|
||||
import org.springframework.security.config.web.server.ServerHttpSecurity
|
||||
import org.springframework.security.web.server.SecurityWebFilterChain
|
||||
|
||||
Reference in New Issue
Block a user