File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
firebase-storage/src/test/java/com/google/firebase/storage Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -148,9 +148,11 @@ public void initWithDefaultAndCustomUriTest() throws Exception {
148
148
Assert .assertEquals ("gs://foo-bar.appspot.com/" , customRef .toString ());
149
149
}
150
150
151
- @ Test ( expected = IllegalArgumentException . class )
151
+ @ Test
152
152
public void badInitTest () throws Exception {
153
- FirebaseStorage .getInstance ().getReference ("gs://fooey.appspot.com/child" );
153
+ assertThrows (
154
+ IllegalArgumentException .class ,
155
+ () -> FirebaseStorage .getInstance ().getReference ("gs://fooey.appspot.com/child" ));
154
156
}
155
157
156
158
@ Test
@@ -178,15 +180,18 @@ public void initWithApp() throws Exception {
178
180
Assert .assertEquals ("child" , ref .getName ());
179
181
}
180
182
181
- @ Test ( expected = IllegalArgumentException . class )
183
+ @ Test
182
184
public void badInitWithApp1 () throws Exception {
183
- FirebaseStorage .getInstance ().getReference ("gs://bucket/child" );
185
+ assertThrows (
186
+ IllegalArgumentException .class ,
187
+ () -> FirebaseStorage .getInstance ().getReference ("gs://bucket/child" ));
184
188
}
185
189
186
190
@ SuppressWarnings ("ConstantConditions" )
187
- @ Test ( expected = IllegalArgumentException . class )
191
+ @ Test
188
192
public void badInitWithApp2 () throws Exception {
189
- FirebaseStorage .getInstance ().getReference (null );
193
+ assertThrows (
194
+ IllegalArgumentException .class , () -> FirebaseStorage .getInstance ().getReference (null ));
190
195
}
191
196
192
197
@ Test
You can’t perform that action at this time.
0 commit comments