Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

authorize app by role #57

Merged
merged 1 commit into from
Sep 3, 2024
Merged
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 @@ -67,7 +67,7 @@ void getPageableTopic_ShouldReturnPagedTopics_WhenValidParams() throws Exception
when(topicService.getPageableTopics(pageNum, pageSize, keyword)).thenReturn(pageableData);

// When & Then
mockMvc.perform(get("/api/v1/admin/topic/paging")
mockMvc.perform(get("/api/v1/admin/topics/paging")
.param("pageNum", String.valueOf(pageNum))
.param("pageSize", String.valueOf(pageSize))
.param("keyword", keyword))
Expand Down Expand Up @@ -100,7 +100,7 @@ void create_ShouldReturnCreatedTopic_WhenValidInput() throws Exception {
when(topicService.create(topicPostVM)).thenReturn(createdTopic);

// When & Then
mockMvc.perform(post("/api/v1/admin/topic")
mockMvc.perform(post("/api/v1/admin/topics")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(topicPostVM)))
.andExpect(status().isCreated())
Expand Down Expand Up @@ -129,7 +129,7 @@ void update_ShouldReturnNoContent_WhenValidInput() throws Exception {
doNothing().when(topicService).update(topicPostVM, topicId);

// When & Then
mockMvc.perform(put("/api/v1/admin/topic/{id}", topicId)
mockMvc.perform(put("/api/v1/admin/topics/{id}", topicId)
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(topicPostVM)))
.andExpect(status().isNoContent());
Expand All @@ -142,7 +142,7 @@ void delete_ShouldReturnNoContent_WhenTopicDeleted() throws Exception {
doNothing().when(topicService).delete(topicId);

// When & Then
mockMvc.perform(delete("/api/v1/admin/topic/{id}", topicId))
mockMvc.perform(delete("/api/v1/admin/topics/{id}", topicId))
.andExpect(status().isOk());
}
}
Loading