@@ -0,0 +1,1656 @@
+package se.lth.cs.connect;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0Aimport com.jayway.restassured.response.Response;%0A%0Aimport ro.pippo.test.PippoRule;%0Aimport ro.pippo.test.PippoTest;%0A%0Apublic class TestUserAPI extends PippoTest %7B%0A%0A%09@Rule%0A%09public PippoRule pippoRule = new PippoRule(new Connect());%0A%09%0A%09@Test%0A%09public void testAccessDenied() %7B%0A%09%09// These routes require an active session =%3E they should fail (with status 401)%0A%09%09when().get(%22/v1/account/login%22).then().statusCode(401);%0A%09%09when().get(%22/v1/account/collections%22).then().statusCode(401);%0A%09%09when().get(%22/v1/account/self%22).then().statusCode(401);%0A%09%09when().post(%22/v1/account/logout%22).then().statusCode(401);%0A%09%09when().post(%22/v1/account/delete%22).then().statusCode(401);%0A%09%09when().post(%22/v1/account/change-password%22).then().statusCode(401);%0A%09%09when().get(%22/v1/account/invites%22).then().statusCode(401);%0A%09%09when().get(%22/v1/account/dat12asm@student.lu.se%22).then().statusCode(401);%0A%09%7D%0A%09%0A%09// Register --%3E Logout --%3E Login --%3E Delete%0A%09@Test%0A%09public void testLifecycle() %7B%0A%09%09Response reg = given().%0A%09%09%09%09param(%22email%22, %22test@serptest.test%22).%0A%09%09%09%09param(%22passw%22, %22hejsanhoppsan%22).%0A%09%09%09post(%22/v1/account/register%22);%0A%09%09%0A%09%09reg.then().%0A%09%09%09statusCode(200);%0A%09%09%0A%09%09given().%0A%09%09%09cookie(%22JSESSIONID%22, reg.getCookie(%22JSESSIONID%22)).%0A%09%09when().%0A%09%09%09post(%22/v1/account/logout%22).%0A%09%09then().%0A%09%09%09statusCode(200);%0A%09%09%0A%09%09Response login = given().%0A%09%09%09%09param(%22email%22, %22test@serptest.test%22).%0A%09%09%09%09param(%22passw%22, %22hejsanhoppsan%22).%0A%09%09%09post(%22/v1/account/login%22);%0A%09%09%0A%09%09reg.then().%0A%09%09%09statusCode(200);%0A%09%09%0A%09%09given().%0A%09%09%09cookie(%22JSESSIONID%22, login.getCookie(%22JSESSIONID%22)).%0A%09%09when().%0A%09%09%09post(%22/v1/account/delete%22).%0A%09%09then().%0A%09%09%09statusCode(200);%0A%09%7D%0A%7D%0A

Add sample test cases for user api