-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c8ba97
commit 016ecd4
Showing
4 changed files
with
69 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -525,26 +525,26 @@ public void testClearState() throws Exception { | |
@Test | ||
public void testRetrieveActivity() throws Exception { | ||
ActivityProfileLRSResponse lrsResponse = lrs.retrieveActivity(activity); | ||
Assert.assertTrue(lrsResponse.getSuccess()); | ||
|
||
ActivityProfileDocument returnedDoc = lrsResponse.getContent(); | ||
Assert.assertNull(returnedDoc.getId()); // Retrieving the full Activity does not return a profile ID | ||
Activity returnedActivity = returnedDoc.getActivity(); | ||
Assert.assertTrue(activity.getId().toString().equals(returnedActivity.getId().toString())); | ||
// Test for non-existent activity | ||
Activity noActivity = new Activity(); | ||
noActivity.setId("https://brindlewaye.com/xAPITerms/Activity/NeverGonnaHappen/"); | ||
Assert.assertTrue(lrsResponse.getSuccess()); | ||
|
||
ActivityProfileDocument returnedDoc = lrsResponse.getContent(); | ||
Assert.assertNull(returnedDoc.getId()); // Retrieving the full Activity does not return a profile ID | ||
Activity returnedActivity = returnedDoc.getActivity(); | ||
Assert.assertTrue(activity.getId().toString().equals(returnedActivity.getId().toString())); | ||
|
||
// Test for non-existent activity | ||
Activity noActivity = new Activity(); | ||
noActivity.setId("https://brindlewaye.com/xAPITerms/Activity/NeverGonnaHappen/"); | ||
|
||
ActivityProfileLRSResponse lrsResponse2 = lrs.retrieveActivity(noActivity); | ||
// Report success even though response status was 404 | ||
Assert.assertTrue(lrsResponse2.getSuccess()); | ||
Assert.assertTrue(lrsResponse2.getResponse().getStatus() == 404); | ||
Assert.assertTrue(lrsResponse2.getSuccess()); | ||
Assert.assertTrue(lrsResponse2.getResponse().getStatus() == 404); | ||
|
||
ActivityProfileDocument returnedDoc2 = lrsResponse2.getContent(); | ||
Assert.assertNull(returnedDoc2); | ||
ActivityProfileDocument returnedDoc2 = lrsResponse2.getContent(); | ||
Assert.assertNull(returnedDoc2); | ||
} | ||
|
||
@Test | ||
public void testRetrieveActivityProfileIds() throws Exception { | ||
ProfileKeysLRSResponse lrsRes = lrs.retrieveActivityProfileIds(activity); | ||
|
@@ -697,27 +697,27 @@ public void testDeleteActivityProfile() throws Exception { | |
@Test | ||
public void testRetrievePerson() throws Exception { | ||
AgentProfileLRSResponse lrsResponse = lrs.retrievePerson(agent); | ||
Assert.assertTrue(lrsResponse.getSuccess()); | ||
|
||
AgentProfileDocument returnedDoc = lrsResponse.getContent(); | ||
Assert.assertNull(returnedDoc.getId()); // Retrieving the full Agent does not return a profile ID | ||
Agent returnedAgent = returnedDoc.getAgent(); | ||
Assert.assertTrue(agent.getName().equals(returnedAgent.getName())); | ||
// Test for non-existent agent | ||
Agent noAgent = new Agent(); | ||
noAgent.setMbox("mailto:[email protected]"); | ||
noAgent.setName("No One"); | ||
Assert.assertTrue(lrsResponse.getSuccess()); | ||
|
||
AgentProfileDocument returnedDoc = lrsResponse.getContent(); | ||
Assert.assertNull(returnedDoc.getId()); // Retrieving the full Agent does not return a profile ID | ||
Agent returnedAgent = returnedDoc.getAgent(); | ||
Assert.assertTrue(agent.getName().equals(returnedAgent.getName())); | ||
|
||
// Test for non-existent agent | ||
Agent noAgent = new Agent(); | ||
noAgent.setMbox("mailto:[email protected]"); | ||
noAgent.setName("No One"); | ||
|
||
AgentProfileLRSResponse lrsResponse2 = lrs.retrievePerson(noAgent); | ||
Assert.assertTrue(lrsResponse2.getSuccess()); | ||
Assert.assertTrue(lrsResponse2.getResponse().getStatus() == 200); | ||
Agent returnedAgent2 = lrsResponse2.getContent().getAgent(); | ||
// The spec says that this call will return an object built from the information provided in the parameter Agent if it finds nothing matching at the endpoint | ||
Assert.assertTrue(returnedAgent2.equals(noAgent)); | ||
} | ||
Assert.assertTrue(lrsResponse2.getSuccess()); | ||
Assert.assertTrue(lrsResponse2.getResponse().getStatus() == 200); | ||
|
||
Agent returnedAgent2 = lrsResponse2.getContent().getAgent(); | ||
// The spec says that this call will return an object built from the information provided in the parameter Agent if it finds nothing matching at the endpoint | ||
Assert.assertTrue(returnedAgent2.equals(noAgent)); | ||
} | ||
|
||
@Test | ||
public void testRetrieveAgentProfileIds() throws Exception { | ||
ProfileKeysLRSResponse lrsRes = lrs.retrieveAgentProfileIds(agent); | ||
|