Skip to content

Commit

Permalink
Merge pull request #13 from ucsb-cs156-f24/pc-spring-boot-3-final-ver…
Browse files Browse the repository at this point in the history
…sion

Pc spring boot 3 final version
  • Loading branch information
pconrad authored May 21, 2024
2 parents 343255e + 21e51b9 commit 42db6ff
Show file tree
Hide file tree
Showing 19 changed files with 195 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/13-backend-incremental-pitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Build with Maven
run: mvn -B test
- name: Pitest
run: mvn test org.pitest:pitest-maven:mutationCoverage -DmutationThreshold=100
run: mvn pitest:mutationCoverage -DmutationThreshold=100
- name: Upload Pitest History to Artifacts
if: always() # always upload artifacts, even if tests fail
uses: actions/upload-artifact@v3.1.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/14-backend-pitest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
# main branch changes

- name: Pitest
run: mvn test org.pitest:pitest-maven:mutationCoverage -DmutationThreshold=100
run: mvn pitest:mutationCoverage -DmutationThreshold=100
- name: Upload Pitest History to Artifacts
if: always() # always upload artifacts, even if tests fail
uses: actions/upload-artifact@v3.1.2
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ INTEGRATION=true HEADLESS=false mvn test-compile failsafe:integration-test
To run a particular integration test (e.g. only `HomePageWebIT.java`) use `-Dit.test=ClassName`, for example:

```
INTEGRATION=true mvn test-compile failsafe:integration-test -Dit.test=HomePageWebIt
INTEGRATION=true mvn test-compile failsafe:integration-test -Dit.test=HomePageWebIT
```

or to see it run live:
```
INTEGRATION=true HEADLESS=false mvn test-compile failsafe:integration-test -Dit.test=HomePageWebIt
INTEGRATION=true HEADLESS=false mvn test-compile failsafe:integration-test -Dit.test=HomePageWebIT
```

Integration tests are any methods labelled with `@Test` annotation, that are under the `/src/test/java` hierarchy, and have names starting with `IT` (specifically capital I, capital T).
Expand All @@ -181,5 +181,4 @@ Unless you want a particular integration test to *also* be run when you type `mv

Note that while `mvn test` is typically sufficient to run tests, we have found that if you haven't compiled the test code yet, running `mvn failsafe:integration-test` may not actually run any of the tests.

To run a single integration test (e.g. only `HomePageWebIT.java`) use `-Dit.test=ClassName`, for example:

63 changes: 35 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.3</version>
<version>3.1.1</version>
</parent>

<!-- (2) <groupId/> -->
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-mvc</artifactId>
<version>3.0.1</version>
<version>4.1.3</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -135,11 +135,12 @@
<version>2.0.1.Final</version>
</dependency>

<!-- Spring Doc for Spring Boot 3 https://springdoc.org/ -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.7.0</version>
</dependency>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.5.0</version>
</dependency>

</dependencies>

Expand All @@ -157,7 +158,8 @@
<version>3.0.0-M5</version>
<configuration>
<!-- Activate the use of TCP to transmit events to the plugin -->
<forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
<forkNode
implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory" />
</configuration>
</plugin>

Expand Down Expand Up @@ -198,6 +200,7 @@
<exclude>**/${app.packagePath}/controllers/FrontendController.*</exclude>
<exclude>**/${app.packagePath}/controllers/FrontendProxyController.*</exclude>
<exclude>**/${app.packagePath}/services/CurrentUserServiceImpl.*</exclude>
<exclude>**/${app.packagePath}/services/GrantedAuthoritiesService.*</exclude>
<exclude>**/${app.packagePath}/ExampleApplication.*</exclude>
<exclude>**/edu/ucsb/cs156/example/services/wiremock/*</exclude>
</excludes>
Expand Down Expand Up @@ -286,12 +289,16 @@
<param>${app.package}.services.CurrentUserServiceImpl</param>
<param>${app.package}.ExampleApplication</param>
<param>${app.package}.config.SecurityConfig</param>
<param>${app.package}.config.SpaCsrfTokenRequestHandler</param>
<param>${app.package}.config.CsrfCookieFilter</param>
<param>edu.ucsb.cs156.example.services.wiremock.WiremockService</param>
<param>edu.ucsb.cs156.example.services.wiremock.WiremockServiceDummy</param>
<param>edu.ucsb.cs156.example.services.wiremock.WiremockServiceImpl</param>
<param>${app.package}.services.GrantedAuthoritiesService</param>
</excludedClasses>
<excludedTestClasses>
<param>edu.ucsb.cs156.example.web.*</param>
<param>edu.ucsb.cs156.example.integration.*</param>
</excludedTestClasses>
<outputFormats>
<outputFormat>HTML</outputFormat>
Expand Down Expand Up @@ -377,8 +384,8 @@
<artifactId>frontend-maven-plugin</artifactId>
<version>1.12.1</version>
<configuration>
<workingDirectory>frontend</workingDirectory>
<installDirectory>${project.build.directory}</installDirectory>
<workingDirectory>frontend</workingDirectory>
<installDirectory>${project.build.directory}</installDirectory>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -409,26 +416,26 @@
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<copy todir="${project.build.outputDirectory}/public">
<fileset dir="${project.basedir}/frontend/build" />
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<copy todir="${project.build.outputDirectory}/public">
<fileset dir="${project.basedir}/frontend/build" />
</copy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/edu/ucsb/cs156/example/aop/LoggingAspect.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.ucsb.cs156.example.aop;

import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
Expand All @@ -8,8 +9,6 @@
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Optional;
Expand Down
Loading

0 comments on commit 42db6ff

Please sign in to comment.