diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml
new file mode 100644
index 0000000..d6e4b70
--- /dev/null
+++ b/.github/workflows/maven-build.yml
@@ -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
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index ac79e62..1946398 100644
--- a/pom.xml
+++ b/pom.xml
@@ -128,6 +128,11 @@
${testfx.junit.version}
test
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index 885cfd0..0000000
--- a/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,2 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
- com.github.spring.boot.javafx.JavaFxAutoConfiguration
\ No newline at end of file
diff --git a/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 0000000..d6531d3
--- /dev/null
+++ b/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+com.github.spring.boot.javafx.JavaFxAutoConfiguration
\ No newline at end of file
diff --git a/src/test/java/com/github/spring/boot/javafx/JavaFxAutoConfigurationTest.java b/src/test/java/com/github/spring/boot/javafx/JavaFxAutoConfigurationTest.java
new file mode 100644
index 0000000..17210d8
--- /dev/null
+++ b/src/test/java/com/github/spring/boot/javafx/JavaFxAutoConfigurationTest.java
@@ -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");
+ }
+}
\ No newline at end of file
diff --git a/src/test/java/com/github/spring/boot/javafx/TestConfiguration.java b/src/test/java/com/github/spring/boot/javafx/TestConfiguration.java
new file mode 100644
index 0000000..eb0b2b0
--- /dev/null
+++ b/src/test/java/com/github/spring/boot/javafx/TestConfiguration.java
@@ -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();
+ }
+}
diff --git a/src/test/java/com/github/spring/boot/javafx/font/FontRegistryImplTest.java b/src/test/java/com/github/spring/boot/javafx/font/FontRegistryImplTest.java
new file mode 100644
index 0000000..91efcfa
--- /dev/null
+++ b/src/test/java/com/github/spring/boot/javafx/font/FontRegistryImplTest.java
@@ -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");
+ }
+}
\ No newline at end of file