|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2002-2024 the original author or authors. |
|
|
|
|
* Copyright 2002-2025 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -81,6 +81,12 @@ class BindingReflectionHintsRegistrarKotlinTests {
@@ -81,6 +81,12 @@ class BindingReflectionHintsRegistrarKotlinTests {
|
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection().onType(SampleClass::class.java) |
|
|
|
|
.withMemberCategory(MemberCategory.INTROSPECT_DECLARED_METHODS)).accepts(hints) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
fun `Register reflection hints on serializer function with parameter`() { |
|
|
|
|
bindingRegistrar.registerReflectionHints(hints.reflection(), SampleResult::class.java) |
|
|
|
|
assertThat(RuntimeHintsPredicates.reflection().onMethod(SampleResult.Companion::class.java, "serializer")).accepts(hints) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@kotlinx.serialization.Serializable |
|
|
|
|
@ -89,3 +95,17 @@ class SampleSerializableClass(val name: String)
@@ -89,3 +95,17 @@ class SampleSerializableClass(val name: String)
|
|
|
|
|
data class SampleDataClass(val name: String, val isNonNullable: Boolean, val isNullable: Boolean?) |
|
|
|
|
|
|
|
|
|
class SampleClass(val name: String) |
|
|
|
|
|
|
|
|
|
@kotlinx.serialization.Serializable |
|
|
|
|
data class SampleResult <T>( |
|
|
|
|
val code: Int, |
|
|
|
|
val message: String, |
|
|
|
|
val data: T, |
|
|
|
|
) { |
|
|
|
|
companion object { |
|
|
|
|
private const val SUCCESS: Int = 200 |
|
|
|
|
private const val FAILURE: Int = 500 |
|
|
|
|
fun <T> success(message: String, data: T) = SampleResult<T>(code = SUCCESS, message = message, data = data) |
|
|
|
|
fun <T> failure(message: String, data: T) = SampleResult<T>(code = FAILURE, message = message, data = data) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|