WorkspaceProbesFactory { public WorkspaceProbes getProbes(RuntimeIdentity runtimeId, Runtime runtime) throws InfrastructureException { return getProbes(runtimeId, runtime.getMachines()); } @Inject  WorkspaceProbesFactory(
      MachineTokenProvider machineTokenProvider,
      @Named("che.workspace.server.ping_success_threshold") int serverPingSuccessThreshold); WorkspaceProbes getProbes(RuntimeIdentity runtimeId, Runtime runtime); WorkspaceProbes getProbes(
      RuntimeIdentity runtimeId, Map<String, ? extends Machine> machines); WorkspaceProbes getProbes(
      RuntimeIdentity runtimeId, String machineName, Map<String, ? extends Server> servers);  }
@Test public void shouldNotCreateProbesFactoriesForOtherServers() throws Exception { WorkspaceProbes wsProbes = probesFactory.getProbes( IDENTITY, MACHINE_NAME, ImmutableMap.of("server1/http", SERVER, "terminal/http", SERVER, "terminal1", SERVER)); assertTrue(wsProbes.getProbes().isEmpty()); }
@Test public void returnsProbesForAMachineForWsAgent() throws Exception { WorkspaceProbes wsProbes = probesFactory.getProbes( IDENTITY, MACHINE_NAME, singletonMap(SERVER_WS_AGENT_HTTP_REFERENCE, SERVER)); verifyHttpProbeConfig( wsProbes, SERVER_WS_AGENT_HTTP_REFERENCE, 3, 1, 10, 10, 120, "/path1/liveness", "localhost", 4040, "https", singletonMap(HttpHeaders.AUTHORIZATION, "Bearer " + TOKEN)); }
@Test public void returnsProbesForAMachineForTerminal() throws Exception { WorkspaceProbes wsProbes = probesFactory.getProbes( IDENTITY, MACHINE_NAME, singletonMap( SERVER_TERMINAL_REFERENCE, new ServerImpl().withUrl("wss: verifyHttpProbeConfig( wsProbes, SERVER_TERMINAL_REFERENCE, 3, 1, 10, 10, 120, "/liveness", "localhost", 4040, "https", emptyMap()); }
@Test public void returnsProbesForAMachineForExec() throws Exception { WorkspaceProbes wsProbes = probesFactory.getProbes( IDENTITY, MACHINE_NAME, singletonMap( SERVER_EXEC_AGENT_HTTP_REFERENCE, new ServerImpl().withUrl("https: verifyHttpProbeConfig( wsProbes, SERVER_EXEC_AGENT_HTTP_REFERENCE, 3, 1, 10, 10, 120, "/liveness", "localhost", 4040, "https", emptyMap()); }