Skip to content

Commit

Permalink
Merge pull request #364 from szprutamich/master
Browse files Browse the repository at this point in the history
Version 2.79
  • Loading branch information
szprutamich authored Aug 6, 2019
2 parents 0124c06 + 3b94a8f commit 85832ba
Show file tree
Hide file tree
Showing 18 changed files with 299 additions and 320 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>2.78</version>
<version>2.79</version>
<packaging>jar</packaging>
<name>Bitbar API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
<description>Bitbar Cloud API Client for Java</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<jackson.version>2.9.8</jackson.version>
<jackson.version>2.9.9</jackson.version>
<slf4j.version>1.7.26</slf4j.version>
<junit.jupiter.version>5.4.2</junit.jupiter.version>
<org.apache.commons.io.version>2.6</org.apache.commons.io.version>
<org.apache.commons.lang3.version>3.9</org.apache.commons.lang3.version>
<org.apache.httpcomponents.httpclient.version>4.5.6</org.apache.httpcomponents.httpclient.version>
<org.apache.commons.collections4.version>4.3</org.apache.commons.collections4.version>
<com.google.http-client>1.25.0</com.google.http-client>
<hamcrest.version>2.1</hamcrest.version>
</properties>
Expand Down Expand Up @@ -110,6 +111,11 @@
<artifactId>httpclient</artifactId>
<version>${org.apache.httpcomponents.httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${org.apache.commons.collections4.version}</version>
</dependency>
<dependency>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client</artifactId>
Expand Down
42 changes: 0 additions & 42 deletions src/main/java/com/testdroid/api/APIArray.java

This file was deleted.

4 changes: 1 addition & 3 deletions src/main/java/com/testdroid/api/APIEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
APIAdminInteractiveDeviceSession.class,
APIAdminOverview.class,
APIAdminTestRun.class,
APIArray.class,
APIBasicDeviceTime.class,
APIBasicJiraProject.class,
APIBillingPeriod.class,
Expand Down Expand Up @@ -76,8 +75,8 @@
APIEnum.class,
APIExceptionMessage.class,
APIFileConfig.class,
APIFileSet.class,
APIFramework.class,
APIHealthCheck.class,
APIJiraIssue.class,
APIJiraIssueType.class,
APIJiraPriority.class,
Expand Down Expand Up @@ -105,7 +104,6 @@
APITestRun.class,
APITestRunConfig.class,
APITestRunDataAvailability.class,
APITestRunExtended.class,
APITestRunParameter.class,
APIUser.class,
APIUserDeviceTime.class,
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/com/testdroid/api/AbstractAPIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.io.InputStream;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -324,8 +325,10 @@ protected <T extends APIEntity> String buildUrl(String url, Context<T> context)
try {
URIBuilder builder = new URIBuilder(url);
if (context != null) {
for (Map.Entry<String, Object> entry : context.build().entrySet()) {
builder.addParameter(entry.getKey(), entry.getValue() == null ? "" : entry.getValue().toString());
for (Map.Entry<String, Collection<Object>> entry : context.build().asMap().entrySet()) {
for (Object value : entry.getValue()) {
builder.addParameter(entry.getKey(), value == null ? "" : value.toString());
}
}
}
return builder.build().toString();
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/com/testdroid/api/dto/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
import com.testdroid.api.APIEntity;
import com.testdroid.api.APISort;
import com.testdroid.api.filter.FilterEntry;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;

import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

/**
Expand Down Expand Up @@ -46,7 +50,7 @@ public class Context<T extends APIEntity> {

private Boolean cacheable = Boolean.FALSE;

private Map<String, Object> extraParams = new HashMap<>();
private MultiValuedMap<String, Object> extraParams = new HashSetValuedHashMap<>();

public Context(Class<T> type) {
this.type = type;
Expand Down Expand Up @@ -143,16 +147,16 @@ public Context<T> setCacheable(Boolean cacheable) {
return this;
}

public Map<String, Object> getExtraParams() {
public MultiValuedMap<String, Object> getExtraParams() {
return extraParams;
}

public void setExtraParams(Map<String, Object> extraParams) {
public void setExtraParams(MultiValuedMap<String, Object> extraParams) {
this.extraParams = extraParams;
}

public Map<String, Object> build() {
Map<String, Object> map = new HashMap<>();
public MultiValuedMap<String, Object> build() {
MultiValuedMap<String, Object> map = new HashSetValuedHashMap<>();
map.put(LIMIT_REQUEST_PARAM, limit);
map.put(OFFSET_REQUEST_PARAM, offset);
map.put(SEARCH_REQUEST_PARAM, search);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/testdroid/api/dto/MappingKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ public class MappingKey {
public static final String MONITORING_ON = "monitoringOn";
public static final String NAME = "name";
public static final String NEW_PASSWORD = "newPassword";
public static final String MFA_ENABLED = "mfaEnabled";
public static final String MFA_CODE = "mfaCode";
public static final String NOTIFICATION_CHANNEL = "channel";
public static final String NOTIFICATION_CONTENT = "notificationContent";
public static final String NOTIFICATION_DESTINATION = "destination";
Expand Down
31 changes: 21 additions & 10 deletions src/main/java/com/testdroid/api/model/APIActiveUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public class APIActiveUser extends APIEntity {

private String organization;

private Integer priority;
private Integer priorityDesktop;

private Integer priorityMobile;

private String timeZone;

Expand Down Expand Up @@ -70,14 +72,6 @@ public void setOrganization(String organization) {
this.organization = organization;
}

public Integer getPriority() {
return priority;
}

public void setPriority(Integer priority) {
this.priority = priority;
}

public String getTimeZone() {
return timeZone;
}
Expand All @@ -86,6 +80,22 @@ public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}

public Integer getPriorityDesktop() {
return priorityDesktop;
}

public void setPriorityDesktop(Integer priorityDesktop) {
this.priorityDesktop = priorityDesktop;
}

public Integer getPriorityMobile() {
return priorityMobile;
}

public void setPriorityMobile(Integer priorityMobile) {
this.priorityMobile = priorityMobile;
}

@Override
protected <T extends APIEntity> void clone(T from) {
APIActiveUser apiActiveUser = (APIActiveUser) from;
Expand All @@ -95,6 +105,7 @@ protected <T extends APIEntity> void clone(T from) {
this.organization = apiActiveUser.organization;
this.timeZone = apiActiveUser.timeZone;
this.loginTime = apiActiveUser.loginTime;
this.priority = apiActiveUser.priority;
this.priorityDesktop = apiActiveUser.priorityDesktop;
this.priorityMobile = apiActiveUser.priorityMobile;
}
}
116 changes: 0 additions & 116 deletions src/main/java/com/testdroid/api/model/APIFileSet.java

This file was deleted.

Loading

0 comments on commit 85832ba

Please sign in to comment.