1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-16 03:06:22 +00:00

Closes #21: Save IP and UA on login

This commit is contained in:
jendib
2015-05-15 17:30:21 +02:00
parent 0228d43442
commit b2a38cea62
8 changed files with 70 additions and 4 deletions

View File

@@ -144,6 +144,9 @@ public class TestUserResource extends BaseJerseyTest {
Assert.assertEquals(Status.OK, Status.fromStatusCode(response.getStatus()));
json = response.getEntity(JSONObject.class);
Assert.assertTrue(json.getJSONArray("sessions").length() > 0);
JSONObject session = json.getJSONArray("sessions").getJSONObject(0);
Assert.assertEquals("127.0.0.1", session.getString("ip"));
Assert.assertTrue(session.getString("user_agent").startsWith("Java"));
// Delete all sessions
userResource = resource().path("/user/session");