-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added call that copies a chart from a workspace to another workspace (#…
…147)
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
29 changes: 29 additions & 0 deletions
29
src/test/java/seatsio/charts/CopyChartFromWorkspaceToTest.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,29 @@ | ||
package seatsio.charts; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seatsio.SeatsioClient; | ||
import seatsio.SeatsioClientTest; | ||
import seatsio.workspaces.Workspace; | ||
|
||
import java.util.Map; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class CopyChartFromWorkspaceToTest extends SeatsioClientTest { | ||
|
||
@Test | ||
public void test() { | ||
Chart chart = client.charts.create("my chart", "BOOTHS"); | ||
Workspace toWorkspace = client.workspaces.create("my ws"); | ||
|
||
Chart copiedChart = client.charts.copyToWorkspace(chart.key, workspace.key, toWorkspace.key); | ||
|
||
SeatsioClient workspaceClient = new SeatsioClient(toWorkspace.secretKey, null, apiUrl()); | ||
assertThat(copiedChart.name).isEqualTo("my chart"); | ||
Chart retrievedChart = workspaceClient.charts.retrieve(copiedChart.key); | ||
assertThat(retrievedChart.name).isEqualTo("my chart"); | ||
Map<?, ?> drawing = workspaceClient.charts.retrievePublishedVersion(copiedChart.key); | ||
assertThat(drawing.get("venueType")).isEqualTo("BOOTHS"); | ||
} | ||
|
||
} |