|
| 1 | +/* |
| 2 | + * Copyright 2022 ABSA Group Limited |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +package za.co.absa.pramen.extras |
| 18 | + |
| 19 | +import za.co.absa.pramen.api.SchemaDifference |
| 20 | +import za.co.absa.pramen.api.status._ |
| 21 | + |
| 22 | +import java.time.{Instant, LocalDate} |
| 23 | + |
| 24 | +object TaskNotificationFactory { |
| 25 | + def getDummyTaskNotification(taskDef: TaskDef = TaskDefFactory.getDummyTaskNotification(), |
| 26 | + runInfo: Option[RunInfo] = Some(RunInfo( |
| 27 | + LocalDate.of(2022, 2, 18), |
| 28 | + Instant.ofEpochMilli(1613600000000L), |
| 29 | + Instant.ofEpochMilli(1672759508000L) |
| 30 | + )), |
| 31 | + status: RunStatus = RunStatus.Succeeded(None, Some(100), None, None, TaskRunReason.New, Seq.empty, Seq.empty, Seq.empty, Seq.empty), |
| 32 | + applicationId: String = "app_12345", |
| 33 | + isTransient: Boolean = false, |
| 34 | + isRawFilesJob: Boolean = false, |
| 35 | + schemaChanges: Seq[SchemaDifference] = Seq.empty, |
| 36 | + dependencyWarnings: Seq[DependencyWarning] = Seq.empty, |
| 37 | + notificationTargetErrors: Seq[NotificationFailure] = Seq.empty, |
| 38 | + options: Map[String, String] = Map.empty[String, String]): TaskResult = { |
| 39 | + TaskResult(taskDef, |
| 40 | + status, |
| 41 | + runInfo, |
| 42 | + applicationId, |
| 43 | + isTransient, |
| 44 | + isRawFilesJob, |
| 45 | + schemaChanges, |
| 46 | + dependencyWarnings, |
| 47 | + notificationTargetErrors, |
| 48 | + options) |
| 49 | + } |
| 50 | +} |
0 commit comments