@@ -46,30 +46,30 @@ public class MetricTest {
4646 .build ();
4747 private final Logging serviceMockReturnsOptions = createStrictMock (Logging .class );
4848 private final LoggingOptions mockOptions = createMock (LoggingOptions .class );
49- private Logging pubsub ;
49+ private Logging logging ;
5050 private Metric expectedMetric ;
5151 private Metric metric ;
5252
5353 private void initializeExpectedMetric (int optionsCalls ) {
5454 expect (serviceMockReturnsOptions .options ()).andReturn (mockOptions ).times (optionsCalls );
5555 replay (serviceMockReturnsOptions );
56- pubsub = createStrictMock (Logging .class );
56+ logging = createStrictMock (Logging .class );
5757 expectedMetric = new Metric (serviceMockReturnsOptions , new Metric .BuilderImpl (METRIC_INFO ));
5858 }
5959
6060 private void initializeMetric () {
61- metric = new Metric (pubsub , new Metric .BuilderImpl (METRIC_INFO ));
61+ metric = new Metric (logging , new Metric .BuilderImpl (METRIC_INFO ));
6262 }
6363
6464 @ After
6565 public void tearDown () throws Exception {
66- verify (pubsub , serviceMockReturnsOptions );
66+ verify (logging , serviceMockReturnsOptions );
6767 }
6868
6969 @ Test
7070 public void testBuilder () {
7171 initializeExpectedMetric (2 );
72- replay (pubsub );
72+ replay (logging );
7373 MetricInfo builtMetric = expectedMetric .toBuilder ()
7474 .name (NEW_NAME )
7575 .filter (NEW_FILTER )
@@ -83,7 +83,7 @@ public void testBuilder() {
8383 @ Test
8484 public void testToBuilder () {
8585 initializeExpectedMetric (2 );
86- replay (pubsub );
86+ replay (logging );
8787 compareMetric (expectedMetric , expectedMetric .toBuilder ().build ());
8888 }
8989
@@ -93,9 +93,9 @@ public void testReload() {
9393 MetricInfo updatedInfo = METRIC_INFO .toBuilder ().filter (NEW_FILTER ).build ();
9494 Metric expectedMetric =
9595 new Metric (serviceMockReturnsOptions , new MetricInfo .BuilderImpl (updatedInfo ));
96- expect (pubsub .options ()).andReturn (mockOptions );
97- expect (pubsub .getMetric (NAME )).andReturn (expectedMetric );
98- replay (pubsub );
96+ expect (logging .options ()).andReturn (mockOptions );
97+ expect (logging .getMetric (NAME )).andReturn (expectedMetric );
98+ replay (logging );
9999 initializeMetric ();
100100 Metric updatedMetric = metric .reload ();
101101 compareMetric (expectedMetric , updatedMetric );
@@ -104,9 +104,9 @@ public void testReload() {
104104 @ Test
105105 public void testReloadNull () {
106106 initializeExpectedMetric (1 );
107- expect (pubsub .options ()).andReturn (mockOptions );
108- expect (pubsub .getMetric (NAME )).andReturn (null );
109- replay (pubsub );
107+ expect (logging .options ()).andReturn (mockOptions );
108+ expect (logging .getMetric (NAME )).andReturn (null );
109+ replay (logging );
110110 initializeMetric ();
111111 assertNull (metric .reload ());
112112 }
@@ -116,10 +116,10 @@ public void testReloadAsync() throws ExecutionException, InterruptedException {
116116 initializeExpectedMetric (2 );
117117 MetricInfo updatedInfo = METRIC_INFO .toBuilder ().filter (NEW_FILTER ).build ();
118118 Metric expectedMetric = new Metric (serviceMockReturnsOptions , new MetricInfo .BuilderImpl (updatedInfo ));
119- expect (pubsub .options ()).andReturn (mockOptions );
120- expect (pubsub .getMetricAsync (NAME ))
119+ expect (logging .options ()).andReturn (mockOptions );
120+ expect (logging .getMetricAsync (NAME ))
121121 .andReturn (Futures .immediateFuture (expectedMetric ));
122- replay (pubsub );
122+ replay (logging );
123123 initializeMetric ();
124124 Metric updatedMetric = metric .reloadAsync ().get ();
125125 compareMetric (expectedMetric , updatedMetric );
@@ -128,9 +128,9 @@ public void testReloadAsync() throws ExecutionException, InterruptedException {
128128 @ Test
129129 public void testReloadAsyncNull () throws ExecutionException , InterruptedException {
130130 initializeExpectedMetric (1 );
131- expect (pubsub .options ()).andReturn (mockOptions );
132- expect (pubsub .getMetricAsync (NAME )).andReturn (Futures .<Metric >immediateFuture (null ));
133- replay (pubsub );
131+ expect (logging .options ()).andReturn (mockOptions );
132+ expect (logging .getMetricAsync (NAME )).andReturn (Futures .<Metric >immediateFuture (null ));
133+ replay (logging );
134134 initializeMetric ();
135135 assertNull (metric .reloadAsync ().get ());
136136 }
@@ -140,9 +140,9 @@ public void testUpdate() {
140140 initializeExpectedMetric (2 );
141141 MetricInfo updatedInfo = METRIC_INFO .toBuilder ().filter (NEW_FILTER ).build ();
142142 Metric expectedMetric = new Metric (serviceMockReturnsOptions , new MetricInfo .BuilderImpl (updatedInfo ));
143- expect (pubsub .options ()).andReturn (mockOptions );
144- expect (pubsub .update (updatedInfo )).andReturn (expectedMetric );
145- replay (pubsub );
143+ expect (logging .options ()).andReturn (mockOptions );
144+ expect (logging .update (updatedInfo )).andReturn (expectedMetric );
145+ replay (logging );
146146 initializeMetric ();
147147 Metric updatedMetric = metric .update (updatedInfo );
148148 compareMetric (expectedMetric , updatedMetric );
@@ -153,9 +153,9 @@ public void testUpdateAsync() throws ExecutionException, InterruptedException {
153153 initializeExpectedMetric (2 );
154154 MetricInfo updatedInfo = METRIC_INFO .toBuilder ().filter (NEW_FILTER ).build ();
155155 Metric expectedMetric = new Metric (serviceMockReturnsOptions , new MetricInfo .BuilderImpl (updatedInfo ));
156- expect (pubsub .options ()).andReturn (mockOptions );
157- expect (pubsub .updateAsync (updatedInfo )).andReturn (Futures .immediateFuture (expectedMetric ));
158- replay (pubsub );
156+ expect (logging .options ()).andReturn (mockOptions );
157+ expect (logging .updateAsync (updatedInfo )).andReturn (Futures .immediateFuture (expectedMetric ));
158+ replay (logging );
159159 initializeMetric ();
160160 Metric updatedMetric = metric .updateAsync (updatedInfo ).get ();
161161 compareMetric (expectedMetric , updatedMetric );
@@ -164,39 +164,39 @@ public void testUpdateAsync() throws ExecutionException, InterruptedException {
164164 @ Test
165165 public void testDeleteTrue () {
166166 initializeExpectedMetric (1 );
167- expect (pubsub .options ()).andReturn (mockOptions );
168- expect (pubsub .deleteMetric (NAME )).andReturn (true );
169- replay (pubsub );
167+ expect (logging .options ()).andReturn (mockOptions );
168+ expect (logging .deleteMetric (NAME )).andReturn (true );
169+ replay (logging );
170170 initializeMetric ();
171171 assertTrue (metric .delete ());
172172 }
173173
174174 @ Test
175175 public void testDeleteFalse () {
176176 initializeExpectedMetric (1 );
177- expect (pubsub .options ()).andReturn (mockOptions );
178- expect (pubsub .deleteMetric (NAME )).andReturn (false );
179- replay (pubsub );
177+ expect (logging .options ()).andReturn (mockOptions );
178+ expect (logging .deleteMetric (NAME )).andReturn (false );
179+ replay (logging );
180180 initializeMetric ();
181181 assertFalse (metric .delete ());
182182 }
183183
184184 @ Test
185185 public void testDeleteAsyncTrue () throws ExecutionException , InterruptedException {
186186 initializeExpectedMetric (1 );
187- expect (pubsub .options ()).andReturn (mockOptions );
188- expect (pubsub .deleteMetricAsync (NAME )).andReturn (Futures .immediateFuture (true ));
189- replay (pubsub );
187+ expect (logging .options ()).andReturn (mockOptions );
188+ expect (logging .deleteMetricAsync (NAME )).andReturn (Futures .immediateFuture (true ));
189+ replay (logging );
190190 initializeMetric ();
191191 assertTrue (metric .deleteAsync ().get ());
192192 }
193193
194194 @ Test
195195 public void testDeleteAsyncFalse () throws ExecutionException , InterruptedException {
196196 initializeExpectedMetric (1 );
197- expect (pubsub .options ()).andReturn (mockOptions );
198- expect (pubsub .deleteMetricAsync (NAME )).andReturn (Futures .immediateFuture (false ));
199- replay (pubsub );
197+ expect (logging .options ()).andReturn (mockOptions );
198+ expect (logging .deleteMetricAsync (NAME )).andReturn (Futures .immediateFuture (false ));
199+ replay (logging );
200200 initializeMetric ();
201201 assertFalse (metric .deleteAsync ().get ());
202202 }
0 commit comments