Upgrades spring to 3.4.0 (#2154)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-12-20 11:30:51 +02:00
committed by GitHub
parent 65ef31e702
commit c38f28d5a7
22 changed files with 109 additions and 96 deletions

View File

@@ -13,6 +13,7 @@ import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.equalTo;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import lombok.SneakyThrows;
import org.eclipse.hawkbit.mgmt.json.model.distributionset.MgmtActionType;
import org.eclipse.hawkbit.repository.jpa.Jpa;
import org.eclipse.hawkbit.repository.jpa.RepositoryApplicationConfiguration;
@@ -184,6 +185,7 @@ public abstract class AbstractManagementApiIntegrationTest extends AbstractRestI
return mvcResult -> jsonPath("_links.self.href", equalTo(link)).match(mvcResult);
}
@SneakyThrows
protected static JSONObject getAssignmentObject(final Object id, final MgmtActionType type) {
final JSONObject obj = new JSONObject();
obj.put("id", id);
@@ -191,6 +193,7 @@ public abstract class AbstractManagementApiIntegrationTest extends AbstractRestI
return obj;
}
@SneakyThrows
protected static JSONObject getAssignmentObject(final Object id, final MgmtActionType type, final int weight) {
return getAssignmentObject(id, type).put("weight", weight);
}

View File

@@ -15,6 +15,8 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.util.Base64;
import io.qameta.allure.Description;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;
@@ -46,7 +48,6 @@ import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.DefaultMockMvcBuilder;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.util.Base64Utils;
import org.springframework.web.context.WebApplicationContext;
/**
@@ -105,7 +106,7 @@ public class MgmtBasicAuthResourceTest {
}
private String getBasicAuth(final String username, final String password) {
return "Basic " + Base64Utils.encodeToString((username + ":" + password).getBytes());
return "Basic " + Base64.getEncoder().encodeToString((username + ":" + password).getBytes());
}
private MockMvc withSecurityMock() throws Exception {