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
@@ -202,6 +202,15 @@ class KotlinClassGeneratingEntityInstantiatorUnitTests {
202
202
assertThat(instance.id.id).isEqualTo("hello")
203
203
}
204
204
205
+
@Test // GH-3389
206
+
fun`should use private default constructor for types using nullable value class`() {
207
+
208
+
every { provider.getParameterValue<String>(any()) } returns "hello"
209
+
val instance = construct(WithNullableMyValueClassPrivateConstructor::class)
210
+
211
+
assertThat(instance.id?.id).isEqualTo("hello")
212
+
}
213
+
205
214
@Test // GH-3389
206
215
fun`should use private default constructor for types using value class with default value`() {
0 commit comments