-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from szprutamich/master
Release 2.83
- Loading branch information
Showing
19 changed files
with
231 additions
and
238 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
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 |
---|---|---|
|
@@ -18,9 +18,6 @@ | |
import javax.xml.bind.annotation.XmlSeeAlso; | ||
import java.io.File; | ||
import java.io.InputStream; | ||
import java.text.DateFormat; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
/** | ||
* @author Łukasz Kajda <[email protected]> | ||
|
@@ -49,6 +46,7 @@ | |
APIBasicDeviceTime.class, | ||
APIBasicJiraProject.class, | ||
APIBillingPeriod.class, | ||
APIBillingPeriodUsage.class, | ||
APIBuildConfig.class, | ||
APIBuildExecutor.class, | ||
APIBuildResultConfig.class, | ||
|
@@ -115,8 +113,6 @@ | |
}) | ||
public abstract class APIEntity { | ||
|
||
private static final DateFormat API_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH:mm"); | ||
|
||
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
|
||
static { | ||
|
@@ -137,12 +133,6 @@ public APIEntity(Long id) { | |
this.id = id; | ||
} | ||
|
||
@Deprecated | ||
@JsonIgnore | ||
public static String format(Date date) { | ||
return API_DATE_FORMAT.format(date); | ||
} | ||
|
||
@JsonIgnore | ||
protected static String createUri(String preUri, String postUri) { | ||
if (preUri.contains("?")) { | ||
|
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 |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
|
||
import java.security.GeneralSecurityException; | ||
|
||
import static org.apache.commons.lang3.StringUtils.EMPTY; | ||
|
||
/** | ||
* @author Michał Szpruta <[email protected]> | ||
*/ | ||
|
@@ -91,6 +93,6 @@ private void initializeDefaultAPIClient(String cloudURL, String apiKey) { | |
|
||
@Override | ||
protected HttpHeaders getHttpHeaders() { | ||
return new HttpHeaders().setAccept(ACCEPT_HEADER).setBasicAuthentication(apiKey, ""); | ||
return new HttpHeaders().setAccept(ACCEPT_HEADER).setBasicAuthentication(apiKey, EMPTY); | ||
} | ||
} |
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
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
26 changes: 0 additions & 26 deletions
26
src/main/java/com/testdroid/api/filter/DateFilterEntry.java
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import javax.xml.bind.annotation.XmlRootElement; | ||
import java.time.LocalDateTime; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Damian Sniezek <[email protected]> | ||
|
@@ -48,6 +49,8 @@ public class APIBillingPeriod extends APIEntity { | |
|
||
private APIBillingPeriodType apiBillingPeriodType; | ||
|
||
private List<APIBillingPeriodUsage> usages; | ||
|
||
public APIBillingPeriod() { | ||
} | ||
|
||
|
@@ -228,6 +231,14 @@ public void setAccountServiceId(Long accountServiceId) { | |
this.accountServiceId = accountServiceId; | ||
} | ||
|
||
public List<APIBillingPeriodUsage> getUsages() { | ||
return usages; | ||
} | ||
|
||
public void setUsages(List<APIBillingPeriodUsage> usages) { | ||
this.usages = usages; | ||
} | ||
|
||
@Override | ||
protected <T extends APIEntity> void clone(T from) { | ||
APIBillingPeriod period = (APIBillingPeriod) from; | ||
|
@@ -247,5 +258,6 @@ protected <T extends APIEntity> void clone(T from) { | |
this.createTime = period.createTime; | ||
this.apiBillingPeriodType = period.apiBillingPeriodType; | ||
this.accountServiceId = period.accountServiceId; | ||
this.usages = period.usages; | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
src/main/java/com/testdroid/api/model/APIBillingPeriodUsage.java
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,73 @@ | ||
package com.testdroid.api.model; | ||
|
||
import com.testdroid.api.APIEntity; | ||
|
||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/** | ||
* @author Michał Szpruta <[email protected]> | ||
*/ | ||
@XmlRootElement | ||
public class APIBillingPeriodUsage extends APIEntity { | ||
|
||
private APIDeviceSession.Type type; | ||
|
||
private APIDevice.OsType osType; | ||
|
||
private long billableSeconds; | ||
|
||
private long nonBillableSeconds; | ||
|
||
public APIBillingPeriodUsage() { | ||
} | ||
|
||
public APIBillingPeriodUsage( | ||
APIDeviceSession.Type type, APIDevice.OsType osType, long billableSeconds, long nonBillableSeconds) { | ||
this.type = type; | ||
this.osType = osType; | ||
this.billableSeconds = billableSeconds; | ||
this.nonBillableSeconds = nonBillableSeconds; | ||
} | ||
|
||
public APIDeviceSession.Type getType() { | ||
return type; | ||
} | ||
|
||
public APIDevice.OsType getOsType() { | ||
return osType; | ||
} | ||
|
||
public long getBillableSeconds() { | ||
return billableSeconds; | ||
} | ||
|
||
public long getNonBillableSeconds() { | ||
return nonBillableSeconds; | ||
} | ||
|
||
public void setType(APIDeviceSession.Type type) { | ||
this.type = type; | ||
} | ||
|
||
public void setOsType(APIDevice.OsType osType) { | ||
this.osType = osType; | ||
} | ||
|
||
public void setBillableSeconds(long billableSeconds) { | ||
this.billableSeconds = billableSeconds; | ||
} | ||
|
||
public void setNonBillableSeconds(long nonBillableSeconds) { | ||
this.nonBillableSeconds = nonBillableSeconds; | ||
} | ||
|
||
@Override | ||
protected <T extends APIEntity> void clone(T from) { | ||
APIBillingPeriodUsage original = (APIBillingPeriodUsage) from; | ||
cloneBase(from); | ||
this.type = original.type; | ||
this.osType = original.osType; | ||
this.billableSeconds = original.billableSeconds; | ||
this.nonBillableSeconds = original.nonBillableSeconds; | ||
} | ||
} |
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
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
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 |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
import java.time.LocalDateTime; | ||
import java.util.Date; | ||
|
||
import static org.apache.commons.lang3.StringUtils.EMPTY; | ||
|
||
/** | ||
* @author Łukasz Kajda <[email protected]> | ||
* @author Michał Szpruta <[email protected]> | ||
|
@@ -25,7 +27,7 @@ public enum Status { | |
CLOSED | ||
} | ||
|
||
public static final String DISABLED_TEXT = ""; | ||
public static final String DISABLED_TEXT = EMPTY; | ||
|
||
public static final String ENABLED_TEXT = "on"; | ||
|
||
|
@@ -139,7 +141,7 @@ public APILicense( | |
} | ||
|
||
private static String getTextValue(Integer i) { | ||
return i != null ? Integer.toString(i) : ""; | ||
return i != null ? Integer.toString(i) : EMPTY; | ||
} | ||
|
||
private static String getTextValue(boolean b) { | ||
|
Oops, something went wrong.