Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cleeng</groupId>
<artifactId>cleeng-java-sdk</artifactId>
<version>2.8.0</version>
<version>2.8.2</version>
<name>Cleeng Java SDK</name>

<licenses>
Expand Down Expand Up @@ -116,6 +116,21 @@
</execution>
</executions>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>-->
</plugins>
<resources>
<resource>
Expand Down Expand Up @@ -164,7 +179,7 @@
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/cleeng/api/domain/Answer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,14 @@ public class Answer implements Serializable {
public String questionId;
public String question;
public String value;

public Answer() {

}

public Answer(String questionId, String question, String value) {
this.questionId = questionId;
this.question = question;
this.value = value;
}
}
35 changes: 34 additions & 1 deletion src/main/java/com/cleeng/api/domain/PersonalData.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,53 @@
package com.cleeng.api.domain;

import java.io.Serializable;
import java.util.ArrayList;

public class PersonalData implements Serializable {

public String firstName;
public String lastName;
public String address;
public String address2;
public String city;
public String postCode;
public String country;
public String email;
public String birthDate;
public String companyName;
public String phoneNumber;
public Integer broadcasterId;
public ArrayList<Answer> customAnswers;

public PersonalData() {

}

public PersonalData(String firstName, String address, String country) {
public PersonalData(String firstName,
String lastName,
String address,
String address2,
String city,
String postCode,
String country,
String email,
String birthDate,
String companyName,
String phoneNumber,
Integer broadcasterId,
ArrayList<Answer> customAnswers) {
this.firstName = firstName;
this.lastName = lastName;
this.address = address;
this.address2 = address2;
this.city = city;
this.postCode = postCode;
this.country = country;
this.email = email;
this.birthDate = birthDate;
this.companyName = companyName;
this.phoneNumber = phoneNumber;
this.broadcasterId = broadcasterId;
this.customAnswers = customAnswers;
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/cleeng/api/domain/PersonalDataResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

public class PersonalDataResponse extends JSONRPCMessage {

public PersonalDataResult result;
public PersonalData result;

public PersonalDataResponse() {

}

public PersonalDataResponse(PersonalDataResult result) {
public PersonalDataResponse(PersonalData result) {

this.result = result;
}
Expand Down
23 changes: 0 additions & 23 deletions src/main/java/com/cleeng/api/domain/PersonalDataResult.java

This file was deleted.

38 changes: 35 additions & 3 deletions src/test/java/com/cleeng/api/CleengImplTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ public void testGetAccessStatus() throws IOException {
final GetAccessStatusResponse response = this.api.getAccessStatus(this.customerToken, "A334745341_PL", "78.129.213.71");
assertNotNull(response.result);
assertEquals("Access granted should match", true, response.result.accessGranted);
assertEquals("ExpiresAt should match", 1549400941, response.result.expiresAt);
assertEquals("ExpiresAt should match", 1717356800, response.result.expiresAt);
assertEquals("PurchasedDirectly should match", false, response.result.purchasedDirectly);
}

Expand Down Expand Up @@ -1428,7 +1428,23 @@ public void testInvokeBatch() throws IOException, InterruptedException {
@Test
public void testUpdateBroadcasterSpecificPersonalDataWithCaptureAnswers() throws IOException {

final BooleanResponse response = this.api.updateBroadcasterSpecificPersonalDataWithCaptureAnswers(250897629, new PersonalData("John","445 Mount Eden Road, Mount Eden, Auckland","New Zealand"));
ArrayList<Answer> customAnswers = new ArrayList<>();
customAnswers.add(new Answer("custom_1", "zipcode", "10002"));

final BooleanResponse response = this.api.updateBroadcasterSpecificPersonalDataWithCaptureAnswers(250897629, new PersonalData("John",
"Doe",
"445 Mount Eden Road",
"Mount Eden",
"Auckland",
null,
"New Zealand",
null,
null,
null,
null,
714418052,
customAnswers
));

Assert.assertNotNull(response);
Assert.assertNotNull(response.result);
Expand All @@ -1438,9 +1454,25 @@ public void testUpdateBroadcasterSpecificPersonalDataWithCaptureAnswers() throws
@Test
public void testUpdateBroadcasterSpecificPersonalDataWithCaptureAnswersAsync() throws IOException, InterruptedException {

ArrayList<Answer> customAnswers = new ArrayList<>();
customAnswers.add(new Answer("custom_1", "zipcode", "10002"));

final List<AsyncRequest> requests = new ArrayList<>();
final AsyncRequestCallback<BooleanResponse> callback = new AsyncRequestCallback<>(BooleanResponse.class);
final PersonalDataParams params = new PersonalDataParams(this.publisherToken, 250897629, new PersonalData("John","445 Mount Eden Road, Mount Eden, Auckland","New Zealand"));
final PersonalDataParams params = new PersonalDataParams(this.publisherToken, 250897629, new PersonalData("John",
"Doe",
"445 Mount Eden Road",
"Mount Eden",
"Auckland",
null,
"New Zealand",
null,
null,
null,
null,
714418052,
customAnswers
));

requests.add(new AsyncRequest(params, callback));

Expand Down