@Test public void testLastScan() { wifiCapturer.makeFingerprint(progressDialog, consumer); receiver = getReceiver(); when(progressDialog.getProgress()).thenReturn(100); receiver.onReceive(null, null); ArgumentCaptor<Runnable> uiRunnableArgumentCaptor = ArgumentCaptor.forClass(Runnable.class); verify(activity).runOnUiThread(uiRunnableArgumentCaptor.capture()); Runnable uiRunnable = uiRunnableArgumentCaptor.getValue(); uiRunnable.run(); verify(progressDialog).dismiss(); verify(wifiManager, times(1)).startScan(); verify(consumer).addHistogram(any(Histogram.class)); }
public void makeFingerprint(final ProgressDialog progressDialog, final HistogramConsumer consumer) { this.progressDialog = progressDialog; this.fingerprintHistogramConsumer = consumer; startSensors(); }
WifiCapturer implements SensorCollector { public void makeFingerprint(final ProgressDialog progressDialog, final HistogramConsumer consumer) { this.progressDialog = progressDialog; this.fingerprintHistogramConsumer = consumer; startSensors(); } }
WifiCapturer implements SensorCollector { public void makeFingerprint(final ProgressDialog progressDialog, final HistogramConsumer consumer) { this.progressDialog = progressDialog; this.fingerprintHistogramConsumer = consumer; startSensors(); } WifiCapturer(final Activity activity);  WifiCapturer(final Activity activity, final HistogramConsumer consumer, final int maxAge); }
WifiCapturer implements SensorCollector { public void makeFingerprint(final ProgressDialog progressDialog, final HistogramConsumer consumer) { this.progressDialog = progressDialog; this.fingerprintHistogramConsumer = consumer; startSensors(); } WifiCapturer(final Activity activity);  WifiCapturer(final Activity activity, final HistogramConsumer consumer, final int maxAge); void makeFingerprint(final  ProgressDialog progressDialog, final HistogramConsumer consumer); @Override void startSensors(); @Override void stopSensors(); }
WifiCapturer implements SensorCollector { public void makeFingerprint(final ProgressDialog progressDialog, final HistogramConsumer consumer) { this.progressDialog = progressDialog; this.fingerprintHistogramConsumer = consumer; startSensors(); } WifiCapturer(final Activity activity);  WifiCapturer(final Activity activity, final HistogramConsumer consumer, final int maxAge); void makeFingerprint(final  ProgressDialog progressDialog, final HistogramConsumer consumer); @Override void startSensors(); @Override void stopSensors(); static final String TAG; static final int NUMBER_SCANS; }