Skip to content

Commit

Permalink
skip unnecessary build steps in frontend pom.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
querwurzel committed Nov 24, 2023
1 parent 79d9f69 commit 4f14706
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
54 changes: 31 additions & 23 deletions frontend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,28 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
</execution>
<execution>
<id>default-resources</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<id>default-testResources</id>
<phase>none</phase>
</execution>
</executions>
Expand All @@ -83,21 +90,22 @@
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>dist</directory>
</resource>
</resources>
<outputDirectory>${project.build.outputDirectory}/static</outputDirectory>
</configuration>
<id>default-test</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>default</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit 4f14706

Please sign in to comment.