Spring Boot 2.1 upgrade

* Removed MockBinderRegistryConfiguration
* Move necessary beans from `BindingServiceConfiguration` which is now auto configurable into
  `BinderFactoryConfiguration` that is invoked by `EnableBinding` in order to avoid certain
  cyclic dependency issues. The beans moved are binding target factories of type
  `MessageSourceBindingTargetFactory` and `SubscribableChannelBindingTargetFactory` and their dependencies.
  As a side effect, `ContentTypeConfiguration` is also brought back at the `EnableBinding` level through
  `BinderFactoryConfiguration`.
* Restore `ServerController`  bean in SchemaServerConfiguation as the removal of it
  earlier introduced  some connectivity issues with the schema registry server.
* Update copyrights
This commit is contained in:
Soby Chacko
2018-08-10 01:11:19 -04:00
committed by Oleg Zhurakousky
parent 776fe5da77
commit c85660fba2
18 changed files with 122 additions and 198 deletions

View File

@@ -26,6 +26,7 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.boot.autoconfigure.domain.EntityScanPackages;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.stream.schema.server.controllers.ServerController;
import org.springframework.cloud.stream.schema.server.model.Schema;
import org.springframework.cloud.stream.schema.server.repository.SchemaRepository;
import org.springframework.cloud.stream.schema.server.support.AvroSchemaValidator;
@@ -57,6 +58,12 @@ public class SchemaServerConfiguration {
};
}
@Bean
public ServerController serverController(SchemaRepository repository,
SchemaServerProperties schemeServerProperties) {
return new ServerController(repository, schemaValidators(), schemeServerProperties);
}
@Bean
public Map<String, SchemaValidator> schemaValidators() {
Map<String, SchemaValidator> validatorMap = new HashMap<>();

View File

@@ -44,7 +44,8 @@ import static org.springframework.test.annotation.DirtiesContext.ClassMode.AFTER
* @author Ilayaperumal Gopinathan
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,
properties = "spring.main.allow-bean-definition-overriding=true")
@DirtiesContext(classMode = AFTER_EACH_TEST_METHOD)
public class SchemaRegistryServerAvroTests {