From a9bb7423cab408223ced6f63042a58dd0e5b6047 Mon Sep 17 00:00:00 2001 From: Sean Starkey Date: Tue, 2 Jun 2026 15:42:21 -0600 Subject: [PATCH] Cleanup --- .../notesvault/dto/CreateNoteRequest.java | 2 -- .../notesvault/dto/NoteResponse.java | 2 -- .../notesvault/dto/ShareNoteRequest.java | 2 -- .../repository/NoteShareRepository.java | 18 ------------------ .../controller/NoteListingControllerTest.java | 6 ------ 5 files changed, 30 deletions(-) diff --git a/src/main/java/com/seanstarkey/notesvault/dto/CreateNoteRequest.java b/src/main/java/com/seanstarkey/notesvault/dto/CreateNoteRequest.java index 6c47384..8a970a0 100644 --- a/src/main/java/com/seanstarkey/notesvault/dto/CreateNoteRequest.java +++ b/src/main/java/com/seanstarkey/notesvault/dto/CreateNoteRequest.java @@ -9,8 +9,6 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; /** - * Carries note content supplied by an authenticated owner. - * * @param title optional note title, limited to a concise display length * @param content required note body */ diff --git a/src/main/java/com/seanstarkey/notesvault/dto/NoteResponse.java b/src/main/java/com/seanstarkey/notesvault/dto/NoteResponse.java index 7a29cca..3eee608 100644 --- a/src/main/java/com/seanstarkey/notesvault/dto/NoteResponse.java +++ b/src/main/java/com/seanstarkey/notesvault/dto/NoteResponse.java @@ -9,8 +9,6 @@ import java.time.Instant; import java.util.UUID; /** - * Represents a note visible to the authenticated caller. - * * @param id stable note identifier * @param title note title * @param content note body diff --git a/src/main/java/com/seanstarkey/notesvault/dto/ShareNoteRequest.java b/src/main/java/com/seanstarkey/notesvault/dto/ShareNoteRequest.java index 1a06747..d051add 100644 --- a/src/main/java/com/seanstarkey/notesvault/dto/ShareNoteRequest.java +++ b/src/main/java/com/seanstarkey/notesvault/dto/ShareNoteRequest.java @@ -9,8 +9,6 @@ import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Size; /** - * Carries the target username for a note share operation. - * * @param username recipient username to grant read-only access */ public record ShareNoteRequest( diff --git a/src/main/java/com/seanstarkey/notesvault/repository/NoteShareRepository.java b/src/main/java/com/seanstarkey/notesvault/repository/NoteShareRepository.java index 12e15da..2c518a0 100644 --- a/src/main/java/com/seanstarkey/notesvault/repository/NoteShareRepository.java +++ b/src/main/java/com/seanstarkey/notesvault/repository/NoteShareRepository.java @@ -1,9 +1,5 @@ /** * NoteShareRepository.java - * - * Spring Data repository for note share grants. Provides lookup helpers for - * duplicate-share checks, read-access checks, and data-layer tests around cascade - * deletion behavior. */ package com.seanstarkey.notesvault.repository; @@ -16,15 +12,9 @@ import java.util.List; import java.util.Optional; import java.util.UUID; -/** - * Repository for NoteShare entities. Encapsulates queries around read-only share - * grants between notes and recipient users. - */ public interface NoteShareRepository extends JpaRepository { /** - * Finds an existing share grant for a note and recipient user. - * * @param note the shared note * @param sharedWith the user who may have read-only access * @return an Optional containing the share grant, or empty when no grant exists @@ -32,8 +22,6 @@ public interface NoteShareRepository extends JpaRepository { Optional findByNoteAndSharedWith(Note note, User sharedWith); /** - * Checks whether a note is already shared with a recipient. - * * @param note the note whose share grants should be searched * @param sharedWith the recipient user * @return true when a share grant exists; false otherwise @@ -41,24 +29,18 @@ public interface NoteShareRepository extends JpaRepository { boolean existsByNoteAndSharedWith(Note note, User sharedWith); /** - * Lists all share grants for a note. - * * @param note the note whose share grants should be returned * @return all share grants associated with the note */ List findAllByNote(Note note); /** - * Lists all share grants received by a user. - * * @param sharedWith the user whose received shares should be returned * @return all share grants where the supplied user is the recipient */ List findAllBySharedWith(User sharedWith); /** - * Deletes all share grants for a note. - * * @param note the note whose share grants should be removed */ void deleteAllByNote(Note note); diff --git a/src/test/java/com/seanstarkey/notesvault/controller/NoteListingControllerTest.java b/src/test/java/com/seanstarkey/notesvault/controller/NoteListingControllerTest.java index f709a6e..791c4be 100644 --- a/src/test/java/com/seanstarkey/notesvault/controller/NoteListingControllerTest.java +++ b/src/test/java/com/seanstarkey/notesvault/controller/NoteListingControllerTest.java @@ -1,7 +1,5 @@ /** * NoteListingControllerTest.java - * - * API-level tests for authenticated note listing behavior. */ package com.seanstarkey.notesvault.controller; @@ -18,10 +16,6 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -/** - * Verifies GET /notes through the real Spring MVC, Security, JPA, validation, - * and Flyway-backed H2 application stack. - */ @SpringBootTest @AutoConfigureMockMvc @Transactional