From 76336077a2ea5d699c49092baa7fd4c0f3c4ca56 Mon Sep 17 00:00:00 2001 From: Mirco Date: Tue, 9 Jul 2024 09:06:14 +0200 Subject: [PATCH] [skip ci] Fix Test for usage with processTestAot & refactor/linting --- src/test/java/com/ModeratorElection/MainViewTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/ModeratorElection/MainViewTest.java b/src/test/java/com/ModeratorElection/MainViewTest.java index 6cd7b48..c8fcdf6 100644 --- a/src/test/java/com/ModeratorElection/MainViewTest.java +++ b/src/test/java/com/ModeratorElection/MainViewTest.java @@ -5,12 +5,13 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -@SpringBootTest +@SpringBootTest(classes = MainView.class) public class MainViewTest { @Test void mainViewConstructor() { MainView sut = new MainView("Harry,Sven,Ida"); CheckboxGroup cgroupTest = (CheckboxGroup) sut.getChildren().filter(child -> child instanceof CheckboxGroup).findAny().orElse(null); + assert cgroupTest != null; int cgroupTestSelectedItemsSize = cgroupTest.getSelectedItems().size(); Assertions.assertEquals(3,cgroupTestSelectedItemsSize); }