@Test
	public void testSpringXDTemplate() throws Exception {
		BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider();
		credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("admin", "whosThere"));
		HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(
				HttpClientBuilder.create().setDefaultCredentialsProvider(credentialsProvider).setSSLSocketFactory(
						new SSLConnectionSocketFactory(
								new SSLContextBuilder().loadTrustMaterial(null,
										new TrustSelfSignedStrategy()).build())).build());
		SpringXDTemplate template = new SpringXDTemplate(requestFactory, new URI("https://localhost:" + adminPort));
		PagedResources<ModuleDefinitionResource> moduleDefinitions = template.moduleOperations().list(
				RESTModuleType.sink);
		assertThat(moduleDefinitions.getLinks().size(), greaterThan(0));
	}
Tests a mixed security/SSL scenario, directly with the SpringXDTemplate. This allows a more relaxed
handling of SSL certificates, such as supporting self-signed certificates in the test.

@author Marius Bogoevici
spring-xd-shell/src/test/java/org/springframework/xd/shell/security/SecuredShellAccessWithSslTests.java