@Test
  public void shouldNotifyListenersOnSessionClobber() {
    sessionManager.getSession().setId(1234);
    sessionManager.discardSession();

    verify(sessionManager.eventBus).post(Mockito.any(SessionChangeEvent.class));
  }
  @Test
  public void measurements_withoutLocation_should_get_a_fake() {
    sessionManager.startMobileSession(false);
    sessionManager.session.setLocationless(true);
    when(sessionManager.locationHelper.getLastLocation()).thenReturn(null);

    triggerMeasurement();

    assertThat(sessionManager.getMeasurementStreams().isEmpty(), equalTo(false));
    assertThat(sessionManager.getSession().isLocationless(), equalTo(true));
  }
  @Test
  public void shouldDiscardASession() {
    sessionManager.startMobileSession(false);
    sessionManager.getSession().setId(1234);

    triggerMeasurement(13.5);
    sessionManager.discardSession();

    verify(sessionManager.audioReader, never()).stop();
    verify(sessionManager.locationHelper).stop();
    verify(sessionManager.sessionRepository, never()).save(Mockito.any(Session.class));
    assertThat(sessionManager.getMeasurementStreams().isEmpty(), equalTo(true));
    assertThat(sessionManager.isSessionStarted(), equalTo(false));
  }