-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package unit.java.sdk; | ||
|
||
import org.junit.Test; | ||
import unit.java.sdk.api.GetEventApi; | ||
import unit.java.sdk.api.GetListEventsApi; | ||
import unit.java.sdk.model.UnitEventListResponse; | ||
import unit.java.sdk.model.UnitEventResponse1; | ||
|
||
|
||
import static unit.java.sdk.TestHelpers.getApiClient; | ||
|
||
public class EventTests { | ||
@Test | ||
public void GetListEvents() throws ApiException { | ||
GetListEventsApi api = new GetListEventsApi(getApiClient()); | ||
|
||
UnitEventListResponse response = api.execute(null, null); | ||
assert response.getData().size() > 0; | ||
|
||
GetEventApi getEventApi = new GetEventApi(getApiClient()); | ||
|
||
response.getData().forEach(x -> { | ||
try { | ||
UnitEventResponse1 event = getEventApi.execute(x.getId()); | ||
assert event.getData().getId().equals(x.getId()); | ||
} catch (ApiException e) { | ||
throw new RuntimeException(e); | ||
} | ||
}); | ||
} | ||
} |