Skip to content

Commit

Permalink
tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
asliayk committed Dec 19, 2024
1 parent a9465f3 commit ca8f79e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ ChannelDTO createChannel(boolean isPublicChannel, String name) throws Exception
channelDTO.setIsPublic(isPublicChannel);
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setDescription("general channel");
channelDTO.setIsCourseWide(false);

var chat = request.postWithResponseBody("/api/courses/" + exampleCourseId + "/channels", channelDTO, ChannelDTO.class, HttpStatus.CREATED);
resetWebsocketMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ private void isAllowedToCreateChannelTest(boolean isPublicChannel, String loginN
channelDTO.setIsPublic(isPublicChannel);
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setDescription("general channel");
channelDTO.setIsCourseWide(false);

// when
var chat = request.postWithResponseBody("/api/courses/" + exampleCourseId + "/channels", channelDTO, ChannelDTO.class, HttpStatus.CREATED);
Expand Down Expand Up @@ -169,6 +170,7 @@ void createTest_messagingDeactivated(CourseInformationSharingConfiguration cours
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setName(TEST_PREFIX);
channelDTO.setDescription("general channel");
channelDTO.setIsCourseWide(false);

expectCreateForbidden(channelDTO);

Expand All @@ -187,6 +189,7 @@ void update_messagingFeatureDeactivated_shouldReturnForbidden() throws Exception
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setName(TEST_PREFIX);
channelDTO.setDescription("general channel");
channelDTO.setIsCourseWide(false);

expectUpdateForbidden(1L, channelDTO);

Expand Down Expand Up @@ -232,6 +235,7 @@ void createChannel_asNonCourseInstructorOrTutorOrEditor_shouldReturnForbidden(bo
channelDTO.setIsPublic(isPublicChannel);
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setDescription("general channel");
channelDTO.setIsCourseWide(false);

// then
expectCreateForbidden(channelDTO);
Expand Down Expand Up @@ -930,6 +934,7 @@ void createFeedbackChannel_asStudent_shouldReturnForbidden() {
channelDTO.setDescription("Discussion channel for feedback");
channelDTO.setIsPublic(true);
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setIsCourseWide(false);

FeedbackChannelRequestDTO feedbackChannelRequest = new FeedbackChannelRequestDTO(channelDTO, "Sample feedback text");

Expand All @@ -954,6 +959,7 @@ void createFeedbackChannel_asInstructor_shouldCreateChannel() {
channelDTO.setDescription("Discussion channel for feedback");
channelDTO.setIsPublic(true);
channelDTO.setIsAnnouncementChannel(false);
channelDTO.setIsCourseWide(false);

FeedbackChannelRequestDTO feedbackChannelRequest = new FeedbackChannelRequestDTO(channelDTO, "Sample feedback text");

Expand Down

0 comments on commit ca8f79e

Please sign in to comment.