-
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.
add methods to put up objects for resale (#202)
* add methods to put up objects for resale * use new RELEASE statusChangeCommand type instead of hardcoded FREE status, when releasing objects (#199) * instead of passing in FREE as a status, we now use RELEASE as statusChangeCommand type. * refactoring - rename * refactoring - rename * version bump * fixed build --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
814ea35
commit 3049773
Showing
3 changed files
with
50 additions
and
2 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
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
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,40 @@ | ||
package seatsio.events; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seatsio.SeatsioClientTest; | ||
|
||
import java.util.List; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static seatsio.events.EventObjectInfo.RESALE; | ||
|
||
public class PutUpForResaleTest extends SeatsioClientTest { | ||
|
||
@Test | ||
public void putUpForResaleForSingleEvent() { | ||
String chartKey = createTestChart(); | ||
Event event = client.events.create(chartKey); | ||
|
||
ChangeObjectStatusResult result = client.events.putUpForResale(event.key, List.of("A-1", "A-2")); | ||
|
||
assertThat(client.events.retrieveObjectInfo(event.key, "A-1").status).isEqualTo(RESALE); | ||
assertThat(client.events.retrieveObjectInfo(event.key, "A-2").status).isEqualTo(RESALE); | ||
assertThat(result.objects).containsOnlyKeys("A-1", "A-2"); | ||
} | ||
|
||
@Test | ||
public void putUpForResaleForEventGroup() { | ||
String chartKey = createTestChart(); | ||
Event event1 = client.events.create(chartKey); | ||
Event event2 = client.events.create(chartKey); | ||
|
||
ChangeObjectStatusResult result = client.events.putUpForResale(List.of(event1.key, event2.key), List.of("A-1", "A-2")); | ||
|
||
assertThat(client.events.retrieveObjectInfo(event1.key, "A-1").status).isEqualTo(RESALE); | ||
assertThat(client.events.retrieveObjectInfo(event1.key, "A-2").status).isEqualTo(RESALE); | ||
assertThat(client.events.retrieveObjectInfo(event2.key, "A-1").status).isEqualTo(RESALE); | ||
assertThat(client.events.retrieveObjectInfo(event2.key, "A-2").status).isEqualTo(RESALE); | ||
assertThat(result.objects).containsOnlyKeys("A-1", "A-2"); | ||
} | ||
|
||
} |