@Test public void testBuildRuntimeStatus() { assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus(null)); assertEquals(RuntimeStatus.RUNNING, RuntimePresenterHelper.buildRuntimeStatus("RUNNING")); assertEquals(RuntimeStatus.STOPPED, RuntimePresenterHelper.buildRuntimeStatus("STOPPED")); assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus("UNKNOWN")); assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus("whatever value")); }
public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } }
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } } }
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } }  }
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } }  static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus); }
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } }  static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus);  }