@Test
public void importedSessionListenerShouldBeRegistered() {

  Assume.assumeFalse("Unified pipeline import cannot yet be tested because of dependencies on TransportService.getInstance().",
                     myUnifiedPipeline);
  myCpuProfiler = new CpuProfiler(myProfilers);
  File trace = CpuProfilerTestUtils.getTraceFile("valid_trace.trace");
  SessionsManager sessionsManager = myProfilers.getSessionsManager();
  // Importing a session from a trace file should select a Common.SessionMetaData.SessionType.CPU_CAPTURE session
  sessionsManager.importSessionFromFile(trace);
  // Verify that CpuProfilerStage is open in Import trace mode
  assertThat(myProfilers.getStage()).isInstanceOf(CpuProfilerStage.class);
  CpuProfilerStage cpuProfilerStage = (CpuProfilerStage)myProfilers.getStage();
  assertThat(cpuProfilerStage.isImportTraceMode()).isTrue();
}