Package halfpipe.consul

Source Code of halfpipe.consul.TestConfiguration

package halfpipe.consul;

import com.fasterxml.jackson.databind.ObjectMapper;
import halfpipe.core.ApplicationProperties;
import org.springframework.boot.autoconfigure.web.ServerProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.mock.web.MockServletContext;

import javax.servlet.ServletContext;

/**
* User: spencergibb
* Date: 4/17/14
* Time: 9:42 PM
*/
@Configuration
public class TestConfiguration {

    @Bean
    public ObjectMapper objectMapper() {
        return new ObjectMapper();
    }

    @Bean(name = "mvcConversionService")
    public ConversionService conversionService() {
        DefaultConversionService service = new DefaultConversionService();
        return service;
    }

    @Bean
    public ServletContext servletContext() {
        return new MockServletContext();
    }

    @Bean
    public ServerProperties serverProperties() {
        return new ServerProperties();
    }

    @Bean
    public ApplicationProperties halfpipeProperties(ApplicationContext context) {
        ApplicationProperties appProps = new ApplicationProperties();
        appProps.setId("testId");
        return appProps;
    }
}
TOP

Related Classes of halfpipe.consul.TestConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.