-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #738 from atlanhq/DVX-526
Adds find by ID for workflows
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
integration-tests/src/test/java/com/atlan/java/sdk/WorkflowTest.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,62 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 | ||
Copyright 2022 Atlan Pte. Ltd. */ | ||
package com.atlan.java.sdk; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
import com.atlan.exception.AtlanException; | ||
import com.atlan.model.enums.AtlanPackageType; | ||
import com.atlan.model.workflow.WorkflowSearchRequest; | ||
import com.atlan.model.workflow.WorkflowSearchResult; | ||
import com.atlan.model.workflow.WorkflowSearchResultDetail; | ||
import java.util.*; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* Tests most aspects of workflows (packages). | ||
*/ | ||
@Slf4j | ||
public class WorkflowTest extends AtlanLiveTest { | ||
|
||
private static String workflowName; | ||
private static String workflowRun; | ||
private static WorkflowSearchResultDetail wfl; | ||
private static WorkflowSearchResult run; | ||
|
||
@Test(groups = {"pkg.search.type"}) | ||
void findByType() throws AtlanException { | ||
List<WorkflowSearchResult> results = WorkflowSearchRequest.findByType(AtlanPackageType.SNOWFLAKE, 5); | ||
assertNotNull(results); | ||
assertFalse(results.isEmpty()); | ||
wfl = results.get(0).get_source(); | ||
workflowName = results.get(0).get_id(); | ||
} | ||
|
||
@Test( | ||
groups = {"pkg.search.latest"}, | ||
dependsOnGroups = {"pkg.search.type"}) | ||
void findLatestRun() throws AtlanException { | ||
run = WorkflowSearchRequest.findLatestRun(workflowName); | ||
assertNotNull(run); | ||
workflowRun = run.get_id(); | ||
} | ||
|
||
@Test( | ||
groups = {"pkg.search.run"}, | ||
dependsOnGroups = {"pkg.search.latest"}) | ||
void findRunByName() throws AtlanException { | ||
WorkflowSearchResult result = WorkflowSearchRequest.findRunByName(workflowRun); | ||
assertNotNull(result); | ||
assertEquals(result, run); | ||
} | ||
|
||
@Test( | ||
groups = {"pkg.search.id"}, | ||
dependsOnGroups = {"pkg.search.run"}) | ||
void findById() throws AtlanException { | ||
WorkflowSearchResult result = WorkflowSearchRequest.findById(workflowName); | ||
assertNotNull(result); | ||
assertEquals(result.get_source(), wfl); | ||
} | ||
} |
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