@Test public void testOnBluetoothDeviceDiscovered() throws Exception { Field fieldGattManager = mBluetoothMacAddressResolutionHelper.getClass() .getDeclaredField("mBluetoothGattManager"); fieldGattManager.setAccessible(true); fieldGattManager.set(mBluetoothMacAddressResolutionHelper, mMockBluetoothGattManager); mBluetoothMacAddressResolutionHelper.onBluetoothDeviceDiscovered(mMockBluetoothDevice); verify(mMockBluetoothDevice, times(1)).getAddress(); verify(mMockBluetoothGattManager, times(1)) .provideBluetoothMacAddressToDevice((BluetoothDevice) anyObject(), anyString()); }
@Override public void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice) { String bluetoothMacAddress = bluetoothDevice.getAddress(); Log.d(TAG, "onBluetoothDeviceDiscovered: " + bluetoothMacAddress); provideBluetoothMacAddressToDevice(bluetoothDevice); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { @Override public void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice) { String bluetoothMacAddress = bluetoothDevice.getAddress(); Log.d(TAG, "onBluetoothDeviceDiscovered: " + bluetoothMacAddress); provideBluetoothMacAddressToDevice(bluetoothDevice); } }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { @Override public void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice) { String bluetoothMacAddress = bluetoothDevice.getAddress(); Log.d(TAG, "onBluetoothDeviceDiscovered: " + bluetoothMacAddress); provideBluetoothMacAddressToDevice(bluetoothDevice); } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { @Override public void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice) { String bluetoothMacAddress = bluetoothDevice.getAddress(); Log.d(TAG, "onBluetoothDeviceDiscovered: " + bluetoothMacAddress); provideBluetoothMacAddressToDevice(bluetoothDevice); } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); UUID getProvideBluetoothMacAddressRequestUuid(); String getCurrentProvideBluetoothMacAddressRequestId(); boolean getIsProvideBluetoothMacAddressModeStarted(); boolean getIsBluetoothMacAddressGattServerStarted(); boolean getIsReceiveBluetoothMacAddressModeStarted(); synchronized void stopAllBluetoothMacAddressResolutionOperations(); synchronized boolean startProvideBluetoothMacAddressMode(String requestId); synchronized void stopProvideBluetoothMacAddressMode(); void provideBluetoothMacAddressToDevice(BluetoothDevice bluetoothDevice); synchronized void startReceiveBluetoothMacAddressMode(String requestId); synchronized void stopReceiveBluetoothMacAddressMode(); void startBluetoothMacAddressGattServer(String requestId); synchronized boolean startBluetoothDeviceDiscovery(); synchronized boolean stopBluetoothDeviceDiscovery(); @Override void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice); @Override void onBluetoothGattClientOperationCountInQueueChanged(int operationCountInQueue); @Override void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted); @Override void onBluetoothMacAddressResolved(String bluetoothMacAddress); }
BluetoothMacAddressResolutionHelper implements BluetoothDeviceDiscoverer.BluetoothDeviceDiscovererListener,
                   BluetoothGattManager.BluetoothGattManagerListener { @Override public void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice) { String bluetoothMacAddress = bluetoothDevice.getAddress(); Log.d(TAG, "onBluetoothDeviceDiscovered: " + bluetoothMacAddress); provideBluetoothMacAddressToDevice(bluetoothDevice); } BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid);  BluetoothMacAddressResolutionHelper(
            Context context, BluetoothAdapter bluetoothAdapter, DiscoveryManager discoveryManager,
            UUID bleServiceUuid, UUID provideBluetoothMacAddressRequestUuid, SharedPreferences preferences); UUID getProvideBluetoothMacAddressRequestUuid(); String getCurrentProvideBluetoothMacAddressRequestId(); boolean getIsProvideBluetoothMacAddressModeStarted(); boolean getIsBluetoothMacAddressGattServerStarted(); boolean getIsReceiveBluetoothMacAddressModeStarted(); synchronized void stopAllBluetoothMacAddressResolutionOperations(); synchronized boolean startProvideBluetoothMacAddressMode(String requestId); synchronized void stopProvideBluetoothMacAddressMode(); void provideBluetoothMacAddressToDevice(BluetoothDevice bluetoothDevice); synchronized void startReceiveBluetoothMacAddressMode(String requestId); synchronized void stopReceiveBluetoothMacAddressMode(); void startBluetoothMacAddressGattServer(String requestId); synchronized boolean startBluetoothDeviceDiscovery(); synchronized boolean stopBluetoothDeviceDiscovery(); @Override void onBluetoothDeviceDiscovered(BluetoothDevice bluetoothDevice); @Override void onBluetoothGattClientOperationCountInQueueChanged(int operationCountInQueue); @Override void onProvideBluetoothMacAddressResult(String requestId, boolean wasCompleted); @Override void onBluetoothMacAddressResolved(String bluetoothMacAddress);  }