TSK-1772: Upgrade to Spring Boot 2.6.1.

This commit is contained in:
holgerhagen 2021-12-15 08:43:32 +01:00 committed by holgerhagen
parent b35d766d58
commit 5662a6201c
7 changed files with 25 additions and 10 deletions

View File

@ -22,6 +22,7 @@ import java.util.stream.StreamSupport;
import javax.security.auth.Subject;
import org.junit.jupiter.api.DynamicContainer;
import org.junit.jupiter.api.DynamicNode;
import org.junit.jupiter.api.extension.DynamicTestInvocationContext;
import org.junit.jupiter.api.extension.Extension;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ExtensionContext.Namespace;
@ -160,7 +161,10 @@ public class JaasExtension implements InvocationInterceptor, TestTemplateInvocat
}
@Override
public void interceptDynamicTest(Invocation<Void> invocation, ExtensionContext extensionContext) {
public void interceptDynamicTest(
Invocation<Void> invocation,
DynamicTestInvocationContext invocationContext,
ExtensionContext extensionContext) {
ExtensionContext testContext = getParentMethodExtensionContent(extensionContext);
// Check if the test factory provided an access Id for this dynamic test.
WithAccessId o = getMethodLevelStore(testContext).get(ACCESS_IDS_STORE_KEY, WithAccessId.class);

View File

@ -5,6 +5,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static pro.taskana.common.test.rest.RestHelper.TEMPLATE;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.time.Instant;
import java.time.LocalDate;
import java.time.ZoneId;
@ -218,11 +220,12 @@ class TaskHistoryEventControllerIntTest {
// region Get Specific Task History Event
@Test
void should_GenerateSelfLink_When_SpecificTaskHistoryEventIsRequested() {
void should_GenerateSelfLink_When_SpecificTaskHistoryEventIsRequested()
throws UnsupportedEncodingException {
String id = "THI:000000000000000000000000000000000000";
String expectedUrl =
UriComponentsBuilder.fromPath(HistoryRestEndpoints.URL_HISTORY_EVENTS_ID)
.buildAndExpand(id)
.buildAndExpand(URLEncoder.encode(id, "UTF-8"))
.toUriString();
ResponseEntity<TaskHistoryEventPagedRepresentationModel> response =

View File

@ -65,7 +65,7 @@
<!-- spring dependencies -->
<version.javax.annotation-api>1.3.2</version.javax.annotation-api>
<version.spring.core>2.0.0.RELEASE</version.spring.core>
<version.spring.boot>2.5.7</version.spring.boot>
<version.spring.boot>2.6.1</version.spring.boot>
<version.spring.mybatis>2.0.6</version.spring.mybatis>
<!-- wildfly dependencies -->

View File

@ -14,7 +14,7 @@ public final class RestEndpoints {
public static final String URL_CLASSIFICATION_CATEGORIES_BY_TYPES =
API_V1 + "classifications-by-type";
public static final String URL_HISTORY_ENABLED = API_V1 + "history-provider-enabled";
public static final String URL_CUSTOM_ATTRIBUTES = API_V1 + "/config/custom-attributes";
public static final String URL_CUSTOM_ATTRIBUTES = API_V1 + "config/custom-attributes";
// access id endpoints
public static final String URL_ACCESS_ID = API_V1 + "access-ids";

View File

@ -1,5 +1,7 @@
package pro.taskana.common.rest.assembler;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
@ -29,7 +31,11 @@ public interface CollectionRepresentationModelAssembler<
default C addLinksToCollectionModel(C model) {
final UriComponentsBuilder original = ServletUriComponentsBuilder.fromCurrentRequest();
model.add(Link.of(original.toUriString()).withSelfRel());
try {
model.add(Link.of(URLDecoder.decode(original.toUriString(), "UTF-8")).withSelfRel());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("UTF-8 encoding not supported. This is unexpected.");
}
return model;
}
}

View File

@ -52,7 +52,7 @@ class UserInfoRefreshJobIntTest {
List<User> ldapusers = ldapClient.searchUsersInUserRole();
assertThat(users).hasSize(6).hasSameSizeAs(ldapusers);
assertThat(users)
.usingElementComparatorIgnoringFields("longName", "data")
.usingRecursiveFieldByFieldElementComparatorIgnoringFields("longName", "data")
.containsExactlyElementsOf(ldapusers);
}
}

View File

@ -4,6 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static pro.taskana.common.test.rest.RestHelper.TEMPLATE;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.time.Instant;
import java.util.Optional;
import org.assertj.core.api.ThrowableAssert.ThrowingCallable;
@ -41,15 +43,15 @@ class WorkbasketControllerIntTest {
}
@Test
void testGetWorkbasket() {
void testGetWorkbasket() throws UnsupportedEncodingException {
final String url =
restHelper.toUrl(
RestEndpoints.URL_WORKBASKET_ID, "WBI:100000000000000000000000000000000006");
RestEndpoints.URL_WORKBASKET_ID, "WBI%3A100000000000000000000000000000000006");
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
ResponseEntity<WorkbasketRepresentationModel> response =
TEMPLATE.exchange(
url,
URLDecoder.decode(url, "UTF-8"),
HttpMethod.GET,
auth,
ParameterizedTypeReference.forType(WorkbasketRepresentationModel.class));