Skip to content

Commit

Permalink
Remove deprecated constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaMaciaszek committed Apr 13, 2022
1 parent e38cd1e commit 27ac337
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ public class EurekaController {

private final EurekaProperties eurekaProperties;

/**
* @deprecated in favour of
* {@link EurekaController#EurekaController(ApplicationInfoManager, EurekaProperties)}
*/
@Deprecated
public EurekaController(ApplicationInfoManager applicationInfoManager) {
this(applicationInfoManager, null);
}

public EurekaController(ApplicationInfoManager applicationInfoManager, EurekaProperties eurekaProperties) {
this.applicationInfoManager = applicationInfoManager;
this.eurekaProperties = eurekaProperties;
Expand Down Expand Up @@ -128,14 +119,8 @@ protected void populateBase(HttpServletRequest request, Map<String, Object> mode
private void populateHeader(Map<String, Object> model) {
model.put("currentTime", StatusResource.getCurrentTimeAsString());
model.put("upTime", StatusInfo.getUpTime());
if (eurekaProperties != null) {
model.put("environment", eurekaProperties.getEnvironment());
model.put("datacenter", eurekaProperties.getDatacenter());
}
else {
model.put("environment", "N/A");
model.put("datacenter", "N/A");
}
model.put("environment", eurekaProperties.getEnvironment());
model.put("datacenter", eurekaProperties.getDatacenter());
PeerAwareInstanceRegistry registry = getRegistry();
model.put("registry", registry);
model.put("isBelowRenewThreshold", registry.isBelowRenewThresold() == 1);
Expand All @@ -159,7 +144,8 @@ private EurekaServerContext getServerContext() {

private void populateNavbar(HttpServletRequest request, Map<String, Object> model) {
Map<String, String> replicas = new LinkedHashMap<>();
List<PeerEurekaNode> list = getServerContext().getPeerEurekaNodes().getPeerNodesView();
List<PeerEurekaNode> list = getServerContext().getPeerEurekaNodes()
.getPeerNodesView();
for (PeerEurekaNode node : list) {
try {
URI uri = new URI(node.getServiceUrl());
Expand Down Expand Up @@ -295,7 +281,8 @@ private String scrubBasicAuth(String urlList) {
StringBuilder filteredUrls = new StringBuilder();
for (String u : urls) {
if (u.contains("@")) {
filteredUrls.append(u, 0, u.indexOf("//") + 2).append(u.substring(u.indexOf("@") + 1)).append(",");
filteredUrls.append(u, 0, u.indexOf("//") + 2)
.append(u.substring(u.indexOf("@") + 1)).append(",");
}
else {
filteredUrls.append(u).append(",");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void testFilterReplicasNoAuth() throws Exception {
StatusInfo statusInfo = StatusInfo.Builder.newBuilder().add("registered-replicas", empty)
.add("available-replicas", noAuthList1).add("unavailable-replicas", noAuthList2)
.withInstanceInfo(this.instanceInfo).build();
EurekaController controller = new EurekaController(null);
EurekaController controller = new EurekaController(null, new EurekaProperties());

controller.filterReplicas(model, statusInfo);

Expand All @@ -95,7 +95,7 @@ void testFilterReplicasAuth() throws Exception {
StatusInfo statusInfo = StatusInfo.Builder.newBuilder().add("registered-replicas", authList2)
.add("available-replicas", authList1).add("unavailable-replicas", empty).withInstanceInfo(instanceInfo)
.build();
EurekaController controller = new EurekaController(null);
EurekaController controller = new EurekaController(null, new EurekaProperties());

controller.filterReplicas(model, statusInfo);

Expand All @@ -113,7 +113,7 @@ void testFilterReplicasAuthWithCombinationList() throws Exception {
StatusInfo statusInfo = StatusInfo.Builder.newBuilder().add("registered-replicas", totalAutoList)
.add("available-replicas", combinationAuthList1).add("unavailable-replicas", combinationAuthList2)
.withInstanceInfo(instanceInfo).build();
EurekaController controller = new EurekaController(null);
EurekaController controller = new EurekaController(null, new EurekaProperties());

controller.filterReplicas(model, statusInfo);

Expand Down

0 comments on commit 27ac337

Please sign in to comment.