Merge "Catch exception when failing to create slice" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-04-21 02:03:49 +00:00
committed by Android (Google) Code Review
4 changed files with 147 additions and 13 deletions

View File

@@ -70,7 +70,7 @@ public class SliceDataTest {
assertThat(data.isPlatformDefined()).isEqualTo(IS_PLATFORM_DEFINED);
}
@Test(expected = IllegalStateException.class)
@Test(expected = SliceData.InvalidSliceDataException.class)
public void testBuilder_noKey_throwsIllegalStateException() {
new SliceData.Builder()
.setTitle(TITLE)
@@ -83,7 +83,7 @@ public class SliceDataTest {
.build();
}
@Test(expected = IllegalStateException.class)
@Test(expected = SliceData.InvalidSliceDataException.class)
public void testBuilder_noTitle_throwsIllegalStateException() {
new SliceData.Builder()
.setKey(KEY)
@@ -96,7 +96,7 @@ public class SliceDataTest {
.build();
}
@Test(expected = IllegalStateException.class)
@Test(expected = SliceData.InvalidSliceDataException.class)
public void testBuilder_noFragment_throwsIllegalStateException() {
new SliceData.Builder()
.setKey(KEY)
@@ -109,7 +109,7 @@ public class SliceDataTest {
.build();
}
@Test(expected = IllegalStateException.class)
@Test(expected = SliceData.InvalidSliceDataException.class)
public void testBuilder_noPrefController_throwsIllegalStateException() {
new SliceData.Builder()
.setKey(KEY)