@Test
public void shouldForwardCallsToMockForMatchingCN() throws CertificateException {

    when(topOfChain.getSubjectX500Principal())
            .thenReturn(new X500Principal("CN=example.org, OU=Smarthome, O=Eclipse, C=DE"));
    subject.checkServerTrusted(chain, "just");
    verify(trustmanager).checkServerTrusted(chain, "just", (Socket) null);
    verifyNoMoreInteractions(trustmanager, trustmanager2);
}