diff --git a/.gitignore b/.gitignore index 8c7863e..10cd14e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ nb-configuration.xml # Local environment .env +.sh # Plugin directory /.quarkus/cli/plugins/ diff --git a/src/test/java/io/github/onecx/announcement/rs/internal/AnnouncementControllerInternalTest.java b/src/test/java/io/github/onecx/announcement/rs/internal/AnnouncementControllerInternalTest.java index a5dafc3..d7343df 100644 --- a/src/test/java/io/github/onecx/announcement/rs/internal/AnnouncementControllerInternalTest.java +++ b/src/test/java/io/github/onecx/announcement/rs/internal/AnnouncementControllerInternalTest.java @@ -73,12 +73,12 @@ void getAnnouncementsByCriteriaTest() { @Test void createAnnouncementTest() { - // create product + // create announcement var createDto = new CreateAnnouncementRequestDTO(); createDto.setAppId("app0"); - createDto.setContent("test01"); createDto.setTitle("basePath"); + createDto.setStartDate(OffsetDateTime.parse("2000-03-10T12:15:50-04:00")); var dto = given() .when() @@ -93,8 +93,9 @@ void createAnnouncementTest() { assertThat(dto).isNotNull(); assertThat(dto.getAppId()).isNotNull().isEqualTo(createDto.getAppId()); assertThat(dto.getTitle()).isNotNull().isEqualTo(createDto.getTitle()); + assertThat(dto.getStartDate()).isNotNull().isEqualTo(createDto.getStartDate()); - // create theme without body + // create announcement without body var exception = given() .when() .contentType(APPLICATION_JSON) @@ -106,7 +107,7 @@ void createAnnouncementTest() { assertThat(exception.getErrorCode()).isEqualTo(AnnouncementMapper.ErrorKeys.CONSTRAINT_VIOLATIONS.name()); assertThat(exception.getDetail()).isEqualTo("createAnnouncement.createAnnouncementRequestDTO: must not be null"); - // create theme with existing name + // create announcement with existing name dto = given().when() .contentType(APPLICATION_JSON) .body(createDto) @@ -165,9 +166,11 @@ void getAnnouncementTest() { @Test void updateAnnouncementTest() { + var updateDto = new UpdateAnnouncementRequestDTO(); + updateDto.setTitle("test01"); - updateDto.setContent("0.0.0"); + updateDto.setStartDate(OffsetDateTime.parse("2000-03-10T12:15:50-04:00")); given() .contentType(APPLICATION_JSON) @@ -195,6 +198,7 @@ void updateAnnouncementTest() { assertThat(dto).isNotNull(); assertThat(dto.getTitle()).isEqualTo(updateDto.getTitle()); + assertThat(dto.getStartDate()).isEqualTo(updateDto.getStartDate()); } @Test