Skip to content

Commit

Permalink
Add constants for updated values in MetricInfoTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mziccard committed Jun 17, 2016
1 parent 9e342a6 commit f4b576c
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class MetricInfoTest {
private static final String NAME = "name";
private static final String FILTER = "logName=projects/my-projectid/logs/syslog";
private static final String DESCRIPTION = "description";
private static final String NEW_NAME = "newName";
private static final String NEW_FILTER = "logName=projects/my-projectid/logs/newSyslog";
private static final String NEW_DESCRIPTION = "newDescription";
private static final MetricInfo METRIC_INFO = MetricInfo.builder(NAME, FILTER)
.description(DESCRIPTION)
.build();
Expand All @@ -49,13 +52,13 @@ public void testBuilder() {
public void testToBuilder() {
compareMetricInfo(METRIC_INFO, METRIC_INFO.toBuilder().build());
MetricInfo metricInfo = METRIC_INFO.toBuilder()
.name("newName")
.description("newDescription")
.filter("logName=projects/my-projectid/logs/syslog")
.name(NEW_NAME)
.description(NEW_DESCRIPTION)
.filter(NEW_FILTER)
.build();
assertEquals("newName", metricInfo.name());
assertEquals("logName=projects/my-projectid/logs/syslog", metricInfo.filter());
assertEquals("newDescription", metricInfo.description());
assertEquals(NEW_NAME, metricInfo.name());
assertEquals(NEW_FILTER, metricInfo.filter());
assertEquals(NEW_DESCRIPTION, metricInfo.description());
metricInfo = metricInfo.toBuilder()
.name(NAME)
.description(DESCRIPTION)
Expand Down

0 comments on commit f4b576c

Please sign in to comment.