Skip to content
Snippets Groups Projects
Commit 88e5e3a5 authored by srosse's avatar srosse
Browse files

OO-288: fix the unit tests which rely on the issue of GET repo/courses/courseId/groups

parent 0f932126
No related branches found
No related tags found
No related merge requests found
...@@ -250,7 +250,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase { ...@@ -250,7 +250,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
vo.setMaxParticipants(g1.getMaxParticipants()); vo.setMaxParticipants(g1.getMaxParticipants());
vo.setType(g1.getType()); vo.setType(g1.getType());
URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getResourceableId() + "/groups/" + g1.getKey()).build(); URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getOlatResource().getResourceableId() + "/groups/" + g1.getKey()).build();
HttpPost method = conn.createPost(request, MediaType.APPLICATION_JSON, true); HttpPost method = conn.createPost(request, MediaType.APPLICATION_JSON, true);
conn.addJsonEntity(method, vo); conn.addJsonEntity(method, vo);
HttpResponse response = conn.execute(method); HttpResponse response = conn.execute(method);
...@@ -268,7 +268,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase { ...@@ -268,7 +268,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
public void testDeleteCourseGroup() throws IOException, URISyntaxException { public void testDeleteCourseGroup() throws IOException, URISyntaxException {
assertTrue(conn.login("administrator", "openolat")); assertTrue(conn.login("administrator", "openolat"));
URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getResourceableId() + "/groups/" + g1.getKey()).build(); URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getOlatResource().getResourceableId() + "/groups/" + g1.getKey()).build();
HttpDelete method = conn.createDelete(request, MediaType.APPLICATION_JSON, true); HttpDelete method = conn.createDelete(request, MediaType.APPLICATION_JSON, true);
HttpResponse response = conn.execute(method); HttpResponse response = conn.execute(method);
EntityUtils.consume(response.getEntity()); EntityUtils.consume(response.getEntity());
...@@ -282,7 +282,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase { ...@@ -282,7 +282,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
public void testBasicSecurityDeleteCall() throws IOException, URISyntaxException { public void testBasicSecurityDeleteCall() throws IOException, URISyntaxException {
assertTrue(conn.login("rest-c-g-3", "A6B7C8")); assertTrue(conn.login("rest-c-g-3", "A6B7C8"));
URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getResourceableId() + "/groups/" + g2.getKey()).build(); URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getOlatResource().getResourceableId() + "/groups/" + g2.getKey()).build();
HttpDelete method = conn.createDelete(request, MediaType.APPLICATION_JSON, true); HttpDelete method = conn.createDelete(request, MediaType.APPLICATION_JSON, true);
HttpResponse response = conn.execute(method); HttpResponse response = conn.execute(method);
EntityUtils.consume(response.getEntity()); EntityUtils.consume(response.getEntity());
...@@ -300,7 +300,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase { ...@@ -300,7 +300,7 @@ public class CourseGroupMgmtTest extends OlatJerseyTestCase {
vo.setMinParticipants(new Integer(-1)); vo.setMinParticipants(new Integer(-1));
vo.setMaxParticipants(new Integer(-1)); vo.setMaxParticipants(new Integer(-1));
URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getResourceableId() + "/groups").build(); URI request = UriBuilder.fromUri(getContextURI()).path("/repo/courses/" + courseRepoEntry.getOlatResource().getResourceableId() + "/groups").build();
HttpPut method = conn.createPut(request, MediaType.APPLICATION_JSON, true); HttpPut method = conn.createPut(request, MediaType.APPLICATION_JSON, true);
conn.addJsonEntity(method, vo); conn.addJsonEntity(method, vo);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment