-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing IngestJob from InMemoryIngestJobStatusStoreTest
- Loading branch information
1 parent
ad316f8
commit d2ad98b
Showing
4 changed files
with
273 additions
and
131 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
java/core/src/test/java/sleeper/core/record/process/ProcessRunTestData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright 2022-2024 Crown Copyright | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package sleeper.core.record.process; | ||
|
||
import sleeper.core.record.process.status.ProcessRun; | ||
import sleeper.core.record.process.status.ProcessRunFinishedUpdate; | ||
import sleeper.core.record.process.status.ProcessRunStartedUpdate; | ||
|
||
/** | ||
* A helper for creating runs for tests. | ||
*/ | ||
public class ProcessRunTestData { | ||
|
||
private ProcessRunTestData() { | ||
} | ||
|
||
/** | ||
* Creates a run with a started status. | ||
* | ||
* @param taskId the task ID to set | ||
* @param startedStatus the started status to set | ||
* @return the run | ||
*/ | ||
public static ProcessRun startedRun(String taskId, ProcessRunStartedUpdate startedStatus) { | ||
return ProcessRun.builder() | ||
.taskId(taskId) | ||
.startedStatus(startedStatus) | ||
.build(); | ||
} | ||
|
||
/** | ||
* Creates a run with a started status and a finished status. | ||
* | ||
* @param taskId the task ID to set | ||
* @param startedStatus the started status to set | ||
* @param finishedStatus the finished status to set | ||
* @return the run | ||
*/ | ||
public static ProcessRun finishedRun(String taskId, ProcessRunStartedUpdate startedStatus, ProcessRunFinishedUpdate finishedStatus) { | ||
return ProcessRun.builder() | ||
.taskId(taskId) | ||
.startedStatus(startedStatus) | ||
.finishedStatus(finishedStatus) | ||
.build(); | ||
} | ||
|
||
/** | ||
* Creates a run with a started status that occurred on no task. | ||
* | ||
* @param validationStatus the started status to set | ||
* @return the run | ||
*/ | ||
public static ProcessRun validationRun(ProcessRunStartedUpdate validationStatus) { | ||
return ProcessRun.builder() | ||
.startedStatus(validationStatus) | ||
.build(); | ||
} | ||
|
||
} |
Oops, something went wrong.