@@ -52,23 +52,23 @@ void assertEncodesAndDecodesCorrectly(Value proto, Object object) {
5252
5353 @ Test
5454 public void minKeyIsSingleton () {
55- MinKey minKey1 = FieldValue . minKey ();
55+ MinKey minKey1 = MinKey . instance ();
5656 MinKey minKey2 = MinKey .instance ();
5757 assertThat (minKey1 ).isEqualTo (minKey2 );
58- assertThat (minKey1 ).isNotEqualTo (FieldValue . maxKey ());
58+ assertThat (minKey1 ).isNotEqualTo (MaxKey . instance ());
5959 }
6060
6161 @ Test
6262 public void maxKeyIsSingleton () {
63- MaxKey maxKey1 = FieldValue . maxKey ();
63+ MaxKey maxKey1 = MaxKey . instance ();
6464 MaxKey maxKey2 = MaxKey .instance ();
6565 assertThat (maxKey1 ).isEqualTo (maxKey2 );
66- assertThat (maxKey1 ).isNotEqualTo (FieldValue . minKey ());
66+ assertThat (maxKey1 ).isNotEqualTo (MinKey . instance ());
6767 }
6868
6969 @ Test
7070 public void regexFieldsAndEquality () {
71- RegexValue regex1 = FieldValue . regex ("^foo" , "i" );
71+ RegexValue regex1 = new RegexValue ("^foo" , "i" );
7272 RegexValue regex2 = new RegexValue ("^foo" , "i" );
7373 RegexValue regex3 = new RegexValue ("^foo" , "x" );
7474 RegexValue regex4 = new RegexValue ("^bar" , "i" );
@@ -82,7 +82,7 @@ public void regexFieldsAndEquality() {
8282
8383 @ Test
8484 public void Int32ValueAndEquality () {
85- Int32Value i1 = FieldValue . int32 (123 );
85+ Int32Value i1 = new Int32Value (123 );
8686 Int32Value i2 = new Int32Value (123 );
8787 Int32Value i3 = new Int32Value (456 );
8888
@@ -93,7 +93,7 @@ public void Int32ValueAndEquality() {
9393
9494 @ Test
9595 public void BsonObjectIdValueAndEquality () {
96- BsonObjectId oid1 = FieldValue . bsonObjectId ("foo" );
96+ BsonObjectId oid1 = new BsonObjectId ("foo" );
9797 BsonObjectId oid2 = new BsonObjectId ("foo" );
9898 BsonObjectId oid3 = new BsonObjectId ("bar" );
9999
@@ -104,7 +104,7 @@ public void BsonObjectIdValueAndEquality() {
104104
105105 @ Test
106106 public void BsonTimestampValuesAndEquality () {
107- BsonTimestamp t1 = FieldValue . bsonTimestamp (123 , 456 );
107+ BsonTimestamp t1 = new BsonTimestamp (123 , 456 );
108108 BsonTimestamp t2 = new BsonTimestamp (123 , 456 );
109109 BsonTimestamp t3 = new BsonTimestamp (124 , 456 );
110110 BsonTimestamp t4 = new BsonTimestamp (123 , 457 );
@@ -118,7 +118,7 @@ public void BsonTimestampValuesAndEquality() {
118118
119119 @ Test
120120 public void BsonBinaryDataValuesAndEquality () {
121- BsonBinaryData b1 = FieldValue . bsonBinaryData (127 , new byte [] {1 , 2 , 3 });
121+ BsonBinaryData b1 = BsonBinaryData . fromBytes (127 , new byte [] {1 , 2 , 3 });
122122 BsonBinaryData b2 = BsonBinaryData .fromBytes (127 , new byte [] {1 , 2 , 3 });
123123 BsonBinaryData b3 = BsonBinaryData .fromBytes (1 , new byte [] {1 , 2 , 3 });
124124 BsonBinaryData b4 = BsonBinaryData .fromBytes (127 , new byte [] {1 , 2 , 4 });
@@ -133,8 +133,8 @@ public void BsonBinaryDataValuesAndEquality() {
133133 @ Test
134134 public void BsonBinaryDataConvertsByteToIntAndIntToByteCorrectly () {
135135 byte [] data = new byte [] {1 , 2 , 3 };
136- BsonBinaryData b1 = FieldValue . bsonBinaryData (127 , data ); // 0x7F - MSB:0
137- BsonBinaryData b2 = FieldValue . bsonBinaryData (128 , data ); // 0x80 - MSB:1
136+ BsonBinaryData b1 = BsonBinaryData . fromBytes (127 , data ); // 0x7F - MSB:0
137+ BsonBinaryData b2 = BsonBinaryData . fromBytes (128 , data ); // 0x80 - MSB:1
138138 BsonBinaryData b3 = BsonBinaryData .fromBytes (255 , data ); // 0xFF - MSB:1
139139
140140 BsonBinaryData b4 = UserDataConverter .decodeBsonBinary (b1 .toProto ());
@@ -267,7 +267,7 @@ public void BsonTimestampValidation() {
267267 // Negative seconds
268268 IllegalArgumentException error1 = null ;
269269 try {
270- BsonTimestamp t1 = FieldValue . bsonTimestamp (-1 , 1 );
270+ BsonTimestamp t1 = new BsonTimestamp (-1 , 1 );
271271 } catch (IllegalArgumentException e ) {
272272 error1 = e ;
273273 }
@@ -278,7 +278,7 @@ public void BsonTimestampValidation() {
278278 // Larger than 2^32-1 seconds
279279 IllegalArgumentException error2 = null ;
280280 try {
281- BsonTimestamp t1 = FieldValue . bsonTimestamp (4294967296L , 1 );
281+ BsonTimestamp t1 = new BsonTimestamp (4294967296L , 1 );
282282 } catch (IllegalArgumentException e ) {
283283 error2 = e ;
284284 }
@@ -289,7 +289,7 @@ public void BsonTimestampValidation() {
289289 // Negative increment
290290 IllegalArgumentException error3 = null ;
291291 try {
292- BsonTimestamp t1 = FieldValue . bsonTimestamp (1234 , -1 );
292+ BsonTimestamp t1 = new BsonTimestamp (1234 , -1 );
293293 } catch (IllegalArgumentException e ) {
294294 error3 = e ;
295295 }
@@ -300,7 +300,7 @@ public void BsonTimestampValidation() {
300300 // Larger than 2^32-1 increment
301301 IllegalArgumentException error4 = null ;
302302 try {
303- BsonTimestamp t1 = FieldValue . bsonTimestamp (123 , 4294967296L );
303+ BsonTimestamp t1 = new BsonTimestamp (123 , 4294967296L );
304304 } catch (IllegalArgumentException e ) {
305305 error4 = e ;
306306 }
@@ -311,7 +311,7 @@ public void BsonTimestampValidation() {
311311
312312 @ Test
313313 public void canEncodeAndDecodeMinKey () {
314- MinKey minKey = FieldValue . minKey ();
314+ MinKey minKey = MinKey . instance ();
315315 Value proto =
316316 Value .newBuilder ()
317317 .setMapValue (
@@ -325,7 +325,7 @@ public void canEncodeAndDecodeMinKey() {
325325
326326 @ Test
327327 public void canEncodeAndDecodeMaxKey () {
328- MaxKey maxKey = FieldValue . maxKey ();
328+ MaxKey maxKey = MaxKey . instance ();
329329 Value proto =
330330 Value .newBuilder ()
331331 .setMapValue (
@@ -389,7 +389,7 @@ public void canEncodeAndDecodeBsonObjectId() {
389389
390390 @ Test
391391 public void canEncodeAndDecodeBsonTimestamp () {
392- BsonTimestamp bsonTimestamp = FieldValue . bsonTimestamp (12345 , 67 );
392+ BsonTimestamp bsonTimestamp = new BsonTimestamp (12345 , 67 );
393393 Value proto =
394394 Value .newBuilder ()
395395 .setMapValue (
@@ -413,7 +413,7 @@ public void canEncodeAndDecodeBsonTimestamp() {
413413
414414 @ Test
415415 public void canEncodeAndDecodeBsonBinaryData () {
416- BsonBinaryData bsonBinaryData = FieldValue . bsonBinaryData (127 , new byte [] {1 , 2 , 3 });
416+ BsonBinaryData bsonBinaryData = BsonBinaryData . fromBytes (127 , new byte [] {1 , 2 , 3 });
417417 Value proto =
418418 Value .newBuilder ()
419419 .setMapValue (
0 commit comments