From bd7478ac1841804d128740fa1ae7dce64af1e4e2 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Thu, 23 Mar 2017 15:30:56 -0700 Subject: 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 --- .../server/wifi/hotspot2/PasspointNetworkEvaluatorTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- cgit v1.2.3