19
19
import static org .junit .Assert .assertEquals ;
20
20
import static org .junit .Assert .assertNull ;
21
21
22
- import com .google .api .client .json .GenericJson ;
23
22
import com .google .common .collect .ImmutableList ;
24
23
import com .google .firebase .FirebaseApp ;
25
24
import com .google .firebase .database .ChildEventListener ;
@@ -66,7 +65,9 @@ public static void setUpClass() {
66
65
67
66
@ AfterClass
68
67
public static void tearDownClass () throws IOException {
69
- uploadRules (masterApp , "{\" rules\" : {\" .read\" : true, \" .write\" : true}}" );
68
+ uploadRules (
69
+ masterApp ,
70
+ "{\" rules\" : {\" .read\" : \" auth != null\" , \" .write\" : \" auth != null\" }}" );
70
71
}
71
72
72
73
@ Before
@@ -81,7 +82,8 @@ public void checkAndCleanupApp() {
81
82
82
83
private static String formatRules (DatabaseReference ref , String rules ) {
83
84
return String .format (
84
- "{\" rules\" : {\" .read\" : true, \" .write\" : true, \" %s\" : %s}}" , ref .getKey (), rules );
85
+ "{\" rules\" : {\" .read\" : \" auth != null\" , \" .write\" : \" auth != null\" , \" %s\" : %s}}" ,
86
+ ref .getKey (), rules );
85
87
}
86
88
87
89
private static void uploadRules (FirebaseApp app , String rules ) throws IOException {
@@ -922,7 +924,7 @@ public void onComplete(DatabaseError error, DatabaseReference ref) {
922
924
923
925
@ Test
924
926
public void testStartAtAndEndAtOnValueIndex ()
925
- throws InterruptedException , ExecutionException , TimeoutException , TestFailure , IOException {
927
+ throws InterruptedException , ExecutionException , TimeoutException , TestFailure {
926
928
DatabaseReference ref = IntegrationTestUtils .getRandomNode (masterApp ) ;
927
929
928
930
Map <String , Object > initial =
@@ -982,7 +984,7 @@ public void onChildAdded(DataSnapshot snapshot, String previousChildName) {
982
984
983
985
@ Test
984
986
public void testRemovingDefaultListener ()
985
- throws InterruptedException , ExecutionException , TimeoutException , TestFailure , IOException {
987
+ throws InterruptedException , ExecutionException , TimeoutException , TestFailure {
986
988
DatabaseReference ref = IntegrationTestUtils .getRandomNode (masterApp ) ;
987
989
988
990
Object initialData = MapBuilder .of ("key" , "value" );
0 commit comments