Remove unneeded @PostConstruct

This commit is contained in:
Spencer Gibb
2016-11-22 14:52:28 -07:00
parent 8ec5911151
commit 358f9a9df0
2 changed files with 2 additions and 10 deletions

View File

@@ -22,8 +22,6 @@ import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.commons.util.InetUtils;
import javax.annotation.PostConstruct;
/**
* Properties related to Zookeeper's Service Discovery.
*
@@ -75,11 +73,6 @@ public class ZookeeperDiscoveryProperties {
this.instanceHost = this.hostInfo.getIpAddress();
}
@PostConstruct
public void init() {
this.root = DependencyPathUtils.sanitize(this.root);
}
public boolean isEnabled() {
return this.enabled;
}
@@ -101,7 +94,7 @@ public class ZookeeperDiscoveryProperties {
}
public void setRoot(String root) {
this.root = root;
this.root = DependencyPathUtils.sanitize(root);
}
public void setUriSpec(String uriSpec) {

View File

@@ -30,9 +30,8 @@ public class ZookeeperDiscoveryPropertiesTest {
ZookeeperDiscoveryProperties zookeeperDiscoveryProperties = new ZookeeperDiscoveryProperties(new InetUtils(new InetUtilsProperties()));
// when:
zookeeperDiscoveryProperties.setRoot(root);
zookeeperDiscoveryProperties.init();
// then:
then(zookeeperDiscoveryProperties.getRoot()).isEqualTo("/es");
}
}
}