Skip to content

Commit

Permalink
Improve readability (and remove wrong code comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Oct 16, 2017
1 parent af1bec2 commit aaa7cfc
Showing 1 changed file with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,10 @@ public void should_create_event() {
assertEquals("Processor usage", event.getDescription());
List<Proto.Attribute> eventAttributes = getAttributesSortedByKey(event);
assertEquals(4, eventAttributes.size());
// datacenter -> eu_west
assertEquals("datacenter", eventAttributes.get(0).getKey());
assertEquals("eu_west", eventAttributes.get(0).getValue());
// environment -> production
assertEquals("environment", eventAttributes.get(1).getKey());
assertEquals("production", eventAttributes.get(1).getValue());
// health -> good
assertEquals("health", eventAttributes.get(2).getKey());
assertEquals("good", eventAttributes.get(2).getValue());
// health -> good
assertEquals("network_zone", eventAttributes.get(3).getKey());
assertEquals("dmz", eventAttributes.get(3).getValue());
assertEqualsAttribute("datacenter", "eu_west", eventAttributes.get(0));
assertEqualsAttribute("environment", "production", eventAttributes.get(1));
assertEqualsAttribute("health", "good", eventAttributes.get(2));
assertEqualsAttribute("network_zone", "dmz", eventAttributes.get(3));
assertEquals(60F, event.getTtl(), 0F);
}

Expand Down Expand Up @@ -160,4 +152,9 @@ public int compare(Proto.Attribute o1, Proto.Attribute o2) {
});
return attributes;
}

private void assertEqualsAttribute(String expectedKey, String expectedValue, Proto.Attribute actual) {
assertEquals(expectedKey, actual.getKey());
assertEquals(expectedValue, actual.getValue());
}
}

0 comments on commit aaa7cfc

Please sign in to comment.