Skip to content

Commit 56b6942

Browse files
authored
Merge pull request #540 from maciej-lendzion/master
Version 3.37
2 parents 5c6445f + f90e85d commit 56b6942

9 files changed

+74
-72
lines changed

pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.testdroid</groupId>
44
<artifactId>testdroid-api</artifactId>
5-
<version>3.36.0</version>
5+
<version>3.37.0</version>
66
<packaging>jar</packaging>
77
<name>Bitbar API v2</name>
88
<url>https://github.com/bitbar/testdroid-api</url>
@@ -18,11 +18,11 @@
1818
<jacoco-maven-plugin.skip>true</jacoco-maven-plugin.skip>
1919
<!-- disable default deployment -->
2020
<maven.deploy.skip>true</maven.deploy.skip>
21-
<org.springframework.boot.spring-boot-dependencies>3.3.4</org.springframework.boot.spring-boot-dependencies>
21+
<org.springframework.boot.spring-boot-dependencies>3.3.5</org.springframework.boot.spring-boot-dependencies>
2222
<org.apache.commons.collections4.version>4.4</org.apache.commons.collections4.version>
23-
<org.apache.commons.io.version>2.17.0</org.apache.commons.io.version>
23+
<org.apache.commons.io.version>2.18.0</org.apache.commons.io.version>
2424
<commons-text.version>1.10.0</commons-text.version>
25-
<dependency-check-maven.version>10.0.3</dependency-check-maven.version>
25+
<dependency-check-maven.version>11.1.0</dependency-check-maven.version>
2626
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
2727
<org.reflections.version>0.10.2</org.reflections.version>
2828
</properties>
@@ -71,7 +71,7 @@
7171
<plugin>
7272
<groupId>org.apache.maven.plugins</groupId>
7373
<artifactId>maven-surefire-plugin</artifactId>
74-
<version>3.4.0</version>
74+
<version>3.5.2</version>
7575
<executions>
7676
<execution>
7777
<id>default-test</id>

