All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.codearte.accurest.stubrunner.spring.cloud.ribbon.StubRunnerRibbonConfiguration Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package io.codearte.accurest.stubrunner.spring.cloud.ribbon;

import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.ServerList;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

@Configuration
class StubRunnerRibbonConfiguration {
	@Bean
	StubRunnerRibbonBeanPostProcessor stubRunnerRibbonBeanPostProcessor(BeanFactory beanFactory) {
		return new StubRunnerRibbonBeanPostProcessor(beanFactory);
	}

	@Bean
	@ConditionalOnMissingBean
	public ServerList noOpServerList() {
		return new ServerList() {
			@Override
			public List getInitialListOfServers() {
				return new ArrayList<>();
			}

			@Override
			public List getUpdatedListOfServers() {
				return new ArrayList<>();
			}
		};
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy