Polishing, removed commented code, fixed styles, updated copyrights

This commit is contained in:
Oleg Zhurakousky
2019-06-05 09:00:11 +02:00
parent 05b764a3cb
commit 3f86eff9cb
3 changed files with 5 additions and 47 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2018 the original author or authors.
* Copyright 2016-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@ import example.avro.Command;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -65,6 +65,7 @@ import static org.springframework.cloud.schema.avro.AvroMessageConverterSerializ
* @author Marius Bogoevici
* @author Oleg Zhurakousky
* @author Sercan Karaoglu
* @author James Gee
*/
public class AvroSchemaRegistryClientMessageConverterTests {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2018 the original author or authors.
* Copyright 2016-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,12 +48,6 @@ public class ProducerProperties {
@JsonSerialize(using = ExpressionSerializer.class)
private Expression partitionKeyExpression;
// /**
// * @deprecated in favor of 'partitionKeyExtractorName'
// */
// @Deprecated
// private Class<?> partitionKeyExtractorClass;
/**
* The name of the bean that implements {@link PartitionKeyExtractorStrategy}\. Used
* to extract a key used to compute the partition id (see 'partitionSelector*') <br>
@@ -61,12 +55,6 @@ public class ProducerProperties {
*/
private String partitionKeyExtractorName;
// /**
// * @deprecated in favor of 'partitionSelectorName'
// */
// @Deprecated
// private Class<?> partitionSelectorClass;
/**
* The name of the bean that implements {@link PartitionSelectorStrategy}\. Used to
* determine partition id based on partition key (see 'partitionKeyExtractor*'). <br>
@@ -95,32 +83,11 @@ public class ProducerProperties {
this.partitionKeyExpression = partitionKeyExpression;
}
// @Deprecated
// public Class<?> getPartitionKeyExtractorClass() {
// return this.partitionKeyExtractorClass;
// }
//
// @Deprecated
// public void setPartitionKeyExtractorClass(Class<?> partitionKeyExtractorClass) {
// this.partitionKeyExtractorClass = partitionKeyExtractorClass;
// }
public boolean isPartitioned() {
return this.partitionKeyExpression != null
|| this.partitionKeyExtractorName != null;
// || this.partitionKeyExtractorClass != null;
}
// @Deprecated
// public Class<?> getPartitionSelectorClass() {
// return this.partitionSelectorClass;
// }
//
// @Deprecated
// public void setPartitionSelectorClass(Class<?> partitionSelectorClass) {
// this.partitionSelectorClass = partitionSelectorClass;
// }
public Expression getPartitionSelectorExpression() {
return this.partitionSelectorExpression;
}
@@ -146,17 +113,11 @@ public class ProducerProperties {
this.requiredGroups = requiredGroups;
}
//@AssertTrue(message = "Partition key expression and partition key extractor class properties are mutually exclusive.")
public boolean isValidPartitionKeyProperty() {
// return (this.partitionKeyExpression == null)
// || (this.partitionKeyExtractorClass == null);
return this.partitionKeyExpression == null;
}
//@AssertTrue(message = "Partition selector class and partition selector expression properties are mutually exclusive.")
public boolean isValidPartitionSelectorProperty() {
// return (this.partitionSelectorClass == null)
// || (this.partitionSelectorExpression == null);
return this.partitionSelectorExpression == null;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2017 the original author or authors.
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -99,16 +99,12 @@ public abstract class BindingBeanDefinitionRegistryUtils {
if (type.isInterface()) {
RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(
BindableProxyFactory.class);
// rootBeanDefinition
// .addQualifier(new AutowireCandidateQualifier(Bindings.class, parent));
rootBeanDefinition.getConstructorArgumentValues()
.addGenericArgumentValue(type);
registry.registerBeanDefinition(type.getName(), rootBeanDefinition);
}
else {
RootBeanDefinition rootBeanDefinition = new RootBeanDefinition(type);
// rootBeanDefinition
// .addQualifier(new AutowireCandidateQualifier(Bindings.class, parent));
registry.registerBeanDefinition(type.getName(), rootBeanDefinition);
}
}