Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/maven/hibernate.version-6.6.7.…
Browse files Browse the repository at this point in the history
…Final
  • Loading branch information
wojciech-piotrowiak authored Feb 12, 2025
2 parents 8a6dc5c + 13bad8c commit f578e59
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
${{ runner.os }}-maven-
- name: Set up JDK 21
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: '21'
distribution: 'temurin'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand Down Expand Up @@ -98,6 +98,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
with:
category: "/language:${{matrix.language}}"
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Check dependabot build
uses: Activiti/Activiti/.github/actions/check-ext-build@7700f0283a9ff5181581a350d2520e55c61c1c60 # 8.6.0
uses: Activiti/Activiti/.github/actions/check-ext-build@d93095fd93ebed502ee1a7520afbf43cfcaf510a # 8.7.0
- name: pre-commit
uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@166e610d3eebb2a561d6daba97cd58d98ef2db14 # v8.13.0
with:
skip_checkout: true
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@5d6ac37a4cef8b8df67f482a8e384987766f0213 # v3.0.17
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@6eb1abde32fed00453b0d03497f4ba4fecba146d # v3.0.21

build:
runs-on: ubuntu-latest
Expand All @@ -60,7 +60,7 @@ jobs:
${{ runner.os }}-maven-
- name: Setup Java JDK 21
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # 4.6.0
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # 4.7.0
with:
java-version: 21
distribution: 'temurin'
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
${{ runner.os }}-maven-
- name: Setup Java JDK 21
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # 4.6.0
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # 4.7.0
with:
java-version: 21
distribution: 'temurin'
Expand Down Expand Up @@ -334,7 +334,7 @@ jobs:
token: ${{ secrets.BOT_GITHUB_TOKEN }}

