-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jspetrak/upgrade_spring6_boot3
Upgrade to Spring Framework 6 and Spring Boot 3
- Loading branch information
Showing
21 changed files
with
269 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Java CI with Maven | ||
|
||
on: | ||
push | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
aspect/src/test/java/io/github/georgwittberger/extendmdc/aspect/ExtendMDCAspectTest.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
aspect/src/test/java/io/github/georgwittberger/extendmdc/aspect/ExtendMDCAspectTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package io.github.georgwittberger.extendmdc.aspect; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.slf4j.MDC; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.context.junit.jupiter.SpringExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNull; | ||
|
||
@ExtendWith(SpringExtension.class) | ||
@SpringBootTest(classes = TestApplication.class) | ||
@Import(TestAspectConfiguration.class) | ||
@ContextConfiguration(classes = TestAspectConfiguration.class) | ||
public class ExtendMDCAspectTests { | ||
@Test | ||
public void testAspectAddsAndRemovesAnnotationDefinedValues(ApplicationContext applicationContext) { | ||
var aspectTestService= applicationContext.getBean(AspectTestService.class); | ||
|
||
assertNull(MDC.get("TestValue1")); | ||
assertNull(MDC.get("TestValue2")); | ||
assertNull(MDC.get("EmptyValue")); | ||
aspectTestService.testAnnotationDefinedValues(); | ||
assertNull(MDC.get("TestValue1")); | ||
assertNull(MDC.get("TestValue2")); | ||
assertNull(MDC.get("EmptyValue")); | ||
} | ||
|
||
@Test | ||
public void testAspectAddsAndRemovesMethodParameters(ApplicationContext applicationContext) { | ||
var aspectTestService= applicationContext.getBean(AspectTestService.class); | ||
|
||
assertNull(MDC.get("ObjectValue")); | ||
assertNull(MDC.get("StringValue")); | ||
assertNull(MDC.get("IntegerValue")); | ||
assertNull(MDC.get("LongValue")); | ||
assertNull(MDC.get("FloatValue")); | ||
assertNull(MDC.get("DoubleValue")); | ||
assertNull(MDC.get("BooleanValue")); | ||
aspectTestService.testMethodParameters(new Object(), "Test String", 1, 2L, 3.1F, 4.2, true, "Ignored String"); | ||
assertNull(MDC.get("ObjectValue")); | ||
assertNull(MDC.get("StringValue")); | ||
assertNull(MDC.get("IntegerValue")); | ||
assertNull(MDC.get("LongValue")); | ||
assertNull(MDC.get("FloatValue")); | ||
assertNull(MDC.get("DoubleValue")); | ||
assertNull(MDC.get("BooleanValue")); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
aspect/src/test/java/io/github/georgwittberger/extendmdc/aspect/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.github.georgwittberger.extendmdc.aspect; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
@SpringBootApplication | ||
@EnableAspectJAutoProxy | ||
public class TestApplication { | ||
public static void main(String[] args) { | ||
SpringApplication.run(TestApplication.class, args); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
aspect/src/test/java/io/github/georgwittberger/extendmdc/aspect/TestAspectConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.georgwittberger.extendmdc.aspect; | ||
|
||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Aspect | ||
@Configuration | ||
public class TestAspectConfiguration { | ||
@Bean | ||
public ExtendMDCAspect extendMDCAspect() { | ||
return new ExtendMDCAspect(); | ||
} | ||
|
||
@Bean | ||
public AspectTestService aspectTestService() { return new AspectTestService(); } | ||
} |
Oops, something went wrong.