mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-14 00:11:23 +00:00
Additional tests for list accounts with a few parameters combinations
Signed-off-by: PauloMigAlmeida <paulo.miguel.almeida.rodenas@gmail.com>
This commit is contained in:
committed by
Liam Newman
parent
41b698f0a8
commit
754e66f4dd
@@ -5,7 +5,9 @@ import org.junit.Test;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.kohsuke.github.GHMarketplaceAccountType.*;
|
||||
import static org.kohsuke.github.GHDirection.DESC;
|
||||
import static org.kohsuke.github.GHMarketplaceAccountType.ORGANIZATION;
|
||||
import static org.kohsuke.github.GHMarketplaceListAccountBuilder.Sort.UPDATED;
|
||||
|
||||
/**
|
||||
* Tests for the GitHub MarketPlace Plan API methods
|
||||
@@ -37,6 +39,36 @@ public class GHMarketplacePlanTest extends AbstractGitHubWireMockTest {
|
||||
marketplaceUsers.forEach(this::testMarketplaceAccount);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listAccountsWithDirection() throws IOException {
|
||||
List<GHMarketplacePlan> plans = gitHub.listMarketplacePlans().asList();
|
||||
assertEquals(3, plans.size());
|
||||
|
||||
for (GHMarketplacePlan plan : plans) {
|
||||
List<GHMarketplaceAccount> marketplaceUsers = plan.listAccounts().direction(DESC).retrieve().asList();
|
||||
assertEquals(2, marketplaceUsers.size());
|
||||
marketplaceUsers.forEach(this::testMarketplaceAccount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void listAccountsWithSortAndDirection() throws IOException {
|
||||
List<GHMarketplacePlan> plans = gitHub.listMarketplacePlans().asList();
|
||||
assertEquals(3, plans.size());
|
||||
|
||||
for (GHMarketplacePlan plan : plans) {
|
||||
List<GHMarketplaceAccount> marketplaceUsers = plan.listAccounts()
|
||||
.sort(UPDATED)
|
||||
.direction(DESC)
|
||||
.retrieve()
|
||||
.asList();
|
||||
assertEquals(2, marketplaceUsers.size());
|
||||
marketplaceUsers.forEach(this::testMarketplaceAccount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void testMarketplacePlan(GHMarketplacePlan plan) {
|
||||
// Non-nullable fields
|
||||
assertNotNull(plan.getUrl());
|
||||
|
||||
Reference in New Issue
Block a user