- name: Setup Java JDK 21
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: 21
distribution: 'temurin'
Expand Down
2 changes: 1 addition & 1 deletion activiti-cloud-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<name>Activiti Cloud :: Runtime API Parent</name>
<packaging>pom</packaging>
<properties>
<activiti.version>8.8.0-alpha.3</activiti.version>
<activiti.version>8.8.0-alpha.4</activiti.version>
</properties>
<modules>
<module>activiti-cloud-api-dependencies</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
import jakarta.servlet.http.HttpServletResponse;
import org.activiti.api.model.shared.model.ActivitiErrorMessage;
import org.activiti.api.runtime.model.impl.ActivitiErrorMessageImpl;
import org.activiti.cloud.common.error.attributes.ErrorAttributesMessageSanitizer;
import org.activiti.core.common.spring.security.policies.ActivitiForbiddenException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.hateoas.EntityModel;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
Expand All @@ -30,6 +34,8 @@
@RestControllerAdvice
public class CommonExceptionHandlerQuery {

private static final Logger LOGGER = LoggerFactory.getLogger(CommonExceptionHandlerQuery.class);

// TODO: 12/04/2019 this exception handler should be moved to activiti-cloud-service-common
@ExceptionHandler(ActivitiForbiddenException.class)
@ResponseStatus(HttpStatus.FORBIDDEN)
Expand All @@ -41,7 +47,7 @@ public EntityModel<ActivitiErrorMessage> handleAppException(
return EntityModel.of(new ActivitiErrorMessageImpl(HttpStatus.FORBIDDEN.value(), ex.getMessage()));
}

@ExceptionHandler(IllegalStateException.class)
@ExceptionHandler({ IllegalStateException.class })
@ResponseStatus(HttpStatus.BAD_REQUEST)
public EntityModel<ActivitiErrorMessage> handleAppException(
IllegalStateException ex,
Expand All @@ -51,6 +57,22 @@ public EntityModel<ActivitiErrorMessage> handleAppException(
return EntityModel.of(new ActivitiErrorMessageImpl(HttpStatus.BAD_REQUEST.value(), ex.getMessage()));
}

@ExceptionHandler({ ConversionFailedException.class })
@ResponseStatus(HttpStatus.BAD_REQUEST)
public EntityModel<ActivitiErrorMessage> handleAppException(
ConversionFailedException ex,
HttpServletResponse response
) {
LOGGER.error(ex.getMessage(), ex);
response.setContentType(MediaType.APPLICATION_JSON_VALUE);
return EntityModel.of(
new ActivitiErrorMessageImpl(
HttpStatus.BAD_REQUEST.value(),
ErrorAttributesMessageSanitizer.ERROR_NOT_DISCLOSED_MESSAGE
)
);
}

@ExceptionHandler(EntityNotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public EntityModel<ActivitiErrorMessage> handleAppException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@

import com.querydsl.core.types.Predicate;
import jakarta.persistence.EntityManagerFactory;
import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.activiti.api.runtime.conf.impl.CommonModelAutoConfiguration;
import org.activiti.api.runtime.shared.security.SecurityManager;
import org.activiti.cloud.alfresco.config.AlfrescoWebAutoConfiguration;
import org.activiti.cloud.common.error.attributes.ErrorAttributesMessageSanitizer;
import org.activiti.cloud.conf.QueryRestWebMvcAutoConfiguration;
import org.activiti.cloud.services.query.app.repository.EntityFinder;
import org.activiti.cloud.services.query.app.repository.ProcessDefinitionRepository;
Expand All @@ -52,12 +55,17 @@
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
import org.springframework.data.domain.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.http.MediaType;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;

@WebMvcTest(ProcessInstanceController.class)
@Import(
Expand Down Expand Up @@ -200,4 +208,16 @@ void shouldReturnProcessInstanceById() throws Exception {
.andExpect(jsonPath("$.entry.id").value(processInstanceEntity.getId()))
.andExpect(jsonPath("$.entry.status").value(processInstanceEntity.getStatus().name()));
}

@Test
void should_returnBadRequestError_when_invalidProcessInstanceEnum() throws Exception {
MvcResult result = mockMvc
.perform(get("/v1/process-instances?status=ASSIGNED").accept(MediaType.APPLICATION_JSON))
//then
.andExpect(status().isBadRequest())
.andReturn();

assertThat(result.getResponse().getContentAsString())
.contains(ErrorAttributesMessageSanitizer.ERROR_NOT_DISCLOSED_MESSAGE);
}
}
2 changes: 1 addition & 1 deletion activiti-cloud-query-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<module>activiti-cloud-starter-query-rest</module>
</modules>
<properties>
<activiti.version>8.8.0-alpha.3</activiti.version>
<activiti.version>8.8.0-alpha.4</activiti.version>
</properties>
<!-- BoM Marker Dependencies -->
<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion activiti-cloud-runtime-bundle-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<module>activiti-cloud-starter-runtime-bundle-it</module>
</modules>
<properties>
<activiti.version>8.8.0-alpha.3</activiti.version>
<activiti.version>8.8.0-alpha.4</activiti.version>
<commons-fileupload.version>1.5</commons-fileupload.version>
</properties>
<dependencyManagement>
Expand Down
2 changes: 1 addition & 1 deletion activiti-cloud-service-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<module>activiti-cloud-service-messaging-starter</module>
</modules>
<properties>
<activiti.version>8.8.0-alpha.3</activiti.version>
<activiti.version>8.8.0-alpha.4</activiti.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<commons-configuration.version>1.10</commons-configuration.version>
<commons-lang.version>2.6</commons-lang.version>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<license-maven-plugin.version>3.0</license-maven-plugin.version>
<third-party-license-maven-plugin.version>2.4.0</third-party-license-maven-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
Expand All @@ -221,7 +221,7 @@
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-site-plugin.version>3.11.0</maven-site-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>

<!-- dependencies versions -->
<hibernate.version>6.6.7.Final</hibernate.version>
Expand Down

0 comments on commit f578e59

Please # to comment.