-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added model parsing tests from fixtures
- Loading branch information
Showing
24 changed files
with
621 additions
and
33 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
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
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
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,11 @@ | ||
package postageapp; | ||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: stephanleroux | ||
* Date: 2012-11-29 | ||
* Time: 8:32 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class PostageAppClientTest { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/java/postageapp/http/PostageAppExceptionTest.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,11 @@ | ||
package postageapp.http; | ||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: stephanleroux | ||
* Date: 2012-11-29 | ||
* Time: 8:32 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class PostageAppExceptionTest { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/test/java/postageapp/http/PostageAppHttpClientTest.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,11 @@ | ||
package postageapp.http; | ||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: stephanleroux | ||
* Date: 2012-11-29 | ||
* Time: 8:32 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class PostageAppHttpClientTest { | ||
} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package postageapp.models; | ||
|
||
import org.junit.Test; | ||
import postageapp.ModelTestCase; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: stephanleroux | ||
* Date: 2012-11-29 | ||
* Time: 8:31 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class MessageTest extends ModelTestCase { | ||
@Test | ||
public void testParseMessageJson() throws Exception { | ||
Map<String, ?> dataObj = this.getDataFromResponse(this.loadModelFixture("mock_api_1.0/mock_get_messages.json")); | ||
Message msg = new Message("27cf6ede7501a32d54d22abe17e3c154d2cae7f3", | ||
(Map<String, ?>)dataObj.get("27cf6ede7501a32d54d22abe17e3c154d2cae7f3")); | ||
assertNotNull(msg.getCreatedAt()); | ||
assertNotNull(msg.getTemplate()); | ||
assertNotNull(msg.getTransmissionsCompleted()); | ||
assertNotNull(msg.getTransmissionsFailed()); | ||
assertNotNull(msg.getTransmissionsTotal()); | ||
assertNotNull(msg.getUid()); | ||
assertNotNull(msg.getWillPurgeAt()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/test/java/postageapp/models/MessageTransmissionResponseTest.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,33 @@ | ||
package postageapp.models; | ||
|
||
import org.junit.Test; | ||
import postageapp.ModelTestCase; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: stephanleroux | ||
* Date: 2012-11-29 | ||
* Time: 8:31 PM | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class MessageTransmissionResponseTest extends ModelTestCase { | ||
@Test | ||
public void testParseMessageTransmissionResponseJson() { | ||
Map<String, ?> data = this.getDataFromResponse(this.loadModelFixture("mock_api_1.0/mock_message_transmissions.json")); | ||
MessageTransmissonsResponse response = new MessageTransmissonsResponse(data); | ||
assertNotNull(response); | ||
assertNotNull(response.getMessageId()); | ||
assertNotNull(response.getTransmissions()); | ||
|
||
MessageTransmission transmission = response.getTransmissions().get("[email protected]"); | ||
assertNotNull(transmission); | ||
assertNotNull(transmission.getErrorMessage()); | ||
assertNotNull(transmission.getCreatedAt()); | ||
assertNull(transmission.getFailedAt()); | ||
assertNotNull(transmission.getOpenedAt()); | ||
assertNotNull(transmission.getResultCode()); | ||
assertNotNull(transmission.getStatus()); | ||
} | ||
} |
Oops, something went wrong.