This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 6b78affd authored by Michael Breu's avatar Michael Breu :speech_balloon:
Browse files

Fixing Tests

parent 28842ee1
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -58,7 +58,7 @@ public class ExerciseResourceIT {
@Test
public void getExercisemd() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId).param("filePath", "exercise.md")
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "exercise.md")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
......@@ -71,7 +71,7 @@ public class ExerciseResourceIT {
@Test
public void getNestedPath() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId).param("filePath", "solution/src/at/ac/uibk/ac/artemis/Receiver.java")
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "solution/src/at/ac/uibk/ac/artemis/Receiver.java")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
......@@ -83,7 +83,7 @@ public class ExerciseResourceIT {
@Test
public void getSplitPath() throws Exception {
String exerciseId = "272:solution/src/at"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId).param("filePath", "ac/uibk/ac/artemis/Receiver.java")
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "ac/uibk/ac/artemis/Receiver.java")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
......@@ -91,16 +91,18 @@ public class ExerciseResourceIT {
.andExpect(StreamResultMatcher.expectOctetStream())
.andExpect(StreamResultMatcher.expectMinimumSize(50));
}
@Test
public void testNotFound() throws Exception {
String exerciseId = "1"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId).param("filePath", "fileDoesNotExist.md")
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "fileDoesNotExist.md")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
.andDo(print())
.andExpect(status().isNotFound());
}
public static class StreamResultMatcher {
public static ResultMatcher expectMinimumSize(int size) {
......@@ -117,5 +119,10 @@ public class ExerciseResourceIT {
};
}
}
@Test
public void getExerciseById() {
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment