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

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

Intermediate commit: Preparation of get Exercise by Id

parent 1e375bd1
Branches
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -29,7 +29,7 @@ public final class SearchRepositoryConstants {
public static final String METADATA_TYPE = "metadata.type";
public static final String METADATA_LANGUAGE = "metadata.language";
public static final String FILE_PARENTID = "file.parent";
public static final String FILE_PARENTID = "file.parentId";
public static final String PROJECT_VISIBILITY = "project.visibility";
public static final String PROJECT_NAMESPACE = "project.namespace";
......
......@@ -50,7 +50,7 @@ public class ExerciseResource {
* @param basketToken the basket
* @return the ResponseEntity with status 200 (OK) and with body the exercise, or with status 404 (Not Found)
*/
@GetMapping("/exercise/**")
@GetMapping("/exerciseFile/**")
public ResponseEntity<Resource> getRepositoryFile(HttpServletRequest request, @RequestParam("filePath") String filePath) throws IOException {
String pattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);
......
......@@ -6,7 +6,7 @@ import { SERVER_API_URL } from 'app/app.constants';
@Injectable({ providedIn: 'root' })
export class ExerciseService {
public resourceUrl = SERVER_API_URL + 'api/exercise/';
public resourceUrl = SERVER_API_URL + 'api/exerciseFile/';
constructor(private http: HttpClient) {}
......
......@@ -44,7 +44,7 @@ public class ExerciseResourceIT {
@Test
public void getREADME() throws Exception {
String exerciseId = "272"; // warning: this depends on the sequence in the current search index :-(
restExerciseMockMvc.perform(get("/api/exercise/"+exerciseId).param("filePath", "README.md")
restExerciseMockMvc.perform(get("/api/exerciseFile/"+exerciseId).param("filePath", "README.md")
.with(csrf().asHeader())
.contentType(MediaType.APPLICATION_JSON))
// .andDo(print())
......
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