diff --git a/src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java b/src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java index ecade7c..de4fd16 100644 --- a/src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java +++ b/src/main/java/de/felixroske/jfxsupport/AbstractFxmlView.java @@ -354,15 +354,15 @@ private String getConventionalName() { * @return the bundle name */ private String getBundleName() { - if (!StringUtils.isEmpty(annotation)) { - final String lbundle = annotation.bundle(); - LOGGER.debug("Annotated bundle: {}", lbundle); - return lbundle; - } else { + if (StringUtils.isEmpty(annotation.bundle())) { final String lbundle = getClass().getPackage().getName() + "." + getConventionalName(); LOGGER.debug("Bundle: {} based on conventional name.", lbundle); return lbundle; } + + final String lbundle = annotation.bundle(); + LOGGER.debug("Annotated bundle: {}", lbundle); + return lbundle; } /** diff --git a/src/test/java/jfxtest/annotated/AnnotatedUnconventionalName.java b/src/test/java/jfxtest/annotated/AnnotatedUnconventionalNameTest.java similarity index 80% rename from src/test/java/jfxtest/annotated/AnnotatedUnconventionalName.java rename to src/test/java/jfxtest/annotated/AnnotatedUnconventionalNameTest.java index f0faed2..b38a8ab 100644 --- a/src/test/java/jfxtest/annotated/AnnotatedUnconventionalName.java +++ b/src/test/java/jfxtest/annotated/AnnotatedUnconventionalNameTest.java @@ -15,7 +15,7 @@ import javafx.scene.control.Button; @RunWith(SpringRunner.class) @SpringBootTest -public class AnnotatedUnconventionalName extends GuiTest { +public class AnnotatedUnconventionalNameTest extends GuiTest { @Autowired private Annotated buttonsView; @@ -25,12 +25,13 @@ public void constructView() throws Exception { init(buttonsView); } - @Test - /* + /* * Asserts that we can find a view if the class name doesn't end with 'view' + * see https://github.com/roskenet/springboot-javafx-support/issues/38 */ + @Test public void showsI18nText() throws Exception { Button theButton = (Button) find("#theButton"); - assertThat(theButton.getText(), is("The Button Text")); + assertThat(theButton.getText(), is("The default Button Text")); } } diff --git a/src/test/resources/jfxtest/annotated/annotated.fxml b/src/test/resources/jfxtest/annotated/annotated.fxml index d99a68c..4d83f27 100644 --- a/src/test/resources/jfxtest/annotated/annotated.fxml +++ b/src/test/resources/jfxtest/annotated/annotated.fxml @@ -5,6 +5,6 @@ -