Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

ErrorCodeId is now supported in SubscriberResult #129

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Java platform. Among other things, the SDK:
For more information about the Java SDK and how to use it, please see
the Javadocs at http://salesforce-marketingcloud.github.io/FuelSDK-Java/.

New Features in Version 1.5.2
------------
* Added Support for SubscriberResult ErrorCodeID

New Features in Version 1.5.1
------------
* Added Support for Java 11
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.salesforce-marketingcloud</groupId>
<artifactId>fuelsdk</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<name>Salesforce Marketing Cloud Java SDK</name>
<description>Salesforce Marketing Cloud Java SDK</description>
<url>https://github.com/salesforce-marketingcloud/FuelSDK-Java</url>
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/etframework.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -2421,6 +2421,7 @@
<element name="ErrorCode" minOccurs="1" maxOccurs="1" type="xsd:string" />
<element name="ErrorDescription" minOccurs="0" maxOccurs="1" type="xsd:string" />
<element name="Ordinal" minOccurs="0" type="xsd:int" />
<element name="ErrorCodeID" minOccurs="0" maxOccurs="1" type="xsd:int" />
</sequence>
</complexType>
<element name="SubscriberResult" type="tns:SubscriberResult" />
Expand Down
60 changes: 58 additions & 2 deletions src/test/java/com/exacttarget/fuelsdk/ETTriggeredTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
*/
package com.exacttarget.fuelsdk;

import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.UUID;

import com.exacttarget.fuelsdk.internal.*;
import com.exacttarget.fuelsdk.annotations.*;
import java.util.*;
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
Expand Down Expand Up @@ -221,6 +223,60 @@ public void a7_deleteTSD(){
ex.printStackTrace();
}
}

@Test
public void fuelSdkSendEmailWithValidEmail()
{
try
{
ETTriggeredEmail triggeredSendDefinition = new ETTriggeredEmail();
triggeredSendDefinition.setCustomerKey(tsName);
triggeredSendDefinition.setClient(client);

ETSubscriber subscriber = new ETSubscriber();
subscriber.setEmailAddress("jane.doe@gmail.com");
subscriber.setSubscriberKey("jane.doe@gmail.com");

List<ETSubscriber> subscribers = new ArrayList<ETSubscriber>();
subscribers.add(subscriber);
ETResponse<ETTriggeredEmail> createResponse = triggeredSendDefinition
.send(subscribers);

assertEquals(createResponse.getResponseCode(), "OK");

}
catch (Exception ex)
{
fail(ex.toString());
}
}

@Test
public void fuelSdkSendEmailWithInValidEmail()
{
try
{
ETTriggeredEmail triggeredSendDefinition = new ETTriggeredEmail();
triggeredSendDefinition.setCustomerKey(tsName);
triggeredSendDefinition.setClient(client);

ETSubscriber subscriber = new ETSubscriber();
subscriber.setEmailAddress("jane.doe+spam@gmail.com");
subscriber.setSubscriberKey("jane.doe+spam@gmail.com");

List<ETSubscriber> subscribers = new ArrayList<ETSubscriber>();
subscribers.add(subscriber);
ETResponse<ETTriggeredEmail> createResponse = triggeredSendDefinition
.send(subscribers);

assertEquals(createResponse.getResponseCode(), "Error");

}
catch (Exception ex)
{
fail(ex.toString());
}
}

/* public static void main(String[] args){
System.out.println("Hello World");
Expand Down