summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-03-23 15:30:56 -0700
committerPeter Qiu <zqiu@google.com>2017-03-23 15:30:56 -0700
commitbd7478ac1841804d128740fa1ae7dce64af1e4e2 (patch)
tree1f9b251e4f8204bef27769f86eba9c9a43b2c48d
parent1316bfba023da3371bbc590ab2edee19c9475c03 (diff)
hotspot2: fix failures in PasspointNetworkEvaulatorTest
Bug: None Test: frameworks/opt/net/wifi/tests/wifitests/runtests -e class com.android.server.wifi.hotspot2.PasspointNetworkEvaluatorTest Change-Id: Ia3579ac9c3b491a306b2e9d62cb7dda740f077ca
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java
index c4527adc4..27e7c3da7 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java
@@ -30,6 +30,8 @@ import static org.mockito.MockitoAnnotations.initMocks;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
+import android.net.wifi.hotspot2.PasspointConfiguration;
+import android.net.wifi.hotspot2.pps.HomeSp;
import android.test.suitebuilder.annotation.SmallTest;
import android.util.Pair;
@@ -86,6 +88,11 @@ public class PasspointNetworkEvaluatorTest {
*/
private static PasspointProvider generateProvider(WifiConfiguration config) {
PasspointProvider provider = mock(PasspointProvider.class);
+ PasspointConfiguration passpointConfig = new PasspointConfiguration();
+ HomeSp homeSp = new HomeSp();
+ homeSp.setFqdn(config.FQDN);
+ passpointConfig.setHomeSp(homeSp);
+ when(provider.getConfig()).thenReturn(passpointConfig);
when(provider.getWifiConfig()).thenReturn(config);
return provider;
}