FINERACT-1490: SSL configuration based on application.properties
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
45264ea209
commit
b96cae37ed
-56
@@ -1,56 +0,0 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.boot.tests;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.fineract.infrastructure.core.boot.EmbeddedTomcatWithSSLConfiguration;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
public class EmbeddedTomcatWithSSLConfigurationTest {
|
||||
|
||||
@Test
|
||||
public void testGetFileWithFileResource() throws IOException {
|
||||
// Test class probably isn't in a JAR
|
||||
checkClassResource(getClass());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetFileWithClasspathResource() throws IOException {
|
||||
// Spring Resource class probably is in a JAR
|
||||
File f1 = checkClassResource(Resource.class);
|
||||
f1.delete();
|
||||
checkClassResource(Resource.class);
|
||||
}
|
||||
|
||||
protected File checkClassResource(Class<?> clazz) throws IOException {
|
||||
String testClasspathResourcePath = clazz.getCanonicalName().replace('.', '/') + ".class";
|
||||
Resource r = new ClassPathResource(testClasspathResourcePath);
|
||||
File f = new EmbeddedTomcatWithSSLConfiguration().getFile(r);
|
||||
assertTrue(f.exists());
|
||||
f = new EmbeddedTomcatWithSSLConfiguration().getFile(r);
|
||||
assertTrue(f.exists());
|
||||
return f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user