1515 */
1616package com .google .cloud .bigtable .data .v2 .models ;
1717
18- import static com .google .api .gax .util .TimeConversionUtils .toThreetenInstant ;
1918import static com .google .common .truth .Truth .assertThat ;
2019
2120import com .google .bigtable .v2 .MutateRowRequest ;
@@ -46,10 +45,6 @@ public class ChangeStreamMutationTest {
4645 RequestContext .create (PROJECT_ID , INSTANCE_ID , APP_PROFILE_ID );
4746 private static final Instant FAKE_COMMIT_TIMESTAMP = Instant .ofEpochSecond (0 , 1000L );
4847 private static final Instant FAKE_LOW_WATERMARK = Instant .ofEpochSecond (0 , 2000L );
49- private static final org .threeten .bp .Instant FAKE_COMMIT_TIMESTAMP_THREETEN =
50- toThreetenInstant (FAKE_COMMIT_TIMESTAMP );
51- private static final org .threeten .bp .Instant FAKE_LOW_WATERMARK_THREETEN =
52- toThreetenInstant (FAKE_LOW_WATERMARK );
5348
5449 @ Test
5550 public void userInitiatedMutationTest () throws IOException , ClassNotFoundException {
@@ -78,20 +73,18 @@ public void userInitiatedMutationTest() throws IOException, ClassNotFoundExcepti
7873 Value .rawTimestamp (1000 ),
7974 Value .rawValue (ByteString .copyFrom (Longs .toByteArray (1234L ))))
8075 .setToken ("fake-token" )
81- .setLowWatermarkTime (FAKE_LOW_WATERMARK )
76+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK )
8277 .build ();
8378
8479 // Test the getters.
8580 assertThat (changeStreamMutation .getRowKey ()).isEqualTo (ByteString .copyFromUtf8 ("key" ));
8681 assertThat (changeStreamMutation .getType ()).isEqualTo (ChangeStreamMutation .MutationType .USER );
8782 assertThat (changeStreamMutation .getSourceClusterId ()).isEqualTo ("fake-source-cluster-id" );
88- assertThat (changeStreamMutation .getCommitTime ()).isEqualTo (FAKE_COMMIT_TIMESTAMP );
89- assertThat (changeStreamMutation .getCommitTimestamp ()).isEqualTo (FAKE_COMMIT_TIMESTAMP_THREETEN );
83+ assertThat (changeStreamMutation .getCommitTimestamp ()).isEqualTo (FAKE_COMMIT_TIMESTAMP );
9084 assertThat (changeStreamMutation .getTieBreaker ()).isEqualTo (0 );
9185 assertThat (changeStreamMutation .getToken ()).isEqualTo ("fake-token" );
92- assertThat (changeStreamMutation .getEstimatedLowWatermarkTime ()).isEqualTo (FAKE_LOW_WATERMARK );
93- assertThat (changeStreamMutation .getEstimatedLowWatermark ())
94- .isEqualTo (FAKE_LOW_WATERMARK_THREETEN );
86+ assertThat (changeStreamMutation .getEstimatedLowWatermark ()).isEqualTo (FAKE_LOW_WATERMARK );
87+ assertThat (changeStreamMutation .getEstimatedLowWatermark ()).isEqualTo (FAKE_LOW_WATERMARK );
9588
9689 // Test serialization.
9790 ByteArrayOutputStream bos = new ByteArrayOutputStream ();
@@ -120,21 +113,19 @@ public void gcMutationTest() throws IOException, ClassNotFoundException {
120113 ByteString .copyFromUtf8 ("fake-qualifier" ),
121114 Range .TimestampRange .create (1000L , 2000L ))
122115 .setToken ("fake-token" )
123- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN )
116+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK )
124117 .build ();
125118
126119 // Test the getters.
127120 assertThat (changeStreamMutation .getRowKey ()).isEqualTo (ByteString .copyFromUtf8 ("key" ));
128121 assertThat (changeStreamMutation .getType ())
129122 .isEqualTo (ChangeStreamMutation .MutationType .GARBAGE_COLLECTION );
130123 Assert .assertTrue (changeStreamMutation .getSourceClusterId ().isEmpty ());
131- assertThat (changeStreamMutation .getCommitTime ()).isEqualTo (FAKE_COMMIT_TIMESTAMP );
132- assertThat (changeStreamMutation .getCommitTimestamp ()).isEqualTo (FAKE_COMMIT_TIMESTAMP_THREETEN );
124+ assertThat (changeStreamMutation .getCommitTimestamp ()).isEqualTo (FAKE_COMMIT_TIMESTAMP );
133125 assertThat (changeStreamMutation .getTieBreaker ()).isEqualTo (0 );
134126 assertThat (changeStreamMutation .getToken ()).isEqualTo ("fake-token" );
135- assertThat (changeStreamMutation .getEstimatedLowWatermarkTime ()).isEqualTo (FAKE_LOW_WATERMARK );
136- assertThat (changeStreamMutation .getEstimatedLowWatermark ())
137- .isEqualTo (FAKE_LOW_WATERMARK_THREETEN );
127+ assertThat (changeStreamMutation .getEstimatedLowWatermark ()).isEqualTo (FAKE_LOW_WATERMARK );
128+ assertThat (changeStreamMutation .getEstimatedLowWatermark ()).isEqualTo (FAKE_LOW_WATERMARK );
138129
139130 // Test serialization.
140131 ByteArrayOutputStream bos = new ByteArrayOutputStream ();
@@ -172,7 +163,7 @@ public void toRowMutationTest() {
172163 Value .rawTimestamp (1000 ),
173164 Value .rawValue (ByteString .copyFrom (Longs .toByteArray (1234L ))))
174165 .setToken ("fake-token" )
175- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN )
166+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK )
176167 .build ();
177168
178169 // Convert it to a rowMutation and construct a MutateRowRequest.
@@ -215,7 +206,7 @@ public void toRowMutationWithoutTokenShouldFailTest() {
215206 ChangeStreamMutation .createUserMutation (
216207 ByteString .copyFromUtf8 ("key" ), "fake-source-cluster-id" , FAKE_COMMIT_TIMESTAMP , 0 )
217208 .deleteFamily ("fake-family" )
218- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN );
209+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK );
219210 Assert .assertThrows (IllegalStateException .class , builder ::build );
220211 }
221212
@@ -255,7 +246,7 @@ public void toRowMutationEntryTest() {
255246 Value .rawTimestamp (1000 ),
256247 Value .rawValue (ByteString .copyFrom (Longs .toByteArray (1234L ))))
257248 .setToken ("fake-token" )
258- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN )
249+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK )
259250 .build ();
260251
261252 // Convert it to a rowMutationEntry and construct a MutateRowRequest.
@@ -295,7 +286,7 @@ public void toRowMutationEntryWithoutTokenShouldFailTest() {
295286 ChangeStreamMutation .createUserMutation (
296287 ByteString .copyFromUtf8 ("key" ), "fake-source-cluster-id" , FAKE_COMMIT_TIMESTAMP , 0 )
297288 .deleteFamily ("fake-family" )
298- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN );
289+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK );
299290 Assert .assertThrows (IllegalStateException .class , builder ::build );
300291 }
301292
@@ -320,7 +311,7 @@ public void testWithLongValue() {
320311 1000L ,
321312 ByteString .copyFrom (Longs .toByteArray (1L )))
322313 .setToken ("fake-token" )
323- .setEstimatedLowWatermark (FAKE_LOW_WATERMARK_THREETEN )
314+ .setEstimatedLowWatermark (FAKE_LOW_WATERMARK )
324315 .build ();
325316
326317 RowMutation rowMutation = changeStreamMutation .toRowMutation (TABLE_ID );
0 commit comments