Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

UsosCourseEdition bugfix #6

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public List<UsosGrade> latest(UsosLatestParam params) {
}

@SuppressWarnings("unchecked")
public Map<String, UsosGradesCourseEdition> terms2(UsosGradesTermsParam params) {
public Map<String, Map<String, UsosGradesCourseEdition>> terms2(UsosGradesTermsParam params) {
return requestWithAccessToken(requestFactory.get(
"services/grades/terms2", params,
FieldSelector.fromRequest(UsosGrade.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

import java.util.Map;

public record UsosGradesCourseEdition(UsosGradesExam[] courseGrades, Map<String, UsosGradesExam[]> courseUnitsGrades) implements UsosObject {
public record UsosGradesCourseEdition(Map<String, UsosGrade>[] courseGrades, Map<String, UsosGradesExam[]> courseUnitsGrades) implements UsosObject {
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
import org.junit.jupiter.api.Test;
import pl.wmsdev.usos4j.model.grades.*;

import java.util.Arrays;

import static org.junit.jupiter.api.Assertions.assertThrows;

public class UsosGradesAPITest extends UsosAPIBaseTest {

@Test
void courseEdition2() {
log(userApi.grades().courseEdition2(UsosGradesCourseEditionParams.builder("W13IST-SI0002G", "2023/24-Z").build()));
var result = userApi.grades().courseEdition2(UsosGradesCourseEditionParams.builder("W13IST-SI0002G", "2023/24-Z").build());
log("result: " + result);
log("grade: " + Arrays.toString(result.courseGrades()));
}

@Test
Expand Down
Loading