@Test @SneakyThrows public void assertFindJobStatusTraceEvents() { when(resultSet.getString(2)).thenReturn("TestJobName"); when(resultSet.getString(6)).thenReturn("LITE_EXECUTOR"); when(resultSet.getString(9)).thenReturn("TASK_RUNNING"); when(resultSet.getTimestamp(11)).thenReturn(new Timestamp(System.currentTimeMillis())); Map<String, Object> fields = new HashMap<>(); fields.put("job_name", "TestJobName"); condition = new JobEventRdbSearch.Condition(0, 0, "job_name", "DESC", new Date(), new Date(), fields); JobEventRdbSearch.Result<JobStatusTraceEvent> jobStatusTraceEvents = jobEventRdbSearch.findJobStatusTraceEvents(condition); assertThat(jobStatusTraceEvents.getTotal(), is(1)); assertThat(jobStatusTraceEvents.getRows().size(), is(1)); assertThat(jobStatusTraceEvents.getRows().get(0).getJobName(), is("TestJobName")); assertThat(jobStatusTraceEvents.getRows().get(0).getSource(), is(JobStatusTraceEvent.Source.LITE_EXECUTOR)); assertThat(jobStatusTraceEvents.getRows().get(0).getState(), is(JobStatusTraceEvent.State.TASK_RUNNING)); }
public Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); }
JobEventRdbSearch { public Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); } }
JobEventRdbSearch { public Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); }  }
JobEventRdbSearch { public Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); }  Result<JobExecutionEvent> findJobExecutionEvents(final Condition condition); Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition); }
JobEventRdbSearch { public Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); }  Result<JobExecutionEvent> findJobExecutionEvents(final Condition condition); Result<JobStatusTraceEvent> findJobStatusTraceEvents(final Condition condition);  }