-
Notifications
You must be signed in to change notification settings - Fork 6
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 #4 from yoep/bugfix/spring-boot-3-autoconfiguration
Bugfix spring boot 3 autoconfiguration
- Loading branch information
Showing
7 changed files
with
101 additions
and
2 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,31 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
inputs: {} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'adopt' | ||
java-version: 17 | ||
cache: 'maven' | ||
- name: Maven test | ||
run: | | ||
mvn -B test |
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 was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...esources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
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 @@ | ||
com.github.spring.boot.javafx.JavaFxAutoConfiguration |
28 changes: 28 additions & 0 deletions
28
src/test/java/com/github/spring/boot/javafx/JavaFxAutoConfigurationTest.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,28 @@ | ||
package com.github.spring.boot.javafx; | ||
|
||
import com.github.spring.boot.javafx.view.ViewLoader; | ||
import com.github.spring.boot.javafx.view.ViewManager; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
@SpringBootTest( | ||
classes = { | ||
JavaFxAutoConfiguration.class, | ||
TestConfiguration.class | ||
} | ||
) | ||
class JavaFxAutoConfigurationTest { | ||
@Autowired | ||
private ViewManager viewManager; | ||
@Autowired | ||
private ViewLoader viewLoader; | ||
|
||
@Test | ||
void testAutoConfiguration() { | ||
assertNotNull(viewManager, "expected a view manager to have been created"); | ||
assertNotNull(viewLoader, "expected a view loader to have been created"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/test/java/com/github/spring/boot/javafx/TestConfiguration.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 com.github.spring.boot.javafx; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.support.ResourceBundleMessageSource; | ||
|
||
@Configuration | ||
public class TestConfiguration { | ||
@Bean | ||
public ResourceBundleMessageSource resourceBundleMessageSource() { | ||
return new ResourceBundleMessageSource(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/test/java/com/github/spring/boot/javafx/font/FontRegistryImplTest.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,23 @@ | ||
package com.github.spring.boot.javafx.font; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
class FontRegistryImplTest { | ||
@Test | ||
void testGetInstance() { | ||
var result = FontRegistryImpl.getInstance(); | ||
|
||
assertNotNull(result, "expected a font registry instance to have been returned"); | ||
} | ||
|
||
@Test | ||
void testLoadFont() { | ||
var registry = FontRegistryImpl.getInstance(); | ||
|
||
var font = registry.loadFont("fontawesome-regular.ttf"); | ||
|
||
assertNotNull(font, "expected a font to have been returned"); | ||
} | ||
} |