Browse Source

Update Kotlin Test Usage

Issue gh-13539
pull/13553/head
Josh Cummings 2 years ago
parent
commit
cf79af2386
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
  1. 18
      config/src/test/kotlin/org/springframework/security/config/annotation/web/AuthorizeHttpRequestsDslTests.kt
  2. 24
      config/src/test/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDslTests.kt
  3. 6
      config/src/test/kotlin/org/springframework/security/config/annotation/web/CsrfDslTests.kt
  4. 3
      config/src/test/kotlin/org/springframework/security/config/annotation/web/HttpBasicDslTests.kt
  5. 4
      config/src/test/kotlin/org/springframework/security/config/annotation/web/OAuth2LoginDslTests.kt
  6. 4
      core/src/main/java/org/springframework/security/access/prepost/PrePostAdviceReactiveMethodInterceptor.java

18
config/src/test/kotlin/org/springframework/security/config/annotation/web/AuthorizeHttpRequestsDslTests.kt

@ -124,11 +124,13 @@ class AuthorizeHttpRequestsDslTests { @@ -124,11 +124,13 @@ class AuthorizeHttpRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path(): String {
return "ok"
}
@RequestMapping("/onlyPostPermitted")
fun onlyPostPermitted() {
fun onlyPostPermitted():String {
return "ok"
}
}
}
@ -274,7 +276,8 @@ class AuthorizeHttpRequestsDslTests { @@ -274,7 +276,8 @@ class AuthorizeHttpRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index(): String {
return "ok"
}
}
@ -340,7 +343,8 @@ class AuthorizeHttpRequestsDslTests { @@ -340,7 +343,8 @@ class AuthorizeHttpRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index(): String {
return "ok"
}
}
@ -405,7 +409,8 @@ class AuthorizeHttpRequestsDslTests { @@ -405,7 +409,8 @@ class AuthorizeHttpRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index(): String {
return "ok"
}
}
@ -471,7 +476,8 @@ class AuthorizeHttpRequestsDslTests { @@ -471,7 +476,8 @@ class AuthorizeHttpRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index(): String {
return "ok"
}
}

24
config/src/test/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDslTests.kt

@ -114,11 +114,13 @@ class AuthorizeRequestsDslTests { @@ -114,11 +114,13 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path(): String {
return "ok"
}
@RequestMapping("/onlyPostPermitted")
fun onlyPostPermitted() {
fun onlyPostPermitted(): String {
return "ok"
}
}
}
@ -171,7 +173,8 @@ class AuthorizeRequestsDslTests { @@ -171,7 +173,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path(): String {
return "ok"
}
}
}
@ -327,7 +330,8 @@ class AuthorizeRequestsDslTests { @@ -327,7 +330,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index():String {
return "ok"
}
}
@ -398,7 +402,8 @@ class AuthorizeRequestsDslTests { @@ -398,7 +402,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@GetMapping("/")
fun index() {
fun index():String {
return "ok"
}
}
@ -461,7 +466,8 @@ class AuthorizeRequestsDslTests { @@ -461,7 +466,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path():String {
return "ok"
}
}
}
@ -484,7 +490,8 @@ class AuthorizeRequestsDslTests { @@ -484,7 +490,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path(): String {
return "ok"
}
}
}
@ -522,7 +529,8 @@ class AuthorizeRequestsDslTests { @@ -522,7 +529,8 @@ class AuthorizeRequestsDslTests {
@RestController
internal class PathController {
@RequestMapping("/path")
fun path() {
fun path(): String {
return "ok"
}
}
}

6
config/src/test/kotlin/org/springframework/security/config/annotation/web/CsrfDslTests.kt

@ -290,11 +290,13 @@ class CsrfDslTests { @@ -290,11 +290,13 @@ class CsrfDslTests {
@RestController
internal class BasicController {
@PostMapping("/test1")
fun test1() {
fun test1():String {
return "ok"
}
@PostMapping("/test2")
fun test2() {
fun test2():String {
return "ok"
}
}

3
config/src/test/kotlin/org/springframework/security/config/annotation/web/HttpBasicDslTests.kt

@ -217,7 +217,8 @@ class HttpBasicDslTests { @@ -217,7 +217,8 @@ class HttpBasicDslTests {
@RestController
class MainController {
@GetMapping("/")
fun main() {
fun main():String {
return "ok"
}
}
}

4
config/src/test/kotlin/org/springframework/security/config/annotation/web/OAuth2LoginDslTests.kt

@ -128,7 +128,9 @@ class OAuth2LoginDslTests { @@ -128,7 +128,9 @@ class OAuth2LoginDslTests {
@RestController
class LoginController {
@GetMapping("/custom-login")
fun loginPage() { }
fun loginPage():String {
return "ok"
}
}
}

4
core/src/main/java/org/springframework/security/access/prepost/PrePostAdviceReactiveMethodInterceptor.java

@ -201,8 +201,8 @@ public class PrePostAdviceReactiveMethodInterceptor implements MethodInterceptor @@ -201,8 +201,8 @@ public class PrePostAdviceReactiveMethodInterceptor implements MethodInterceptor
return ReactiveFlowKt.asFlow(publisher);
}
private static Object awaitSingleOrNull(Publisher<?> publisher, Object continuation) {
return MonoKt.awaitSingleOrNull(publisher, (Continuation<?>) continuation);
private static Object awaitSingleOrNull(Mono<?> publisher, Object continuation) {
return MonoKt.awaitSingleOrNull(publisher, (Continuation<Object>) continuation);
}
}

Loading…
Cancel
Save