The metadata needs to be ordered for this implementation.

This commit is contained in:
Zack Shoylev 2014-01-20 18:53:37 -06:00
parent 0843c36dd2
commit 00f844b1d8
3 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ package org.jclouds.rackspace.cloudloadbalancers.v1.domain;
import java.util.Map;
import com.google.common.collect.ForwardingMap;
import static com.google.common.collect.Maps.newHashMap;
import static com.google.common.collect.Maps.newLinkedHashMap;
import static com.google.common.collect.Sets.newHashSet;
/**
@ -30,8 +30,8 @@ import static com.google.common.collect.Sets.newHashSet;
* @author Everett Toews
*/
public class Metadata extends ForwardingMap<String, String> {
private final Map<String, String> metadata = newHashMap();
private final Map<String, Integer> keyToId = newHashMap();
private final Map<String, String> metadata = newLinkedHashMap(); // Implementing class must be sorted.
private final Map<String, Integer> keyToId = newLinkedHashMap();
public Metadata(Metadata metadata) {
super();

View File

@ -219,9 +219,9 @@ public class LoadBalancerApiExpectTest extends BaseCloudLoadBalancerApiExpectTes
private Metadata getExpectedMetadata() {
Metadata metadata = new Metadata();
metadata.put("os", "ubuntu");
metadata.put("color", "red");
metadata.put("label", "web-load-balancer");
metadata.put("os", "ubuntu");
return metadata;
}

View File

@ -214,9 +214,9 @@ public class NodeApiExpectTest extends BaseCloudLoadBalancerApiExpectTest<CloudL
private Metadata getExpectedMetadata() {
Metadata metadata = new Metadata();
metadata.put("os", "ubuntu");
metadata.put("color", "red");
metadata.put("label", "web-load-balancer");
metadata.put("os", "ubuntu");
return metadata;
}