Skip to content

Commit

Permalink
server style
Browse files Browse the repository at this point in the history
  • Loading branch information
az108 committed Nov 14, 2024
1 parent 6fa20f9 commit 7d1b039
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.jupiter.params.provider.MethodSource;
import org.mockito.ArgumentMatchers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.security.test.context.support.WithMockUser;

Expand Down Expand Up @@ -882,9 +883,11 @@ void testGetParticipationForFeedbackId() throws Exception {
Result result = participationUtilService.addResultToParticipation(AssessmentType.AUTOMATIC, null, participation);
participationUtilService.addFeedbackToResult(feedback, result);

String url = "/api/exercises/" + programmingExercise.getId()
+ "/feedback-details-participation?page=1&pageSize=10&sortedColumn=participationId&sortingOrder=ASCENDING&feedbackIds=" + feedback.getId();
String jsonResponse = request.get(url, HttpStatus.OK, String.class);
String url = "/api/exercises/" + programmingExercise.getId() + "/feedback-details-participation?page=1&pageSize=10&sortedColumn=participationId&sortingOrder=ASCENDING";
HttpHeaders headers = new HttpHeaders();
headers.add("feedbackIds", String.valueOf(feedback.getId()));

String jsonResponse = request.get(url, HttpStatus.OK, String.class, headers);

JsonNode jsonNode = new ObjectMapper().readTree(jsonResponse);
assertThat(jsonNode.has("content")).isTrue();
Expand Down

0 comments on commit 7d1b039

Please sign in to comment.