@@ -52,23 +52,23 @@ void assertEncodesAndDecodesCorrectly(Value proto, Object object) {
52
52
53
53
@ Test
54
54
public void minKeyIsSingleton () {
55
- MinKey minKey1 = FieldValue . minKey ();
55
+ MinKey minKey1 = MinKey . instance ();
56
56
MinKey minKey2 = MinKey .instance ();
57
57
assertThat (minKey1 ).isEqualTo (minKey2 );
58
- assertThat (minKey1 ).isNotEqualTo (FieldValue . maxKey ());
58
+ assertThat (minKey1 ).isNotEqualTo (MaxKey . instance ());
59
59
}
60
60
61
61
@ Test
62
62
public void maxKeyIsSingleton () {
63
- MaxKey maxKey1 = FieldValue . maxKey ();
63
+ MaxKey maxKey1 = MaxKey . instance ();
64
64
MaxKey maxKey2 = MaxKey .instance ();
65
65
assertThat (maxKey1 ).isEqualTo (maxKey2 );
66
- assertThat (maxKey1 ).isNotEqualTo (FieldValue . minKey ());
66
+ assertThat (maxKey1 ).isNotEqualTo (MinKey . instance ());
67
67
}
68
68
69
69
@ Test
70
70
public void regexFieldsAndEquality () {
71
- RegexValue regex1 = FieldValue . regex ("^foo" , "i" );
71
+ RegexValue regex1 = new RegexValue ("^foo" , "i" );
72
72
RegexValue regex2 = new RegexValue ("^foo" , "i" );
73
73
RegexValue regex3 = new RegexValue ("^foo" , "x" );
74
74
RegexValue regex4 = new RegexValue ("^bar" , "i" );
@@ -82,7 +82,7 @@ public void regexFieldsAndEquality() {
82
82
83
83
@ Test
84
84
public void Int32ValueAndEquality () {
85
- Int32Value i1 = FieldValue . int32 (123 );
85
+ Int32Value i1 = new Int32Value (123 );
86
86
Int32Value i2 = new Int32Value (123 );
87
87
Int32Value i3 = new Int32Value (456 );
88
88
@@ -93,7 +93,7 @@ public void Int32ValueAndEquality() {
93
93
94
94
@ Test
95
95
public void BsonObjectIdValueAndEquality () {
96
- BsonObjectId oid1 = FieldValue . bsonObjectId ("foo" );
96
+ BsonObjectId oid1 = new BsonObjectId ("foo" );
97
97
BsonObjectId oid2 = new BsonObjectId ("foo" );
98
98
BsonObjectId oid3 = new BsonObjectId ("bar" );
99
99
@@ -104,7 +104,7 @@ public void BsonObjectIdValueAndEquality() {
104
104
105
105
@ Test
106
106
public void BsonTimestampValuesAndEquality () {
107
- BsonTimestamp t1 = FieldValue . bsonTimestamp (123 , 456 );
107
+ BsonTimestamp t1 = new BsonTimestamp (123 , 456 );
108
108
BsonTimestamp t2 = new BsonTimestamp (123 , 456 );
109
109
BsonTimestamp t3 = new BsonTimestamp (124 , 456 );
110
110
BsonTimestamp t4 = new BsonTimestamp (123 , 457 );
@@ -118,7 +118,7 @@ public void BsonTimestampValuesAndEquality() {
118
118
119
119
@ Test
120
120
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 });
122
122
BsonBinaryData b2 = BsonBinaryData .fromBytes (127 , new byte [] {1 , 2 , 3 });
123
123
BsonBinaryData b3 = BsonBinaryData .fromBytes (1 , new byte [] {1 , 2 , 3 });
124
124
BsonBinaryData b4 = BsonBinaryData .fromBytes (127 , new byte [] {1 , 2 , 4 });
@@ -133,8 +133,8 @@ public void BsonBinaryDataValuesAndEquality() {
133
133
@ Test
134
134
public void BsonBinaryDataConvertsByteToIntAndIntToByteCorrectly () {
135
135
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
138
138
BsonBinaryData b3 = BsonBinaryData .fromBytes (255 , data ); // 0xFF - MSB:1
139
139
140
140
BsonBinaryData b4 = UserDataConverter .decodeBsonBinary (b1 .toProto ());
@@ -267,7 +267,7 @@ public void BsonTimestampValidation() {
267
267
// Negative seconds
268
268
IllegalArgumentException error1 = null ;
269
269
try {
270
- BsonTimestamp t1 = FieldValue . bsonTimestamp (-1 , 1 );
270
+ BsonTimestamp t1 = new BsonTimestamp (-1 , 1 );
271
271
} catch (IllegalArgumentException e ) {
272
272
error1 = e ;
273
273
}
@@ -278,7 +278,7 @@ public void BsonTimestampValidation() {
278
278
// Larger than 2^32-1 seconds
279
279
IllegalArgumentException error2 = null ;
280
280
try {
281
- BsonTimestamp t1 = FieldValue . bsonTimestamp (4294967296L , 1 );
281
+ BsonTimestamp t1 = new BsonTimestamp (4294967296L , 1 );
282
282
} catch (IllegalArgumentException e ) {
283
283
error2 = e ;
284
284
}
@@ -289,7 +289,7 @@ public void BsonTimestampValidation() {
289
289
// Negative increment
290
290
IllegalArgumentException error3 = null ;
291
291
try {
292
- BsonTimestamp t1 = FieldValue . bsonTimestamp (1234 , -1 );
292
+ BsonTimestamp t1 = new BsonTimestamp (1234 , -1 );
293
293
} catch (IllegalArgumentException e ) {
294
294
error3 = e ;
295
295
}
@@ -300,7 +300,7 @@ public void BsonTimestampValidation() {
300
300
// Larger than 2^32-1 increment
301
301
IllegalArgumentException error4 = null ;
302
302
try {
303
- BsonTimestamp t1 = FieldValue . bsonTimestamp (123 , 4294967296L );
303
+ BsonTimestamp t1 = new BsonTimestamp (123 , 4294967296L );
304
304
} catch (IllegalArgumentException e ) {
305
305
error4 = e ;
306
306
}
@@ -311,7 +311,7 @@ public void BsonTimestampValidation() {
311
311
312
312
@ Test
313
313
public void canEncodeAndDecodeMinKey () {
314
- MinKey minKey = FieldValue . minKey ();
314
+ MinKey minKey = MinKey . instance ();
315
315
Value proto =
316
316
Value .newBuilder ()
317
317
.setMapValue (
@@ -325,7 +325,7 @@ public void canEncodeAndDecodeMinKey() {
325
325
326
326
@ Test
327
327
public void canEncodeAndDecodeMaxKey () {
328
- MaxKey maxKey = FieldValue . maxKey ();
328
+ MaxKey maxKey = MaxKey . instance ();
329
329
Value proto =
330
330
Value .newBuilder ()
331
331
.setMapValue (
@@ -389,7 +389,7 @@ public void canEncodeAndDecodeBsonObjectId() {
389
389
390
390
@ Test
391
391
public void canEncodeAndDecodeBsonTimestamp () {
392
- BsonTimestamp bsonTimestamp = FieldValue . bsonTimestamp (12345 , 67 );
392
+ BsonTimestamp bsonTimestamp = new BsonTimestamp (12345 , 67 );
393
393
Value proto =
394
394
Value .newBuilder ()
395
395
.setMapValue (
@@ -413,7 +413,7 @@ public void canEncodeAndDecodeBsonTimestamp() {
413
413
414
414
@ Test
415
415
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 });
417
417
Value proto =
418
418
Value .newBuilder ()
419
419
.setMapValue (
0 commit comments