1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.net.util;
19
20 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
21 import static org.junit.jupiter.api.Assertions.assertNotNull;
22
23 import java.security.GeneralSecurityException;
24 import java.security.KeyStore;
25 import java.security.KeyStoreException;
26
27 import org.junit.jupiter.api.Test;
28
29
30
31
32 public class TrustManagerUtilsTest {
33
34 @Test
35 public void testGetAcceptAllTrustManager() {
36 assertNotNull(TrustManagerUtils.getAcceptAllTrustManager());
37 }
38
39 @Test
40 public void testGetDefaultTrustManager() throws KeyStoreException, GeneralSecurityException {
41 assertNotNull(TrustManagerUtils.getDefaultTrustManager(KeyStore.getInstance(KeyStore.getDefaultType())));
42 }
43
44 @Test
45 public void testGetValidateServerCertificateTrustManager() {
46 assertNotNull(TrustManagerUtils.getValidateServerCertificateTrustManager());
47 }
48
49 @SuppressWarnings("deprecation")
50 @Test
51 public void testToConstructor() {
52 assertDoesNotThrow(TrustManagerUtils::new);
53 }
54
55 }