src/main/java/com/testdroid/api/dto/MappingKey.java

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ private MappingKey() {
4242
public static final String ARCHIVING_ITEM_COUNT = "archivingItemCount";
4343
public static final String ARCHIVING_STRATEGY = "archivingStrategy";
4444
public static final String ASL_ON = "aslOn";
45-
public static final String AUTO_RENEW = "autoRenew";
4645
public static final String AVG_WAITING_TIME = "avgWaitingTime";
4746
public static final String BATTERY_LEVEL = "batteryLevel";
4847
public static final String BILLABLE = "billable";

src/main/java/com/testdroid/api/model/APIAccountService.java

+1-18
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public enum DeactivateReason {
3636

3737
private boolean active;
3838

39-
private boolean autoRenew;
40-
4139
private String braintreeId;
4240

4341
private Date createTime;
@@ -82,7 +80,7 @@ public APIAccountService() {
8280
@SuppressWarnings("squid:S107")
8381
public APIAccountService(
8482
Long accountId, String accountName, Long activatedById, String activatedByName, boolean active,
85-
boolean autoRenew, String braintreeId, LocalDateTime createTime, Long deactivatedById,
83+
String braintreeId, LocalDateTime createTime, Long deactivatedById,
8684
String deactivatedByName, LocalDateTime endTime, boolean finished, Long id, LocalDateTime lastPaymentTime,
8785
APIPaymentMethod paymentMethod, Integer price, Long serviceId, LocalDateTime startTime, Integer vatRate,
8886
Unit unit, Integer unitCount, Integer serviceCount, String serviceName, DeactivateReason deactivateReason,
@@ -93,7 +91,6 @@ public APIAccountService(
9391
this.activatedById = activatedById;
9492
this.activatedByName = activatedByName;
9593
this.active = active;
96-
this.autoRenew = autoRenew;
9794
this.braintreeId = braintreeId;
9895
this.createTime = TimeConverter.toDate(createTime);
9996
this.deactivatedById = deactivatedById;
@@ -230,14 +227,6 @@ public void setPrice(Integer price) {
230227
this.price = price;
231228
}
232229

233-
public boolean isAutoRenew() {
234-
return autoRenew;
235-
}
236-
237-
public void setAutoRenew(boolean autoRenew) {
238-
this.autoRenew = autoRenew;
239-
}
240-
241230
public String getBraintreeId() {
242231
return braintreeId;
243232
}
@@ -318,11 +307,6 @@ public String getSubscriptionManagementURL() {
318307
return subscriptionManagementURL;
319308
}
320309

321-
@JsonIgnore
322-
public Integer getPayUnitCount() {
323-
return autoRenew ? unitCount : unitCount * serviceCount;
324-
}
325-
326310
@JsonIgnore
327311
public String getVatPriceString() {
328312
float vatPrice = (getPrice() * getVatRate()) / 100f;
@@ -349,7 +333,6 @@ public <T extends APIEntity> void clone(T from) {
349333
this.accountName = accountService.accountName;
350334
this.active = accountService.active;
351335
this.finished = accountService.finished;
352-
this.autoRenew = accountService.autoRenew;
353336
this.price = accountService.price;
354337
this.activatedById = accountService.activatedById;
355338
this.activatedByName = accountService.activatedByName;

src/main/java/com/testdroid/api/model/APIAdminDeviceModel.java

+33-22
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class APIAdminDeviceModel extends APIEntity {
2222

2323
private Boolean enabled;
2424

25+
private Integer creditsPrice;
26+
2527
private APIDevice.OsType osType;
2628

2729
private APIDevice.Platform platform;
@@ -33,14 +35,13 @@ public class APIAdminDeviceModel extends APIEntity {
3335
private String releaseVersion;
3436

3537
public APIAdminDeviceModel() {
36-
3738
}
3839

3940
@SuppressWarnings("squid:S107")
4041
public APIAdminDeviceModel(
4142
Long id, String name, APIDevice.OsType osType, APIDevice.Platform platform, String location,
42-
Boolean dedicated, String releaseVersion, Boolean enabled, Integer online, Integer total, Long running,
43-
Long queueSize, Double avgWaitingTime) {
43+
Boolean dedicated, String releaseVersion, Boolean enabled, Integer creditsPrice, Integer online,
44+
Integer total, Long running, Long queueSize, Double avgWaitingTime) {
4445
super(id);
4546
this.name = name;
4647
this.osType = osType;
@@ -49,32 +50,14 @@ public APIAdminDeviceModel(
4950
this.dedicated = dedicated;
5051
this.releaseVersion = releaseVersion;
5152
this.enabled = enabled;
53+
this.creditsPrice = creditsPrice;
5254
this.online = online;
5355
this.total = total;
5456
this.running = running;
5557
this.queueSize = queueSize;
5658
this.avgWaitingTime = avgWaitingTime != null ? avgWaitingTime.longValue() : 0;
5759
}
5860

59-
@Override
60-
@JsonIgnore
61-
protected <T extends APIEntity> void clone(T from) {
62-
APIAdminDeviceModel model = (APIAdminDeviceModel) from;
63-
cloneBase(from);
64-
this.name = model.name;
65-
this.osType = model.osType;
66-
this.platform = model.platform;
67-
this.location = model.location;
68-
this.dedicated = model.dedicated;
69-
this.releaseVersion = model.releaseVersion;
70-
this.enabled = model.enabled;
71-
this.online = model.online;
72-
this.total = model.total;
73-
this.running = model.running;
74-
this.queueSize = model.queueSize;
75-
this.avgWaitingTime = model.avgWaitingTime;
76-
}
77-
7861
public String getName() {
7962
return name;
8063
}
@@ -170,4 +153,32 @@ public String getReleaseVersion() {
170153
public void setReleaseVersion(String releaseVersion) {
171154
this.releaseVersion = releaseVersion;
172155
}
156+
157+
public Integer getCreditsPrice() {
158+
return creditsPrice;
159+
}
160+
161+
public void setCreditsPrice(Integer creditsPrice) {
162+
this.creditsPrice = creditsPrice;
163+
}
164+
165+
@Override
166+
@JsonIgnore
167+
protected <T extends APIEntity> void clone(T from) {
168+
APIAdminDeviceModel model = (APIAdminDeviceModel) from;
169+
cloneBase(from);
170+
this.name = model.name;
171+
this.osType = model.osType;
172+
this.platform = model.platform;
173+
this.location = model.location;
174+
this.dedicated = model.dedicated;
175+
this.releaseVersion = model.releaseVersion;
176+
this.enabled = model.enabled;
177+
this.creditsPrice = model.creditsPrice;
178+
this.online = model.online;
179+
this.total = model.total;
180+
this.running = model.running;
181+
this.queueSize = model.queueSize;
182+
this.avgWaitingTime = model.avgWaitingTime;
183+
}
173184
}

src/main/java/com/testdroid/api/model/APIAdminDeviceProblem.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,24 @@ public class APIAdminDeviceProblem extends APIEntity {
2222

2323
private String deviceName;
2424

25+
private String location;
26+
2527
private List<APIAdminDeviceProblemPair> problems;
2628

2729
public APIAdminDeviceProblem() {
2830
}
2931

32+
@SuppressWarnings("squid:S107")
3033
public APIAdminDeviceProblem(
3134
Long clusterId, String clusterName, Long deviceId, String deviceName, Long deviceModelId,
32-
String deviceModelName, List<APIAdminDeviceProblemPair> problems) {
35+
String deviceModelName, String location, List<APIAdminDeviceProblemPair> problems) {
3336
this.clusterId = clusterId;
3437
this.clusterName = clusterName;
3538
this.deviceId = deviceId;
3639
this.deviceName = deviceName;
3740
this.deviceModelId = deviceModelId;
3841
this.deviceModelName = deviceModelName;
42+
this.location = location;
3943
this.problems = problems;
4044
}
4145

@@ -87,6 +91,14 @@ public void setDeviceModelName(String deviceModelName) {
8791
this.deviceModelName = deviceModelName;
8892
}
8993

94+
public String getLocation() {
95+
return location;
96+
}
97+
98+
public void setLocation(String location) {
99+
this.location = location;
100+
}
101+
90102
public List<APIAdminDeviceProblemPair> getProblems() {
91103
return problems;
92104
}
@@ -106,6 +118,7 @@ protected <T extends APIEntity> void clone(T from) {
106118
this.deviceName = apiAdminDeviceProblem.deviceName;
107119
this.deviceModelId = apiAdminDeviceProblem.deviceModelId;
108120
this.deviceModelName = apiAdminDeviceProblem.deviceModelName;
121+
this.location = apiAdminDeviceProblem.location;
109122
this.problems = apiAdminDeviceProblem.problems;
110123
}
111124
}

src/main/java/com/testdroid/api/model/APIDevice.java

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import com.fasterxml.jackson.annotation.JsonIgnore;
44
import com.testdroid.api.APIEntity;
55
import com.testdroid.api.APIList;
6-
import org.apache.commons.lang3.StringUtils;
7-
86
import jakarta.xml.bind.annotation.XmlType;
7+
import org.apache.commons.lang3.StringUtils;
98

109
import java.util.*;
1110

@@ -27,7 +26,6 @@ public enum DeviceGroupOrigin {
2726

2827
public enum Creator {
2928
MANUAL,
30-
ROBOT,
3129
AUTOMATIC
3230
}
3331

@@ -160,7 +158,9 @@ public List<OsType> getFamily() {
160158

161159
private APIDeviceAvailability availability;
162160

163-
// Technical fields to calculate others
161+
@JsonIgnore
162+
private String location;
163+
164164
@JsonIgnore
165165
private Integer onlineDevices;
166166

@@ -178,7 +178,7 @@ public APIDevice(
178178
Long id, String displayName, String manufacturer, String releaseVersion, Integer apiLevel,
179179
Integer creditsPrice, String imagePrefix, Integer imageTop, Integer imageLeft, Integer imageWidth,
180180
Integer imageHeight, Integer frameExtraWidth, OsType osType, Platform platform, Boolean online,
181-
Boolean locked, Boolean enabled, Long accountId, String accountName, Integer onlineDevices,
181+
Boolean locked, Boolean enabled, String location, Long accountId, String accountName, Integer onlineDevices,
182182
Integer availableDevices) {
183183
super(id);
184184
this.displayName = displayName;
@@ -196,6 +196,7 @@ public APIDevice(
196196
this.locked = locked;
197197
this.online = online;
198198
this.enabled = enabled;
199+
this.location = location;
199200
this.accountId = accountId;
200201
this.accountName = accountName;
201202
this.onlineDevices = onlineDevices;
@@ -421,12 +422,18 @@ public void setAvailability(APIDeviceAvailability availability) {
421422
this.availability = availability;
422423
}
423424

424-
@JsonIgnore
425+
public String getLocation() {
426+
return location;
427+
}
428+
429+
public void setLocation(String location) {
430+
this.location = location;
431+
}
432+
425433
public Integer getOnlineDevices() {
426434
return onlineDevices;
427435
}
428436

429-
@JsonIgnore
430437
public Integer getAvailableDevices() {
431438
return availableDevices;
432439
}
@@ -474,5 +481,6 @@ protected <T extends APIEntity> void clone(T from) {
474481
this.availability = apiDevice.availability;
475482
this.onlineDevices = apiDevice.onlineDevices;
476483
this.availableDevices = apiDevice.availableDevices;
484+
this.location = apiDevice.location;
477485
}
478486
}

src/main/java/com/testdroid/api/model/APIDeviceSession.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public APIDeviceSession(
188188
String releaseVersion, Integer apiLevel, ExcludeReason excludeReason, Long deviceInstanceId,
189189
RetryState retryState, Integer autoRetriesLeftCount, Long deviceTime, Long duration, Long projectId,
190190
String projectName, Long testRunId, String testRunName, Float successRatio, String name,
191-
APIDeviceSessionConfig config, Boolean biometricInstrumentation) {
191+
APIDeviceSessionConfig config, Boolean biometricInstrumentation, String location) {
192192
super(id);
193193
this.externalId = externalId;
194194
this.clientSideId = clientSideId;
@@ -202,7 +202,7 @@ public APIDeviceSession(
202202
this.endTime = TimeConverter.toDate(endTime);
203203
this.device = new APIDevice(deviceModelId, displayName, deviceManufacturer, releaseVersion,
204204
apiLevel, creditsPrice, imagePrefix, imageTop, imageLeft, imageWidth, imageHeight, frameExtraWidth,
205-
osType, platform, null, locked, enabled, null, null, null, null);
205+
osType, platform, null, locked, enabled, location, null, null, null, null);
206206
this.timeLimit = timeLimit;
207207
this.deviceLogFirstTimestamp = deviceLogFirstTimestamp;
208208
this.state = state;

src/main/java/com/testdroid/api/model/APIDeviceUsage.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ public APIDeviceUsage(
2222
Long id, String displayName, String manufacturer, String releaseVersion,
2323
Integer apiLevel, Integer creditsPrice, String imagePrefix, Integer imageTop, Integer imageLeft,
2424
Integer imageWidth, Integer imageHeight, Integer frameExtraWidth, APIDevice.OsType osType,
25-
APIDevice.Platform platform, Boolean online, Boolean locked, Boolean enabled, Long totalDeviceSessions,
26-
Long failedDeviceSessions) {
25+
APIDevice.Platform platform, Boolean online, Boolean locked, Boolean enabled, String location,
26+
Long totalDeviceSessions, Long failedDeviceSessions) {
2727
super(id);
2828
this.device = new APIDevice(id, displayName, manufacturer, releaseVersion, apiLevel,
2929
creditsPrice, imagePrefix, imageTop, imageLeft, imageWidth, imageHeight, frameExtraWidth, osType,
30-
platform, online, locked, enabled, null, null, null, null);
30+
platform, online, locked, enabled, location, null, null, null, null);
3131
this.totalDeviceSessions = totalDeviceSessions;
3232
this.failedDeviceSessions = failedDeviceSessions;
3333
}

src/main/java/com/testdroid/api/model/APIService.java

+1-13
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
public class APIService extends APIEntity {
1717

18-
private boolean autoRenew;
19-
2018
private String externalId;
2119

2220
private String commonId;
@@ -60,13 +58,12 @@ public APIService() {
6058

6159
@SuppressWarnings("squid:S107")
6260
public APIService(
63-
Long id, String name, String description, boolean autoRenew, Integer centPrice, Integer includedHours,
61+
Long id, String name, String description, Integer centPrice, Integer includedHours,
6462
Integer pricePerHour, String externalId, String commonId, LocalDateTime archiveTime, LocalDateTime activateTime,
6563
boolean activated, boolean customPlan, ChargeType chargeType, Unit unit, String features) {
6664
super(id);
6765
this.name = name;
6866
this.description = description;
69-
this.autoRenew = autoRenew;
7067
this.centPrice = centPrice;
7168
this.includedHours = includedHours;
7269
this.pricePerHour = pricePerHour;
@@ -81,14 +78,6 @@ public APIService(
8178
this.features = features;
8279
}
8380

84-
public boolean isAutoRenew() {
85-
return autoRenew;
86-
}
87-
88-
public void setAutoRenew(boolean autoRenew) {
89-
this.autoRenew = autoRenew;
90-
}
91-
9281
public Integer getCentPrice() {
9382
return centPrice;
9483
}
@@ -104,7 +93,6 @@ protected <T extends APIEntity> void clone(T from) {
10493
this.name = apiService.name;
10594
this.description = apiService.description;
10695
this.features = apiService.features;
107-
this.autoRenew = apiService.autoRenew;
10896
this.centPrice = apiService.centPrice;
10997
this.externalId = apiService.externalId;
11098
this.commonId = apiService.commonId;

0 commit comments

Comments
 (0)