@SuppressWarnings("unchecked") @Test public void createNoSSLContext1() throws NoSuchAlgorithmException { mockStatic(SSLContext.class); when(SSLContext.getInstance(anyString())).thenThrow(NoSuchAlgorithmException.class); assertThatThrownBy(() -> forTest.createNoSSLContext()).isInstanceOf(NullPointerException.class); }
public static SSLContext createNoSSLContext() { SSLContext ssl_ctx = null; try { ssl_ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { } TrustManager[] trust_mgr = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; try { ssl_ctx.init(null, trust_mgr, new SecureRandom()); } catch (KeyManagementException e) { } return ssl_ctx; }
CommonUtils { public static SSLContext createNoSSLContext() { SSLContext ssl_ctx = null; try { ssl_ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { } TrustManager[] trust_mgr = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; try { ssl_ctx.init(null, trust_mgr, new SecureRandom()); } catch (KeyManagementException e) { } return ssl_ctx; } }
CommonUtils { public static SSLContext createNoSSLContext() { SSLContext ssl_ctx = null; try { ssl_ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { } TrustManager[] trust_mgr = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; try { ssl_ctx.init(null, trust_mgr, new SecureRandom()); } catch (KeyManagementException e) { } return ssl_ctx; } private  CommonUtils(); }
CommonUtils { public static SSLContext createNoSSLContext() { SSLContext ssl_ctx = null; try { ssl_ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { } TrustManager[] trust_mgr = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; try { ssl_ctx.init(null, trust_mgr, new SecureRandom()); } catch (KeyManagementException e) { } return ssl_ctx; } private  CommonUtils(); @SuppressWarnings("unchecked") static Map<String, Object> flatNestedMap(String notation, Map<String, Object> nestedMap); static String buildErrorResponse(Exception e); static String convertAttributetoKeyword(String attributeName); @SuppressWarnings("unchecked") static LinkedHashMap<String, Object> flatNestedLinkedHashMap(String notation, Map<String, Object> nestedMap); static Object filterMatchingCollectionElements(Object obj, String pattern, boolean retainInsteadOfFilter); static SSLContext createNoSSLContext(); static String capitailizeWord(String mainStr); static String getEnvironmentForTag(String key); }
CommonUtils { public static SSLContext createNoSSLContext() { SSLContext ssl_ctx = null; try { ssl_ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { } TrustManager[] trust_mgr = new TrustManager[] { new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] certs, String t) { } public void checkServerTrusted(X509Certificate[] certs, String t) { } } }; try { ssl_ctx.init(null, trust_mgr, new SecureRandom()); } catch (KeyManagementException e) { } return ssl_ctx; } private  CommonUtils(); @SuppressWarnings("unchecked") static Map<String, Object> flatNestedMap(String notation, Map<String, Object> nestedMap); static String buildErrorResponse(Exception e); static String convertAttributetoKeyword(String attributeName); @SuppressWarnings("unchecked") static LinkedHashMap<String, Object> flatNestedLinkedHashMap(String notation, Map<String, Object> nestedMap); static Object filterMatchingCollectionElements(Object obj, String pattern, boolean retainInsteadOfFilter); static SSLContext createNoSSLContext(); static String capitailizeWord(String mainStr); static String getEnvironmentForTag(String key);  }