From 4f14706ae14d6646d81fd1d74b6e2fb68dc7adb1 Mon Sep 17 00:00:00 2001 From: querwurzel <> Date: Fri, 24 Nov 2023 16:18:03 +0100 Subject: [PATCH] skip unnecessary build steps in frontend pom.xml --- .../binpastes/paste/api/PasteController.java | 2 +- .../{domain => business}/PasteService.java | 4 +- .../paste/api/PasteControllerTest.java | 2 +- .../binpastes/paste/domain/PasteTest.java | 8 +-- frontend/pom.xml | 54 +++++++++++-------- 5 files changed, 40 insertions(+), 30 deletions(-) rename backend/src/main/java/com/github/binpastes/paste/{domain => business}/PasteService.java (95%) diff --git a/backend/src/main/java/com/github/binpastes/paste/api/PasteController.java b/backend/src/main/java/com/github/binpastes/paste/api/PasteController.java index 554540b..a9bb305 100644 --- a/backend/src/main/java/com/github/binpastes/paste/api/PasteController.java +++ b/backend/src/main/java/com/github/binpastes/paste/api/PasteController.java @@ -6,7 +6,7 @@ import com.github.binpastes.paste.api.model.SearchView.SearchItemView; import com.github.binpastes.paste.api.model.SingleView; import com.github.binpastes.paste.domain.Paste; -import com.github.binpastes.paste.domain.PasteService; +import com.github.binpastes.paste.business.PasteService; import jakarta.validation.ConstraintViolationException; import jakarta.validation.Valid; import jakarta.validation.constraints.NotBlank; diff --git a/backend/src/main/java/com/github/binpastes/paste/domain/PasteService.java b/backend/src/main/java/com/github/binpastes/paste/business/PasteService.java similarity index 95% rename from backend/src/main/java/com/github/binpastes/paste/domain/PasteService.java rename to backend/src/main/java/com/github/binpastes/paste/business/PasteService.java index 7ac8789..9c0468a 100644 --- a/backend/src/main/java/com/github/binpastes/paste/domain/PasteService.java +++ b/backend/src/main/java/com/github/binpastes/paste/business/PasteService.java @@ -1,6 +1,8 @@ -package com.github.binpastes.paste.domain; +package com.github.binpastes.paste.business; import com.github.binpastes.paste.business.tracking.TrackingService; +import com.github.binpastes.paste.domain.Paste; +import com.github.binpastes.paste.domain.PasteRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; diff --git a/backend/src/test/java/com/github/binpastes/paste/api/PasteControllerTest.java b/backend/src/test/java/com/github/binpastes/paste/api/PasteControllerTest.java index e7c585a..a752f52 100644 --- a/backend/src/test/java/com/github/binpastes/paste/api/PasteControllerTest.java +++ b/backend/src/test/java/com/github/binpastes/paste/api/PasteControllerTest.java @@ -1,6 +1,6 @@ package com.github.binpastes.paste.api; -import com.github.binpastes.paste.domain.PasteService; +import com.github.binpastes.paste.business.PasteService; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/backend/src/test/java/com/github/binpastes/paste/domain/PasteTest.java b/backend/src/test/java/com/github/binpastes/paste/domain/PasteTest.java index 51da4c1..cc7e81f 100644 --- a/backend/src/test/java/com/github/binpastes/paste/domain/PasteTest.java +++ b/backend/src/test/java/com/github/binpastes/paste/domain/PasteTest.java @@ -58,13 +58,13 @@ void trackPasteViewCount() { @DisplayName("track paste - updates lastViewed timestamp to most recent one") void trackPasteLastViewed() { var newPaste = Paste.newInstance(null, "someContent", null, false, PasteExposure.PUBLIC, null); - var now = LocalDateTime.now(); - var yesterday = now.minusDays(1); + var today = LocalDateTime.now(); + var yesterday = today.minusDays(1); - newPaste.trackView(now); + newPaste.trackView(today); newPaste.trackView(yesterday); - assertThat(newPaste.getLastViewed()).isEqualTo(now); + assertThat(newPaste.getLastViewed()).isEqualTo(today); assertThat(newPaste.getViews()).isEqualTo(2); } diff --git a/frontend/pom.xml b/frontend/pom.xml index b7423ba..64519e4 100644 --- a/frontend/pom.xml +++ b/frontend/pom.xml @@ -49,21 +49,28 @@ - org.apache.maven.plugins - maven-surefire-plugin + maven-resources-plugin - default-test + generate-resources + + resources + + + + + dist + + + ${project.build.outputDirectory}/static + + + + default-resources none - - - - org.apache.maven.plugins - maven-failsafe-plugin - - default-test + default-testResources none @@ -83,21 +90,22 @@ - maven-resources-plugin + org.apache.maven.plugins + maven-surefire-plugin - generate-resources - - resources - - - - - dist - - - ${project.build.outputDirectory}/static - + default-test + none + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + default + none