Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Yanming Zhou
*/
class DefaultBindConstructorProviderTests {

Expand Down Expand Up @@ -92,6 +93,12 @@ void getBindConstructorWhenHasTwoConstructorsWithBothConstructorBindingThrowsExc
.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,
Expand Down Expand Up @@ -224,6 +231,13 @@ static class TwoConstructorsWithBothConstructorBinding {

}

static final class TypeWithPrivateConstructor {

private TypeWithPrivateConstructor(Environment environment) {
}

}

static class MemberTypeWithPrivateConstructor {

static final class Member {
Expand Down