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

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

Fixing Tests

parent 3f92db72
1 merge request!55June Release
...@@ -58,7 +58,7 @@ public class ExerciseResourceIT { ...@@ -58,7 +58,7 @@ public class ExerciseResourceIT {
@Test @Test
public void getExercisemd() throws Exception { public void getExercisemd() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-( 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()) .with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON)) .contentType(MediaType.APPLICATION_JSON))
.andDo(print()) .andDo(print())
...@@ -71,7 +71,7 @@ public class ExerciseResourceIT { ...@@ -71,7 +71,7 @@ public class ExerciseResourceIT {
@Test @Test
public void getNestedPath() throws Exception { public void getNestedPath() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-( 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()) .with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON)) .contentType(MediaType.APPLICATION_JSON))
.andDo(print()) .andDo(print())
...@@ -83,7 +83,7 @@ public class ExerciseResourceIT { ...@@ -83,7 +83,7 @@ public class ExerciseResourceIT {
@Test @Test
public void getSplitPath() throws Exception { public void getSplitPath() throws Exception {
String exerciseId = "272:solution/src/at"; // warning: this depends on the sequence in the current search index :-( 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()) .with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON)) .contentType(MediaType.APPLICATION_JSON))
.andDo(print()) .andDo(print())
...@@ -91,16 +91,18 @@ public class ExerciseResourceIT { ...@@ -91,16 +91,18 @@ public class ExerciseResourceIT {
.andExpect(StreamResultMatcher.expectOctetStream()) .andExpect(StreamResultMatcher.expectOctetStream())
.andExpect(StreamResultMatcher.expectMinimumSize(50)); .andExpect(StreamResultMatcher.expectMinimumSize(50));
} }
@Test @Test
public void testNotFound() throws Exception { public void testNotFound() throws Exception {
String exerciseId = "1"; // warning: this depends on the sequence in the current search index :-( 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()) .with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON)) .contentType(MediaType.APPLICATION_JSON))
.andDo(print()) .andDo(print())
.andExpect(status().isNotFound()); .andExpect(status().isNotFound());
} }
public static class StreamResultMatcher { public static class StreamResultMatcher {
public static ResultMatcher expectMinimumSize(int size) { public static ResultMatcher expectMinimumSize(int size) {
...@@ -117,5 +119,10 @@ public class ExerciseResourceIT { ...@@ -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