1919import static org .junit .Assert .assertEquals ;
2020import static org .junit .Assert .assertNull ;
2121
22- import com .google .api .client .json .GenericJson ;
2322import com .google .common .collect .ImmutableList ;
2423import com .google .firebase .FirebaseApp ;
2524import com .google .firebase .database .ChildEventListener ;
@@ -66,7 +65,9 @@ public static void setUpClass() {
6665
6766 @ AfterClass
6867 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\" }}" );
7071 }
7172
7273 @ Before
@@ -81,7 +82,8 @@ public void checkAndCleanupApp() {
8182
8283 private static String formatRules (DatabaseReference ref , String rules ) {
8384 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 );
8587 }
8688
8789 private static void uploadRules (FirebaseApp app , String rules ) throws IOException {
@@ -922,7 +924,7 @@ public void onComplete(DatabaseError error, DatabaseReference ref) {
922924
923925 @ Test
924926 public void testStartAtAndEndAtOnValueIndex ()
925- throws InterruptedException , ExecutionException , TimeoutException , TestFailure , IOException {
927+ throws InterruptedException , ExecutionException , TimeoutException , TestFailure {
926928 DatabaseReference ref = IntegrationTestUtils .getRandomNode (masterApp ) ;
927929
928930 Map <String , Object > initial =
@@ -982,7 +984,7 @@ public void onChildAdded(DataSnapshot snapshot, String previousChildName) {
982984
983985 @ Test
984986 public void testRemovingDefaultListener ()
985- throws InterruptedException , ExecutionException , TimeoutException , TestFailure , IOException {
987+ throws InterruptedException , ExecutionException , TimeoutException , TestFailure {
986988 DatabaseReference ref = IntegrationTestUtils .getRandomNode (masterApp ) ;
987989
988990 Object initialData = MapBuilder .of ("key" , "value" );
0 commit comments