Skip to content

Commit

Permalink
EventTests
Browse files Browse the repository at this point in the history
  • Loading branch information
axshani committed Feb 12, 2024
1 parent 61ea733 commit eea296d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/test/java/unit/java/sdk/EventTests.java
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);
}
});
}
}

0 comments on commit eea296d

Please sign in to comment.