org.zodiac.autoconfigure.bootstrap.breaker.routing.mock.MockAppRoutingAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.bootstrap.breaker.routing.mock;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.zodiac.commons.constants.SystemPropertiesConstants;
import org.zodiac.core.bootstrap.breaker.routing.mock.MockAppRoutingService;
@Profile(value = "mock")
@SpringBootConfiguration
@ConditionalOnProperty(value = SystemPropertiesConstants.Zodiac.SPRING_BOOTSTRAP_BREAKER_ROUTING_MOCK_ENABLED, havingValue = "true")
@EnableConfigurationProperties(MockAppRoutingProperties.class)
public class MockAppRoutingAutoConfiguration {
public MockAppRoutingAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = SystemPropertiesConstants.Zodiac.SPRING_BOOTSTRAP_BREAKER_ROUTING_MOCK_PREFIX)
protected MockAppRoutingService mockRoutingService(MockAppRoutingProperties mockRoutingProperties) {
return new MockAppRoutingService(mockRoutingProperties);
}
}