diff --git a/build.gradle b/build.gradle index 7f6cbbbd..aaad2d63 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { - springBootVersion = '3.3.5' - springVersion = '6.1.12' + springBootVersion = '3.4.0' + springVersion = '6.2.1' tomcatVersion = '10.1.34' seleniumVersion = '4.27.0' jacksonVersion = '2.18.2' diff --git a/web/build.gradle b/web/build.gradle index 1b39cd48..e24a4965 100644 --- a/web/build.gradle +++ b/web/build.gradle @@ -7,7 +7,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") implementation 'org.yaml:snakeyaml:2.3' implementation("org.springframework.boot:spring-boot-starter-thymeleaf:${springBootVersion}") - implementation("de.otto.edison:edison-core:3.3.3") + implementation("de.otto.edison:edison-core:3.4.0") //Update hibernate validator that comes with edison-core implementation("org.hibernate.validator:hibernate-validator:8.0.2.Final") @@ -26,8 +26,6 @@ dependencies { testImplementation("org.awaitility:awaitility:4.2.2") annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}" - - } configurations { diff --git a/web/src/test/java/de/otto/jlineup/web/ReportControllerTest.java b/web/src/test/java/de/otto/jlineup/web/ReportControllerTest.java index bcfb4d4d..c2ed5880 100644 --- a/web/src/test/java/de/otto/jlineup/web/ReportControllerTest.java +++ b/web/src/test/java/de/otto/jlineup/web/ReportControllerTest.java @@ -10,9 +10,9 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; @@ -38,7 +38,7 @@ @WebAppConfiguration public class ReportControllerTest { - @MockBean + @MockitoBean private JLineupService jLineupService; @Autowired @@ -47,7 +47,7 @@ public class ReportControllerTest { private MockMvc mockMvc; @Before - public void setupMockMvc(){ + public void setupMockMvc() { initMocks(this); @@ -102,11 +102,10 @@ public void shouldGetReportsPageWithOrderedReports() throws Exception { )); - //when ModelAndView modelAndView = mockMvc.perform(get("/jlineup-ctxpath/internal/reports").contextPath("/jlineup-ctxpath").accept(MediaType.TEXT_HTML)) - //then + //then .andExpect(status().isOk()) .andExpect(view().name("reports")) .andExpect(model().attributeExists("reportList")) @@ -126,7 +125,7 @@ public void shouldGetReportsPageWithOrderedReports() throws Exception { .andReturn().getModelAndView(); @SuppressWarnings("unchecked") - List reportList = (List)modelAndView.getModelMap().get("reportList"); + List reportList = (List) modelAndView.getModelMap().get("reportList"); assertThat(reportList.get(0).getId(), is("someId")); assertThat(reportList.get(0).getName(), is("someName")); diff --git a/web/src/test/java/de/otto/jlineup/web/configuration/JLineupTestConfiguration.java b/web/src/test/java/de/otto/jlineup/web/configuration/JLineupTestConfiguration.java new file mode 100644 index 00000000..bdc93389 --- /dev/null +++ b/web/src/test/java/de/otto/jlineup/web/configuration/JLineupTestConfiguration.java @@ -0,0 +1,11 @@ +package de.otto.jlineup.web.configuration; + +import de.otto.jlineup.service.JLineupService; +import org.mockito.Mock; + +public class JLineupTestConfiguration { + + @Mock + public JLineupService jLineupService; + +}