@@ -0,0 +1,3337 @@
+package net.rakugakibox.spring.boot.orika;%0A%0Aimport ma.glasnost.orika.impl.DefaultMapperFactory.MapperFactoryBuilder;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.beans.factory.annotation.Qualifier;%0Aimport org.springframework.boot.autoconfigure.EnableAutoConfiguration;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0Aimport org.springframework.test.context.junit4.SpringRunner;%0A%0A/**%0A * The %7B@link OrikaAutoConfiguration%7D's test cases when customize %7B@link MapperFactoryBuilder%7D.%0A */%0A@RunWith(SpringRunner.class)%0A@SpringBootTest%0Apublic class OrikaAutoConfigurationMapperFactoryBuilderCustomizingTest %7B%0A%0A    /**%0A     * The %7B@link MapperFactoryBuilder%7D.%0A     */%0A    @Autowired%0A    protected MapperFactoryBuilder%3C?, ?%3E orikaMapperFactoryBuilder;%0A%0A    /**%0A     * The %7B@link MapperFactoryBuilder%7D's configuration 1.%0A     */%0A    @Autowired%0A    @Qualifier(%22orikaMapperFactoryBuilderConfiguration1%22)%0A    protected OrikaMapperFactoryBuilderConfiguration orikaMapperFactoryBuilderConfiguration1;%0A%0A    /**%0A     * The %7B@link MapperFactoryBuilder%7D's configuration 2.%0A     */%0A    @Autowired%0A    @Qualifier(%22orikaMapperFactoryBuilderConfiguration2%22)%0A    protected OrikaMapperFactoryBuilderConfiguration orikaMapperFactoryBuilderConfiguration2;%0A%0A    /**%0A     * Tests the %7B@link OrikaAutoConfiguration#orikaMapperFactoryBuilder()%7D.%0A     */%0A    @Test%0A    public void orikaMapperFactoryBuilder_configurerShouldBeCalled() %7B%0A        assertThat(orikaMapperFactoryBuilderConfiguration1.mapperFactoryBuilder).isSameAs(orikaMapperFactoryBuilder);%0A        assertThat(orikaMapperFactoryBuilderConfiguration2.mapperFactoryBuilder).isSameAs(orikaMapperFactoryBuilder);%0A    %7D%0A%0A    /**%0A     * The context configuration.%0A     */%0A    @Configuration%0A    @EnableAutoConfiguration%0A    public static class ContextConfiguration %7B%0A%0A        /**%0A         * Creates a %7B@link MapperFactoryBuilder%7D's configuration 1.%0A         *%0A         * @return a %7B@link MapperFactoryBuilder%7D's configuration 1.%0A         */%0A        @Bean%0A        public OrikaMapperFactoryBuilderConfiguration orikaMapperFactoryBuilderConfiguration1() %7B%0A            return new OrikaMapperFactoryBuilderConfiguration();%0A        %7D%0A%0A        /**%0A         * Creates a %7B@link MapperFactoryBuilder%7D's configuration 2.%0A         *%0A         * @return a %7B@link MapperFactoryBuilder%7D's configuration 2.%0A         */%0A        @Bean%0A        public OrikaMapperFactoryBuilderConfiguration orikaMapperFactoryBuilderConfiguration2() %7B%0A            return new OrikaMapperFactoryBuilderConfiguration();%0A        %7D%0A%0A    %7D%0A%0A    /**%0A     * The %7B@link MapperFactoryBuilder%7D's configuration.%0A     */%0A    public static class OrikaMapperFactoryBuilderConfiguration implements OrikaMapperFactoryBuilderConfigurer %7B%0A%0A        /**%0A         * The %7B@link MapperFactoryBuilder%7D.%0A         */%0A        private MapperFactoryBuilder%3C?, ?%3E mapperFactoryBuilder;%0A%0A        /** %7B@inheritDoc%7D */%0A        @Override%0A        public void configure(MapperFactoryBuilder%3C?, ?%3E mapperFactoryBuilder) %7B%0A            this.mapperFactoryBuilder = mapperFactoryBuilder;%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Test when customize MapperFactoryBuilder