You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt two-pass constructor detection in KotlinInstantiationDelegate to detect private constructors that are not synthetic ones.
See #3389
Original pull request: #3390
Copy file name to clipboardExpand all lines: src/test/kotlin/org/springframework/data/mapping/model/KotlinClassGeneratingEntityInstantiatorUnitTests.kt
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,15 @@ class KotlinClassGeneratingEntityInstantiatorUnitTests {
199
199
assertThat(instance.id.id).isEqualTo("hello")
200
200
}
201
201
202
+
@Test // GH-3389
203
+
fun`should use private default constructor for types using nullable value class`() {
204
+
205
+
every { provider.getParameterValue<String>(any()) } returns "hello"
206
+
val instance = construct(WithNullableMyValueClassPrivateConstructor::class)
207
+
208
+
assertThat(instance.id?.id).isEqualTo("hello")
209
+
}
210
+
202
211
@Test // GH-3389
203
212
fun`should use private default constructor for types using value class with default value`() {
0 commit comments