Home / Class/ CertificateMatcherTests Class — spring-boot Architecture

CertificateMatcherTests Class — spring-boot Architecture

Architecture documentation for the CertificateMatcherTests class in CertificateMatcherTests.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/ssl/CertificateMatcherTests.java lines 31–61

class CertificateMatcherTests {

	@CertificateMatchingTest
	void matchesWhenMatchReturnsTrue(CertificateMatchingTestSource source) {
		CertificateMatcher matcher = new CertificateMatcher(source.privateKey());
		assertThat(matcher.matches(source.matchingCertificate())).isTrue();
	}

	@CertificateMatchingTest
	void matchesWhenNoMatchReturnsFalse(CertificateMatchingTestSource source) {
		CertificateMatcher matcher = new CertificateMatcher(source.privateKey());
		for (Certificate nonMatchingCertificate : source.nonMatchingCertificates()) {
			assertThat(matcher.matches(nonMatchingCertificate)).isFalse();
		}
	}

	@CertificateMatchingTest
	void matchesAnyWhenNoneMatchReturnsFalse(CertificateMatchingTestSource source) {
		CertificateMatcher matcher = new CertificateMatcher(source.privateKey());
		assertThat(matcher.matchesAny(source.nonMatchingCertificates())).isFalse();
	}

	@CertificateMatchingTest
	void matchesAnyWhenOneMatchesReturnsTrue(CertificateMatchingTestSource source) {
		CertificateMatcher matcher = new CertificateMatcher(source.privateKey());
		List<Certificate> certificates = new ArrayList<>(source.nonMatchingCertificates());
		certificates.add(source.matchingCertificate());
		assertThat(matcher.matchesAny(certificates)).isTrue();
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free