feat(docker): update base images to Java 25, Spring 4, Jackson 3, Gradle 9 and optimize JVM options (Project Lilliput) (#5725)

Co-authored-by: Anthony Stirling <[email protected]>
This commit is contained in:
Balázs Szücs
2026-02-24 20:06:32 +00:00
committed by GitHub
co-authored by Anthony Stirling
parent 24128dd318
commit 1f9b90ad57
112 changed files with 3181 additions and 2102 deletions
@@ -16,8 +16,6 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import com.fasterxml.jackson.databind.ObjectMapper;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.model.enumeration.Role;
import stirling.software.proprietary.config.AuditConfigurationProperties;
@@ -35,6 +33,9 @@ import stirling.software.proprietary.security.service.MfaService;
import stirling.software.proprietary.security.session.SessionPersistentRegistry;
import stirling.software.proprietary.service.UserLicenseSettingsService;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@ExtendWith(MockitoExtension.class)
class ProprietaryUIDataControllerTest {
@@ -63,7 +64,7 @@ class ProprietaryUIDataControllerTest {
applicationProperties.getSecurity().getSaml2().setEnabled(false);
auditConfig = new AuditConfigurationProperties(applicationProperties);
objectMapper = new ObjectMapper();
objectMapper = JsonMapper.builder().build();
controller =
new ProprietaryUIDataController(
@@ -26,8 +26,6 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.fasterxml.jackson.databind.ObjectMapper;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.model.enumeration.Role;
import stirling.software.proprietary.security.model.AuthenticationType;
@@ -42,10 +40,13 @@ import stirling.software.proprietary.security.service.RefreshRateLimitService;
import stirling.software.proprietary.security.service.TotpService;
import stirling.software.proprietary.security.service.UserService;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@ExtendWith(MockitoExtension.class)
class AuthControllerLoginTest {
private final ObjectMapper objectMapper = new ObjectMapper();
private final ObjectMapper objectMapper = JsonMapper.builder().build();
private MockMvc mockMvc;
private ApplicationProperties.Security securityProperties;
@@ -26,8 +26,6 @@ import org.springframework.security.core.Authentication;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.fasterxml.jackson.databind.ObjectMapper;
import stirling.software.proprietary.security.model.AuthenticationType;
import stirling.software.proprietary.security.model.User;
import stirling.software.proprietary.security.service.CustomUserDetailsService;
@@ -37,12 +35,15 @@ import stirling.software.proprietary.security.service.MfaService;
import stirling.software.proprietary.security.service.TotpService;
import stirling.software.proprietary.security.service.UserService;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@ExtendWith(MockitoExtension.class)
class AuthControllerMfaTest {
private static final String USERNAME = "[email protected]";
private final ObjectMapper objectMapper = new ObjectMapper();
private final ObjectMapper objectMapper = JsonMapper.builder().build();
private MockMvc mockMvc;
private Authentication authentication;
@@ -19,6 +19,8 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import stirling.software.common.configuration.RuntimePathConfig;
import tools.jackson.databind.json.JsonMapper;
class UIDataTessdataControllerTest {
@Test
@@ -27,7 +29,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn("ignored/path");
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -49,7 +51,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -77,7 +79,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -100,7 +102,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng", "fra");
@@ -139,7 +141,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -164,7 +166,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected boolean isWritableDirectory(Path dir) {
return false;
@@ -186,7 +188,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -217,7 +219,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -258,7 +260,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng", "fra");
@@ -282,7 +284,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -307,7 +309,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -330,7 +332,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(missingDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected List<String> getRemoteTessdataLanguages() {
return List.of("eng");
@@ -352,7 +354,7 @@ class UIDataTessdataControllerTest {
Mockito.when(runtimePathConfig.getTessDataPath()).thenReturn(tempDir.toString());
UIDataTessdataController controller =
new UIDataTessdataController(runtimePathConfig) {
new UIDataTessdataController(runtimePathConfig, JsonMapper.builder().build()) {
@Override
protected boolean isWritableDirectory(Path dir) {
return false;
@@ -21,8 +21,6 @@ import org.springframework.security.core.Authentication;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.fasterxml.jackson.databind.ObjectMapper;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.proprietary.model.Team;
import stirling.software.proprietary.security.database.repository.UserRepository;
@@ -35,10 +33,13 @@ import stirling.software.proprietary.security.service.UserService;
import stirling.software.proprietary.security.session.SessionPersistentRegistry;
import stirling.software.proprietary.service.UserLicenseSettingsService;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@ExtendWith(MockitoExtension.class)
class UserControllerTest {
private final ObjectMapper objectMapper = new ObjectMapper();
private final ObjectMapper objectMapper = JsonMapper.builder().build();
@Mock private UserService userService;
@Mock private SessionPersistentRegistry sessionRegistry;
@@ -36,6 +36,9 @@ import stirling.software.proprietary.security.model.JwtVerificationKey;
import stirling.software.proprietary.security.model.User;
import stirling.software.proprietary.security.model.exception.AuthenticationFailureException;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
@ExtendWith(MockitoExtension.class)
class JwtServiceTest {
@@ -66,7 +69,8 @@ class JwtServiceTest {
testVerificationKey = new JwtVerificationKey("test-key-id", encodedPublicKey);
ApplicationProperties applicationProperties = new ApplicationProperties();
jwtService = new JwtService(true, keystoreService, applicationProperties);
ObjectMapper objectMapper = JsonMapper.builder().build();
jwtService = new JwtService(objectMapper, true, keystoreService, applicationProperties);
}
@Test