summaryrefslogtreecommitdiff
path: root/wifi/tests
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2020-02-19 20:17:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-19 20:17:42 +0000
commitda4585593fa357905133553d1b42c924b63124b4 (patch)
tree291dfc1ac746df86782f03ae4a7344026c116ae3 /wifi/tests
parentf2dc70b4b77826f3f890c38ecb8d72da26d3630e (diff)
parentefc940ff3fe1559d00f44586cd6274f2789e9ad0 (diff)
Merge "[Passpoint] Remove throws IllegalStateException form getUniqueId API"
Diffstat (limited to 'wifi/tests')
-rw-r--r--wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java20
1 files changed, 4 insertions, 16 deletions
diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
index 8f6beb19091b..638efb9f14ee 100644
--- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java
@@ -426,17 +426,11 @@ public class PasspointConfigurationTest {
*
* @throws Exception
*/
- @Test
+ @Test (expected = IllegalStateException.class)
public void validateUniqueIdExceptionWithEmptyHomeSp() throws Exception {
PasspointConfiguration config = PasspointTestUtils.createConfig();
config.setHomeSp(null);
- boolean exceptionCaught = false;
- try {
- String uniqueId = config.getUniqueId();
- } catch (IllegalStateException e) {
- exceptionCaught = true;
- }
- assertTrue(exceptionCaught);
+ String uniqueId = config.getUniqueId();
}
/**
@@ -445,16 +439,10 @@ public class PasspointConfigurationTest {
*
* @throws Exception
*/
- @Test
+ @Test (expected = IllegalStateException.class)
public void validateUniqueIdExceptionWithEmptyCredential() throws Exception {
PasspointConfiguration config = PasspointTestUtils.createConfig();
config.setCredential(null);
- boolean exceptionCaught = false;
- try {
- String uniqueId = config.getUniqueId();
- } catch (IllegalStateException e) {
- exceptionCaught = true;
- }
- assertTrue(exceptionCaught);
+ String uniqueId = config.getUniqueId();
}
}