|
|
@ -1,3 +1,19 @@
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
* Copyright 2012-2015 the original author or authors.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Licensed 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.springframework.boot.autoconfigure.mustache;
|
|
|
|
package org.springframework.boot.autoconfigure.mustache;
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.annotation.Documented;
|
|
|
|
import java.lang.annotation.Documented;
|
|
|
@ -15,8 +31,8 @@ import org.junit.runner.RunWith;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.MustacheResourceTemplateLoader;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.MustacheWebIntegrationTests.Application;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.ApplicationTests.Application;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.web.MustacheView;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.web.MustacheViewResolver;
|
|
|
|
import org.springframework.boot.autoconfigure.mustache.web.MustacheViewResolver;
|
|
|
|
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
|
|
@ -39,11 +55,17 @@ import com.samskivert.mustache.Template;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Integration Tests for {@link MustacheAutoConfiguration}, {@link MustacheViewResolver}
|
|
|
|
|
|
|
|
* and {@link MustacheView}.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @author Dave Syer
|
|
|
|
|
|
|
|
*/
|
|
|
|
@RunWith(SpringJUnit4ClassRunner.class)
|
|
|
|
@RunWith(SpringJUnit4ClassRunner.class)
|
|
|
|
@SpringApplicationConfiguration(classes = Application.class)
|
|
|
|
@SpringApplicationConfiguration(classes = Application.class)
|
|
|
|
@IntegrationTest("server.port:0")
|
|
|
|
@IntegrationTest("server.port:0")
|
|
|
|
@WebAppConfiguration
|
|
|
|
@WebAppConfiguration
|
|
|
|
public class ApplicationTests {
|
|
|
|
public class MustacheWebIntegrationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private EmbeddedWebApplicationContext context;
|
|
|
|
private EmbeddedWebApplicationContext context;
|