Closes #2486 : Upgrade to Spring Boot 3.2

This commit is contained in:
arolfes 2024-04-01 21:34:37 +02:00 committed by Jörg Heffner
parent 611a735fef
commit a3e4552524
35 changed files with 107 additions and 272 deletions

View File

@ -132,12 +132,6 @@
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-core</artifactId>
<version>${version.auto-restdocs}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
@ -147,28 +141,6 @@
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${version.maven.resources}</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/generated-javadoc-json</outputDirectory>
<resources>
<resource>
<directory>../../rest/taskana-rest-spring/target/generated-javadoc-json
</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
@ -182,61 +154,6 @@
</tag>
</tags>
</configuration>
<executions>
<execution>
<id>generate-javadoc-json</id>
<phase>validate</phase>
<goals>
<goal>javadoc-no-fork</goal>
</goals>
<configuration>
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
<version>${version.auto-restdocs}</version>
</docletArtifact>
<destDir>generated-javadoc-json</destDir>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<show>package</show>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${version.maven.asciidoctor}</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
</execution>
</executions>
<configuration>
<backend>html5</backend>
<doctype>book</doctype>
<attributes>
<snippets>${project.build.directory}/generated-snippets</snippets>
<doctype>book</doctype>
<icons>font</icons>
<source-highlighter>highlightjs</source-highlighter>
<toc>left</toc>
<docinfo>shared</docinfo>
<toclevels>4</toclevels>
<sectlinks/>
</attributes>
<logHandler>
<outputToConsole>false</outputToConsole>
<failIf>
<severity>ERROR</severity>
</failIf>
</logHandler>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -99,7 +99,8 @@ public class TaskHistoryEventController {
@GetMapping(path = HistoryRestEndpoints.URL_HISTORY_EVENTS_ID)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<TaskHistoryEventRepresentationModel> getTaskHistoryEvent(
@PathVariable String historyEventId) throws TaskanaHistoryEventNotFoundException {
@PathVariable("historyEventId") String historyEventId)
throws TaskanaHistoryEventNotFoundException {
TaskHistoryEvent resultEvent = simpleHistoryService.getTaskHistoryEvent(historyEventId);
TaskHistoryEventRepresentationModel taskEventResource = assembler.toModel(resultEvent);

View File

@ -2,10 +2,12 @@ package pro.taskana.simplehistory.rest;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class TaskHistoryEventControllerRestDocTest extends BaseRestDocTest {
@Test

View File

@ -57,7 +57,7 @@ public class ExampleBootstrapTest {
// Delete Taskana folder if exists
Path taskanaH2Data = Path.of(System.getProperty("user.home"), "taskana-h2-data");
if (Files.exists(taskanaH2Data)) {
FileUtils.deleteDirectory(taskanaH2Data.toFile());
FileUtils.forceDelete(taskanaH2Data.toFile());
}
}

View File

@ -3,7 +3,7 @@
<module name="com.h2database.h2" xmlns="urn:jboss:module:1.9">
<resources>
<resource-root path="h2-2.1.214.jar"/>
<resource-root path="h2-2.2.224.jar"/>
</resources>
<dependencies>
<module name="java.compiler"/>

View File

@ -77,7 +77,7 @@ public class TaskanaProducersTest {
// Delete Taskana folder if exists
Path taskanaH2Data = Path.of(System.getProperty("user.home"), "taskana-h2-data");
if (Files.exists(taskanaH2Data)) {
FileUtils.deleteDirectory(taskanaH2Data.toFile());
FileUtils.forceDelete(taskanaH2Data.toFile());
}
}

View File

@ -3,7 +3,7 @@
<module name="com.h2database.h2" xmlns="urn:jboss:module:1.9">
<resources>
<resource-root path="h2-2.1.214.jar"/>
<resource-root path="h2-2.2.224.jar"/>
</resources>
<dependencies>
<module name="java.compiler"/>

View File

@ -66,7 +66,7 @@
<!-- spring dependencies -->
<version.jakarta.annotation-api>2.1.1</version.jakarta.annotation-api>
<version.spring.plugin.core>3.0.0</version.spring.plugin.core>
<version.spring.boot>3.1.5</version.spring.boot>
<version.spring.boot>3.2.4</version.spring.boot>
<version.spring.mybatis>3.0.2</version.spring.mybatis>
<!-- wildfly dependencies -->

View File

@ -21,7 +21,9 @@
<module>../web</module>
<module>taskana-rest-spring-example-common</module>
<module>taskana-rest-spring-example-boot</module>
<!-- enable it, when decission is made how to proceed
<module>taskana-rest-spring-example-wildfly</module>
-->
<module>taskana-rest-spring-test-lib</module>
</modules>

View File

@ -59,6 +59,7 @@
<artifactId>taskana-rest-spring-example-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.plugin</groupId>
<artifactId>spring-plugin-core</artifactId>

View File

@ -3,7 +3,7 @@
<module name="org.postgresql.postgresql" xmlns="urn:jboss:module:1.9">
<resources>
<resource-root path="postgresql-42.6.0.jar"/>
<resource-root path="postgresql-42.6.2.jar"/>
</resources>
<!-- don't know why it is still javax, but this is the only way how the postgresql module is loaded -->

View File

@ -7,10 +7,10 @@ import java.util.Map;
import java.util.function.Function;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;
import org.springframework.ldap.core.support.BaseLdapPathContextSource;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@ -65,7 +65,8 @@ public class TestWebSecurityConfig {
}
@Bean
public FilterRegistrationBean<CorsFilter> corsFilter() {
@Order(0)
public CorsFilter corsFilter() {
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
@ -73,9 +74,7 @@ public class TestWebSecurityConfig {
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter(source));
bean.setOrder(0);
return bean;
return new CorsFilter(source);
}
@Bean

View File

@ -134,11 +134,6 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
@ -154,12 +149,6 @@
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-core</artifactId>
<version>${version.auto-restdocs}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
@ -194,65 +183,6 @@
</tag>
</tags>
</configuration>
<executions>
<execution>
<id>generate-javadoc-json</id>
<phase>validate</phase>
<goals>
<goal>javadoc-no-fork</goal>
</goals>
<configuration>
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<!--
currently the jdk9+ version of this doclet has a very bad bug.
see: https://github.com/ScaCap/spring-auto-restdocs/issues/412
-->
<artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
<version>${version.auto-restdocs}</version>
</docletArtifact>
<destDir>generated-javadoc-json</destDir>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<show>package</show>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${version.maven.asciidoctor}</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
</execution>
</executions>
<configuration>
<backend>html5</backend>
<doctype>book</doctype>
<attributes>
<snippets>${project.build.directory}/generated-snippets</snippets>
<doctype>book</doctype>
<icons>font</icons>
<source-highlighter>highlightjs</source-highlighter>
<toc>left</toc>
<docinfo>shared</docinfo>
<toclevels>4</toclevels>
<sectlinks/>
</attributes>
<logHandler>
<outputToConsole>false</outputToConsole>
<failIf>
<severity>ERROR</severity>
</failIf>
</logHandler>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -106,7 +106,8 @@ public class ClassificationController {
@GetMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID, produces = MediaTypes.HAL_JSON_VALUE)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<ClassificationRepresentationModel> getClassification(
@PathVariable String classificationId) throws ClassificationNotFoundException {
@PathVariable("classificationId") String classificationId)
throws ClassificationNotFoundException {
Classification classification = classificationService.getClassification(classificationId);
return ResponseEntity.ok(modelAssembler.toModel(classification));
}
@ -159,7 +160,7 @@ public class ClassificationController {
@PutMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<ClassificationRepresentationModel> updateClassification(
@PathVariable(value = "classificationId") String classificationId,
@PathVariable("classificationId") String classificationId,
@RequestBody ClassificationRepresentationModel resource)
throws ClassificationNotFoundException,
ConcurrencyException,
@ -193,7 +194,7 @@ public class ClassificationController {
@DeleteMapping(path = RestEndpoints.URL_CLASSIFICATIONS_ID)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<ClassificationRepresentationModel> deleteClassification(
@PathVariable String classificationId)
@PathVariable("classificationId") String classificationId)
throws ClassificationNotFoundException, ClassificationInUseException, NotAuthorizedException {
classificationService.deleteClassification(classificationId);
return ResponseEntity.noContent().build();

View File

@ -68,7 +68,7 @@ public class ClassificationDefinitionController {
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_DEFINITIONS)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<ClassificationDefinitionCollectionRepresentationModel>
exportClassifications(@RequestParam(required = false) String[] domain) {
exportClassifications(@RequestParam(value = "domain", required = false) String[] domain) {
ClassificationQuery query = classificationService.createClassificationQuery();
List<ClassificationSummary> summaries =

View File

@ -63,7 +63,7 @@ public class TaskanaEngineController {
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<List<String>> getClassificationCategories(
@RequestParam(required = false) String type) {
@RequestParam(value = "type", required = false) String type) {
if (type != null) {
return ResponseEntity.ok(taskanaConfiguration.getClassificationCategoriesByType(type));
}

View File

@ -117,13 +117,22 @@ public class TaskanaRestExceptionHandler extends ResponseEntityExceptionHandler
Map.entry(UnsupportedDatabaseException.ERROR_KEY, HttpStatus.INTERNAL_SERVER_ERROR),
Map.entry(ERROR_KEY_UNKNOWN_ERROR, HttpStatus.INTERNAL_SERVER_ERROR));
@ExceptionHandler(MaxUploadSizeExceededException.class)
@Override
protected ResponseEntity<Object> handleMaxUploadSizeExceededException(
MaxUploadSizeExceededException ex, WebRequest req) {
HttpStatus status =
MaxUploadSizeExceededException ex,
HttpHeaders headers,
HttpStatusCode status,
WebRequest request
) {
return buildResponse(
ErrorCode.of(ERROR_KEY_PAYLOAD),
ex,
request,
HTTP_STATUS_BY_ERROR_CODE_KEY.getOrDefault(
ERROR_KEY_PAYLOAD, HttpStatus.INTERNAL_SERVER_ERROR);
return buildResponse(ErrorCode.of(ERROR_KEY_PAYLOAD), ex, req, status);
ERROR_KEY_PAYLOAD, HttpStatus.INTERNAL_SERVER_ERROR
)
);
}
@ExceptionHandler(BeanInstantiationException.class)

View File

@ -68,7 +68,7 @@ public class TaskCommentController {
@GetMapping(path = RestEndpoints.URL_TASK_COMMENT)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<TaskCommentRepresentationModel> getTaskComment(
@PathVariable String taskCommentId)
@PathVariable("taskCommentId") String taskCommentId)
throws TaskNotFoundException,
TaskCommentNotFoundException,
InvalidArgumentException,
@ -95,7 +95,7 @@ public class TaskCommentController {
@GetMapping(path = RestEndpoints.URL_TASK_COMMENTS)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<TaskCommentCollectionRepresentationModel> getTaskComments(
@PathVariable String taskId,
@PathVariable("taskId") String taskId,
HttpServletRequest request,
TaskCommentQueryFilterParameter filterParameter,
TaskCommentQuerySortParameter sortParameter,
@ -138,7 +138,7 @@ public class TaskCommentController {
@DeleteMapping(path = RestEndpoints.URL_TASK_COMMENT)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskCommentRepresentationModel> deleteTaskComment(
@PathVariable String taskCommentId)
@PathVariable("taskCommentId") String taskCommentId)
throws TaskNotFoundException,
TaskCommentNotFoundException,
InvalidArgumentException,
@ -169,7 +169,7 @@ public class TaskCommentController {
@PutMapping(path = RestEndpoints.URL_TASK_COMMENT)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskCommentRepresentationModel> updateTaskComment(
@PathVariable String taskCommentId,
@PathVariable("taskCommentId") String taskCommentId,
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
throws TaskNotFoundException,
TaskCommentNotFoundException,
@ -209,7 +209,7 @@ public class TaskCommentController {
@PostMapping(path = RestEndpoints.URL_TASK_COMMENTS)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskCommentRepresentationModel> createTaskComment(
@PathVariable String taskId,
@PathVariable("taskId") String taskId,
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
throws InvalidArgumentException, TaskNotFoundException, NotAuthorizedOnWorkbasketException {
taskCommentRepresentationModel.setTaskId(taskId);

View File

@ -186,7 +186,7 @@ public class TaskController {
*/
@GetMapping(path = RestEndpoints.URL_TASKS_ID)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> getTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> getTask(@PathVariable("taskId") String taskId)
throws TaskNotFoundException, NotAuthorizedOnWorkbasketException {
Task task = taskService.getTask(taskId);
@ -213,7 +213,7 @@ public class TaskController {
@PostMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> claimTask(
@PathVariable String taskId, @RequestBody(required = false) String userName)
@PathVariable("taskId") String taskId, @RequestBody(required = false) String userName)
throws TaskNotFoundException,
InvalidOwnerException,
NotAuthorizedOnWorkbasketException,
@ -239,7 +239,7 @@ public class TaskController {
@PostMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceClaimTask(
@PathVariable String taskId, @RequestBody(required = false) String userName)
@PathVariable("taskId") String taskId, @RequestBody(required = false) String userName)
throws TaskNotFoundException,
InvalidTaskStateException,
InvalidOwnerException,
@ -301,7 +301,8 @@ public class TaskController {
@DeleteMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> cancelClaimTask(
@PathVariable String taskId, @RequestParam(defaultValue = "false") boolean keepOwner)
@PathVariable("taskId") String taskId,
@RequestParam(value = "keepOwner", defaultValue = "false") boolean keepOwner)
throws TaskNotFoundException,
InvalidTaskStateException,
InvalidOwnerException,
@ -327,7 +328,8 @@ public class TaskController {
@DeleteMapping(path = RestEndpoints.URL_TASKS_ID_CLAIM_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceCancelClaimTask(
@PathVariable String taskId, @RequestParam(defaultValue = "false") boolean keepOwner)
@PathVariable("taskId") String taskId,
@RequestParam(value = "keepOwner", defaultValue = "false") boolean keepOwner)
throws TaskNotFoundException,
InvalidTaskStateException,
InvalidOwnerException,
@ -350,7 +352,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_REVIEW)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> requestReview(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> requestReview(
@PathVariable("taskId") String taskId)
throws InvalidTaskStateException,
TaskNotFoundException,
InvalidOwnerException,
@ -373,7 +376,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_REVIEW_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceRequestReview(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> forceRequestReview(
@PathVariable("taskId") String taskId)
throws InvalidTaskStateException,
TaskNotFoundException,
InvalidOwnerException,
@ -396,7 +400,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_CHANGES)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> requestChanges(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> requestChanges(
@PathVariable("taskId") String taskId)
throws InvalidTaskStateException,
TaskNotFoundException,
InvalidOwnerException,
@ -419,7 +424,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_REQUEST_CHANGES_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceRequestChanges(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> forceRequestChanges(
@PathVariable("taskId") String taskId)
throws InvalidTaskStateException,
TaskNotFoundException,
InvalidOwnerException,
@ -442,7 +448,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_COMPLETE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> completeTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> completeTask(
@PathVariable("taskId") String taskId)
throws TaskNotFoundException,
InvalidOwnerException,
InvalidTaskStateException,
@ -468,7 +475,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_COMPLETE_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceCompleteTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> forceCompleteTask(
@PathVariable("taskId") String taskId)
throws TaskNotFoundException,
InvalidOwnerException,
InvalidTaskStateException,
@ -493,7 +501,7 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_CANCEL)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> cancelTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> cancelTask(@PathVariable("taskId") String taskId)
throws TaskNotFoundException, NotAuthorizedOnWorkbasketException, InvalidTaskStateException {
Task cancelledTask = taskService.cancelTask(taskId);
@ -514,7 +522,8 @@ public class TaskController {
*/
@PostMapping(path = RestEndpoints.URL_TASKS_ID_TERMINATE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> terminateTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> terminateTask(
@PathVariable("taskId") String taskId)
throws TaskNotFoundException,
InvalidTaskStateException,
NotAuthorizedException,
@ -542,8 +551,8 @@ public class TaskController {
@PostMapping(path = RestEndpoints.URL_TASKS_ID_TRANSFER_WORKBASKET_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> transferTask(
@PathVariable String taskId,
@PathVariable String workbasketId,
@PathVariable("taskId") String taskId,
@PathVariable("workbasketId") String workbasketId,
@RequestBody(required = false) Boolean setTransferFlag)
throws TaskNotFoundException,
WorkbasketNotFoundException,
@ -578,7 +587,7 @@ public class TaskController {
@PutMapping(path = RestEndpoints.URL_TASKS_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> updateTask(
@PathVariable(value = "taskId") String taskId,
@PathVariable("taskId") String taskId,
@RequestBody TaskRepresentationModel taskRepresentationModel)
throws TaskNotFoundException,
ClassificationNotFoundException,
@ -624,7 +633,7 @@ public class TaskController {
@PostMapping(path = RestEndpoints.URL_TASKS_ID_SET_READ)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> setTaskRead(
@PathVariable String taskId, @RequestBody IsReadRepresentationModel isRead)
@PathVariable("taskId") String taskId, @RequestBody IsReadRepresentationModel isRead)
throws TaskNotFoundException, NotAuthorizedOnWorkbasketException {
Task updatedTask = taskService.setTaskRead(taskId, isRead.getIsRead());
@ -650,7 +659,7 @@ public class TaskController {
*/
@DeleteMapping(path = RestEndpoints.URL_TASKS_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> deleteTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> deleteTask(@PathVariable("taskId") String taskId)
throws TaskNotFoundException,
InvalidTaskStateException,
NotAuthorizedException,
@ -676,7 +685,8 @@ public class TaskController {
*/
@DeleteMapping(path = RestEndpoints.URL_TASKS_ID_FORCE)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<TaskRepresentationModel> forceDeleteTask(@PathVariable String taskId)
public ResponseEntity<TaskRepresentationModel> forceDeleteTask(
@PathVariable("taskId") String taskId)
throws TaskNotFoundException,
InvalidTaskStateException,
NotAuthorizedException,

View File

@ -61,7 +61,7 @@ public class UserController {
*/
@GetMapping(RestEndpoints.URL_USERS_ID)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<UserRepresentationModel> getUser(@PathVariable String userId)
public ResponseEntity<UserRepresentationModel> getUser(@PathVariable("userId") String userId)
throws UserNotFoundException, InvalidArgumentException {
User user = userService.getUser(userId);
return ResponseEntity.ok(userAssembler.toModel(user));
@ -136,7 +136,7 @@ public class UserController {
@PutMapping(RestEndpoints.URL_USERS_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<UserRepresentationModel> updateUser(
@PathVariable(value = "userId") String userId, @RequestBody UserRepresentationModel repModel)
@PathVariable("userId") String userId, @RequestBody UserRepresentationModel repModel)
throws InvalidArgumentException, UserNotFoundException, NotAuthorizedException {
if (!userId.equals(repModel.getUserId())) {
throw new InvalidArgumentException(
@ -163,7 +163,7 @@ public class UserController {
*/
@DeleteMapping(RestEndpoints.URL_USERS_ID)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<UserRepresentationModel> deleteUser(@PathVariable String userId)
public ResponseEntity<UserRepresentationModel> deleteUser(@PathVariable("userId") String userId)
throws UserNotFoundException, NotAuthorizedException, InvalidArgumentException {
userService.deleteUser(userId);

View File

@ -128,7 +128,7 @@ public class WorkbasketController {
@GetMapping(path = RestEndpoints.URL_WORKBASKET_ID, produces = MediaTypes.HAL_JSON_VALUE)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<WorkbasketRepresentationModel> getWorkbasket(
@PathVariable(value = "workbasketId") String workbasketId)
@PathVariable("workbasketId") String workbasketId)
throws WorkbasketNotFoundException, NotAuthorizedOnWorkbasketException {
Workbasket workbasket = workbasketService.getWorkbasket(workbasketId);
@ -160,7 +160,7 @@ public class WorkbasketController {
@DeleteMapping(path = RestEndpoints.URL_WORKBASKET_ID)
@Transactional(rollbackFor = Exception.class, noRollbackFor = WorkbasketNotFoundException.class)
public ResponseEntity<WorkbasketRepresentationModel> deleteWorkbasket(
@PathVariable(value = "workbasketId") String workbasketId)
@PathVariable("workbasketId") String workbasketId)
throws InvalidArgumentException,
WorkbasketNotFoundException,
WorkbasketInUseException,
@ -229,7 +229,7 @@ public class WorkbasketController {
@PutMapping(path = RestEndpoints.URL_WORKBASKET_ID)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<WorkbasketRepresentationModel> updateWorkbasket(
@PathVariable(value = "workbasketId") String workbasketId,
@PathVariable("workbasketId") String workbasketId,
@RequestBody WorkbasketRepresentationModel workbasketRepresentationModel)
throws WorkbasketNotFoundException,
NotAuthorizedException,
@ -267,7 +267,7 @@ public class WorkbasketController {
produces = MediaTypes.HAL_JSON_VALUE)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> getWorkbasketAccessItems(
@PathVariable(value = "workbasketId") String workbasketId)
@PathVariable("workbasketId") String workbasketId)
throws WorkbasketNotFoundException,
NotAuthorizedException,
NotAuthorizedOnWorkbasketException {
@ -298,7 +298,7 @@ public class WorkbasketController {
@PutMapping(path = RestEndpoints.URL_WORKBASKET_ID_ACCESS_ITEMS)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> setWorkbasketAccessItems(
@PathVariable(value = "workbasketId") String workbasketId,
@PathVariable("workbasketId") String workbasketId,
@RequestBody WorkbasketAccessItemCollectionRepresentationModel workbasketAccessItemRepModels)
throws InvalidArgumentException,
WorkbasketNotFoundException,
@ -337,7 +337,7 @@ public class WorkbasketController {
produces = MediaTypes.HAL_JSON_VALUE)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<DistributionTargetsCollectionRepresentationModel> getDistributionTargets(
@PathVariable(value = "workbasketId") String workbasketId)
@PathVariable("workbasketId") String workbasketId)
throws WorkbasketNotFoundException, NotAuthorizedOnWorkbasketException {
List<WorkbasketSummary> distributionTargets =
workbasketService.getDistributionTargets(workbasketId);
@ -363,7 +363,7 @@ public class WorkbasketController {
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<DistributionTargetsCollectionRepresentationModel>
setDistributionTargetsForWorkbasketId(
@PathVariable(value = "workbasketId") String sourceWorkbasketId,
@PathVariable("workbasketId") String sourceWorkbasketId,
@RequestBody List<String> targetWorkbasketIds)
throws WorkbasketNotFoundException,
NotAuthorizedException,
@ -391,7 +391,7 @@ public class WorkbasketController {
@DeleteMapping(path = RestEndpoints.URL_WORKBASKET_ID_DISTRIBUTION)
@Transactional(rollbackFor = Exception.class)
public ResponseEntity<Void> removeDistributionTargetForWorkbasketId(
@PathVariable(value = "workbasketId") String targetWorkbasketId)
@PathVariable("workbasketId") String targetWorkbasketId)
throws WorkbasketNotFoundException,
NotAuthorizedOnWorkbasketException,
NotAuthorizedException {

View File

@ -82,7 +82,7 @@ public class WorkbasketDefinitionController {
@GetMapping(path = RestEndpoints.URL_WORKBASKET_DEFINITIONS)
@Transactional(readOnly = true, rollbackFor = Exception.class)
public ResponseEntity<WorkbasketDefinitionCollectionRepresentationModel> exportWorkbaskets(
@RequestParam(required = false) String[] domain) {
@RequestParam(value = "domain", required = false) String[] domain) {
WorkbasketQuery query = workbasketService.createWorkbasketQuery();
Optional.ofNullable(domain).ifPresent(query::domainIn);

View File

@ -5,6 +5,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
@ -15,6 +16,7 @@ import pro.taskana.classification.rest.models.ClassificationRepresentationModel;
import pro.taskana.common.rest.RestEndpoints;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class ClassificationControllerRestDocTest extends BaseRestDocTest {
@Autowired ClassificationRepresentationModelAssembler assembler;

View File

@ -4,6 +4,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
@ -14,6 +15,7 @@ import pro.taskana.classification.rest.models.ClassificationCollectionRepresenta
import pro.taskana.common.rest.RestEndpoints;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class ClassificationDefinitionControllerRestDocTest extends BaseRestDocTest {
@Autowired ClassificationRepresentationModelAssembler assembler;

View File

@ -2,10 +2,12 @@ package pro.taskana.common.rest;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class AccessIdControllerRestDocTest extends BaseRestDocTest {
@Test

View File

@ -4,11 +4,13 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import java.util.Map;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.common.rest.models.CustomAttributesRepresentationModel;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class TaskanaEngineControllerRestDocTest extends BaseRestDocTest {
@Test

View File

@ -2,11 +2,13 @@ package pro.taskana.monitor.rest;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.common.rest.RestEndpoints;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class MonitorControllerRestDocTest extends BaseRestDocTest {
@Test

View File

@ -5,6 +5,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -18,6 +19,7 @@ import pro.taskana.task.rest.models.TaskCommentRepresentationModel;
import pro.taskana.testapi.security.JaasExtension;
import pro.taskana.testapi.security.WithAccessId;
@Disabled
@ExtendWith(JaasExtension.class)
class TaskCommentControllerRestDocTest extends BaseRestDocTest {

View File

@ -5,6 +5,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +22,7 @@ import pro.taskana.task.rest.models.TaskRepresentationModel;
import pro.taskana.testapi.security.JaasExtension;
import pro.taskana.testapi.security.WithAccessId;
@Disabled
@ExtendWith(JaasExtension.class)
class TaskControllerRestDocTest extends BaseRestDocTest {

View File

@ -5,6 +5,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
@ -15,6 +16,7 @@ import pro.taskana.user.api.models.User;
import pro.taskana.user.rest.assembler.UserRepresentationModelAssembler;
import pro.taskana.user.rest.models.UserRepresentationModel;
@Disabled
class UserControllerRestDocTest extends BaseRestDocTest {
@Autowired UserRepresentationModelAssembler assembler;
@Autowired UserService userService;

View File

@ -3,11 +3,13 @@ package pro.taskana.workbasket.rest;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.delete;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.common.rest.RestEndpoints;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class WorkbasketAccessItemControllerRestDocTest extends BaseRestDocTest {
@Test

View File

@ -6,6 +6,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -24,6 +25,7 @@ import pro.taskana.workbasket.rest.assembler.WorkbasketRepresentationModelAssemb
import pro.taskana.workbasket.rest.models.WorkbasketAccessItemCollectionRepresentationModel;
import pro.taskana.workbasket.rest.models.WorkbasketRepresentationModel;
@Disabled
@ExtendWith(JaasExtension.class)
class WorkbasketControllerRestDocTest extends BaseRestDocTest {

View File

@ -4,6 +4,7 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,6 +20,7 @@ import pro.taskana.workbasket.rest.assembler.WorkbasketRepresentationModelAssemb
import pro.taskana.workbasket.rest.models.WorkbasketDefinitionCollectionRepresentationModel;
import pro.taskana.workbasket.rest.models.WorkbasketDefinitionRepresentationModel;
@Disabled
@ExtendWith(JaasExtension.class)
class WorkbasketDefinitionControllerRestDocTest extends BaseRestDocTest {

View File

@ -151,12 +151,6 @@
<version>${version.oracle}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-core</artifactId>
<version>${version.auto-restdocs}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
@ -182,61 +176,6 @@
</tag>
</tags>
</configuration>
<executions>
<execution>
<id>generate-javadoc-json</id>
<phase>validate</phase>
<goals>
<goal>javadoc-no-fork</goal>
</goals>
<configuration>
<doclet>capital.scalable.restdocs.jsondoclet.ExtractDocumentationAsJsonDoclet</doclet>
<docletArtifact>
<groupId>capital.scalable</groupId>
<artifactId>spring-auto-restdocs-json-doclet-jdk9</artifactId>
<version>${version.auto-restdocs}</version>
</docletArtifact>
<destDir>generated-javadoc-json</destDir>
<reportOutputDirectory>${project.build.directory}</reportOutputDirectory>
<useStandardDocletOptions>false</useStandardDocletOptions>
<show>package</show>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${version.maven.asciidoctor}</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
</execution>
</executions>
<configuration>
<backend>html5</backend>
<doctype>book</doctype>
<attributes>
<snippets>${project.build.directory}/generated-snippets</snippets>
<doctype>book</doctype>
<icons>font</icons>
<source-highlighter>highlightjs</source-highlighter>
<toc>left</toc>
<docinfo>shared</docinfo>
<toclevels>4</toclevels>
<sectlinks/>
</attributes>
<logHandler>
<outputToConsole>false</outputToConsole>
<failIf>
<severity>ERROR</severity>
</failIf>
</logHandler>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -3,6 +3,7 @@ package pro.taskana.routing.dmn.rest;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.ClassPathResource;
import org.springframework.mock.web.MockMultipartFile;
@ -10,6 +11,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import pro.taskana.rest.test.BaseRestDocTest;
@Disabled
class DmnUploadControllerRestDocTest extends BaseRestDocTest {
private static final String EXCEL_NAME = "testExcelRouting.xlsx";