Merge branch '3.2.x' into 3.3.x

Closes gh-42287
This commit is contained in:
Phillip Webb 2024-09-12 18:57:01 -07:00
commit ee2ec9bc9d
1 changed files with 15 additions and 1 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 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.
@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Yanming Zhou
*/
class DefaultBindConstructorProviderTests {
@ -92,6 +93,12 @@ class DefaultBindConstructorProviderTests {
.withMessageContaining("has more than one @ConstructorBinding");
}
@Test
void getBindConstructorWhenIsTypeWithPrivateConstructorReturnsNull() {
Constructor<?> constructor = this.provider.getBindConstructor(TypeWithPrivateConstructor.class, false);
assertThat(constructor).isNull();
}
@Test
void getBindConstructorWhenIsMemberTypeWithPrivateConstructorReturnsNull() {
Constructor<?> constructor = this.provider.getBindConstructor(MemberTypeWithPrivateConstructor.Member.class,
@ -224,6 +231,13 @@ class DefaultBindConstructorProviderTests {
}
static final class TypeWithPrivateConstructor {
private TypeWithPrivateConstructor(Environment environment) {
}
}
static class MemberTypeWithPrivateConstructor {
static final class Member {