From 9f16e33f7cb9ae19966e7c0790c57f4a59270168 Mon Sep 17 00:00:00 2001 From: pszumanski Date: Tue, 30 Apr 2024 17:02:39 +0200 Subject: [PATCH] Fixed json deserialization Fixed a bug that occurred when trying to use UsosStudentProgramme properties returned in student() method --- .../main/java/pl/wmsdev/usos4j/api/progs/UsosProgsAPI.java | 5 ++--- .../src/test/java/pl/wmsdev/UsosProgsAPITest.java | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/pl/wmsdev/usos4j/api/progs/UsosProgsAPI.java b/core/src/main/java/pl/wmsdev/usos4j/api/progs/UsosProgsAPI.java index bdca68f..8281115 100644 --- a/core/src/main/java/pl/wmsdev/usos4j/api/progs/UsosProgsAPI.java +++ b/core/src/main/java/pl/wmsdev/usos4j/api/progs/UsosProgsAPI.java @@ -50,12 +50,11 @@ public UsosStage stage(UsosStageParam params) { UsosStage.class); } - @SuppressWarnings("unchecked") public List student() { - return requestWithAccessToken(requestFactory.get( + return List.of(requestWithAccessToken(requestFactory.get( "services/progs/student", FieldSelector.fromRequest(UsosStudentProgramme.class)), - List.class); + UsosStudentProgramme[].class)); } public UsosStudentProgramme studentProgramme(UsosStudentProgrammeParam params) { diff --git a/integration-tests/src/test/java/pl/wmsdev/UsosProgsAPITest.java b/integration-tests/src/test/java/pl/wmsdev/UsosProgsAPITest.java index 0bf8267..e1a936c 100644 --- a/integration-tests/src/test/java/pl/wmsdev/UsosProgsAPITest.java +++ b/integration-tests/src/test/java/pl/wmsdev/UsosProgsAPITest.java @@ -45,6 +45,7 @@ void stage() { @Test void student() { log(userApi.progs().student()); + log(userApi.progs().student().get(0).programme().id()); } @Test