12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- package com .google .firebase .firestore .util ;
15
+ package com .google .firebase .firestore .sdk34 . util ;
16
16
17
17
import java .io .Serializable ;
18
18
import java .math .BigDecimal ;
29
29
import org .junit .Test ;
30
30
import org .robolectric .annotation .Config ;
31
31
32
+ import com .google .firebase .firestore .DocumentId ;
32
33
import com .google .firebase .firestore .DocumentReference ;
34
+ import com .google .firebase .firestore .PropertyName ;
33
35
import com .google .firebase .firestore .TestUtil ;
34
36
import com .google .firebase .firestore .ThrowOnExtraProperties ;
35
- import com .google .firebase .firestore .sdk34 .DocumentId ;
36
- import com .google .firebase .firestore .sdk34 .PropertyName ;
37
+ import com .google .firebase .firestore .util .CustomClassMapper ;
37
38
38
39
import static com .google .firebase .firestore .sdk34 .LocalFirestoreHelper .fromSingleQuotedString ;
39
40
import static com .google .firebase .firestore .sdk34 .LocalFirestoreHelper .mapAnyType ;
40
41
import static org .junit .Assert .*;
41
42
42
43
@ org .junit .runner .RunWith (org .robolectric .RobolectricTestRunner .class )
43
- @ Config (manifest = Config .NONE , sdk = 34 )
44
+ @ Config (manifest = Config .NONE , sdk = 33 )
44
45
@ SuppressWarnings ({"unused" , "WeakerAccess" , "SpellCheckingInspection" })
45
46
public class RecordMapperTest {
46
47
private static final double EPSILON = 0.0003 ;
@@ -347,6 +348,7 @@ public void primitiveDeserializeDouble() {
347
348
}
348
349
}
349
350
351
+ /*
350
352
@Test
351
353
public void primitiveDeserializeBigDecimal() {
352
354
var beanBigdecimal = deserialize("{'value': 123}", BigDecimalBean.class);
@@ -390,6 +392,7 @@ public void primitiveDeserializeBigDecimal() {
390
392
} catch (RuntimeException e) { // ignore
391
393
}
392
394
}
395
+ */
393
396
394
397
@ Test
395
398
public void primitiveDeserializeFloat () {
@@ -515,15 +518,15 @@ public void primitiveDeserializeWrongTypeList() {
515
518
public void noFieldDeserialize () {
516
519
assertExceptionContains (
517
520
"No properties to serialize found on class "
518
- + "com.google.firebase.firestore.RecordMapperTest$NoFieldBean" ,
521
+ + "com.google.firebase.firestore.sdk34.util. RecordMapperTest$NoFieldBean" ,
519
522
() -> deserialize ("{'value': 'foo'}" , NoFieldBean .class ));
520
523
}
521
524
522
525
@ Test
523
526
public void throwOnUnknownProperties () {
524
527
assertExceptionContains (
525
528
"No accessor for unknown found on class "
526
- + "com.google.firebase.firestore.RecordMapperTest$ThrowOnUnknownPropertiesBean" ,
529
+ + "com.google.firebase.firestore.sdk34.util. RecordMapperTest$ThrowOnUnknownPropertiesBean" ,
527
530
() ->
528
531
deserialize ("{'value': 'foo', 'unknown': 'bar'}" , ThrowOnUnknownPropertiesBean .class ));
529
532
}
@@ -673,6 +676,7 @@ public void serializeLongBean() {
673
676
serialize (Collections .singletonMap ("value" , 1.234567890123E12 )));
674
677
}
675
678
679
+ /*
676
680
@Test
677
681
public void serializeBigDecimalBean() {
678
682
var bean = new BigDecimalBean(BigDecimal.valueOf(1.1));
@@ -687,6 +691,7 @@ public void bigDecimalRoundTrip() {
687
691
var b = convertToCustomClass(serialized, BigDecimalBean.class);
688
692
assertEquals(a, b);
689
693
}
694
+ */
690
695
691
696
@ Test
692
697
public void serializeBooleanBean () {
@@ -707,7 +712,7 @@ public void serializePrivateFieldBean() {
707
712
final var bean = new NoFieldBean ();
708
713
assertExceptionContains (
709
714
"No properties to serialize found on class "
710
- + "com.google.firebase.firestore.RecordMapperTest$NoFieldBean" ,
715
+ + "com.google.firebase.firestore.sdk34.util. RecordMapperTest$NoFieldBean" ,
711
716
() -> serialize (bean ));
712
717
}
713
718
@@ -839,15 +844,15 @@ public void roundTripUnicodeBean() {
839
844
public void shortsCantBeSerialized () {
840
845
final var bean = new ShortBean ((short ) 1 );
841
846
assertExceptionContains (
842
- "Numbers of type Short are not supported, please use an int, long, float, double or BigDecimal (found in field 'value')" ,
847
+ "Numbers of type Short are not supported, please use an int, long, float or double (found in field 'value')" ,
843
848
() -> serialize (bean ));
844
849
}
845
850
846
851
@ Test
847
852
public void bytesCantBeSerialized () {
848
853
final var bean = new ByteBean ((byte ) 1 );
849
854
assertExceptionContains (
850
- "Numbers of type Byte are not supported, please use an int, long, float, double or BigDecimal (found in field 'value')" ,
855
+ "Numbers of type Byte are not supported, please use an int, long, float or double (found in field 'value')" ,
851
856
() -> serialize (bean ));
852
857
}
853
858
@@ -928,10 +933,8 @@ public void objectAcceptsAnyObject() {
928
933
929
934
@ Test
930
935
public void passingInGenericBeanTopLevelThrows () {
931
- assertExceptionContains (
932
- "Class com.google.firebase.firestore.RecordMapperTest$GenericBean has generic type "
933
- + "parameters, please use GenericTypeIndicator instead" ,
934
- () -> deserialize ("{'value': 'foo'}" , GenericBean .class ));
936
+ assertExceptionContains ("Class com.google.firebase.firestore.sdk34.util.RecordMapperTest$GenericBean has generic type parameters" ,
937
+ () -> deserialize ("{'value': 'foo'}" , GenericBean .class ));
935
938
}
936
939
937
940
@ Test
0 commit comments