Skip to content

Commit

Permalink
version updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gtiwari333 committed Feb 9, 2024
1 parent 32e6af6 commit 402bb0d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<version>3.2.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<java.version>17</java.version>
<flowable.version>7.0.0</flowable.version>
<springdoc-openapi-ui.version>2.2.0</springdoc-openapi-ui.version>
<java.version>21</java.version>
<flowable.version>7.0.1</flowable.version>
<springdoc-openapi-ui.version>2.3.0</springdoc-openapi-ui.version>
</properties>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/flowabledemo/DefinitionsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ public ResponseEntity<byte[]> getProcessImageAtCurrentState(@PathVariable String
}

List<String> activityIds = historyService.createHistoricActivityInstanceQuery()
.processInstanceId(historicProcessInstances.get(0).getId())
.processInstanceId(historicProcessInstances.getFirst().getId())
.listPage(0, 1000)
.stream().map(HistoricActivityInstance::getActivityId).toList();

String processDefinitionId = historicProcessInstances.get(0).getProcessDefinitionId();
String processDefinitionId = historicProcessInstances.getFirst().getProcessDefinitionId();
ProcessDefinition processDefinition = repositoryService.getProcessDefinition(processDefinitionId);
if (processDefinition != null && processDefinition.hasGraphicalNotation()) {
ProcessDiagramGenerator processDiagramGenerator = new DefaultProcessDiagramGenerator();
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
if (bpmnModel.getLocationMap().size() == 0) {
if (bpmnModel.getLocationMap().isEmpty()) {
BpmnAutoLayout autoLayout = new BpmnAutoLayout(bpmnModel);
autoLayout.execute();
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/flowabledemo/DemoFlowfestApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest
@ActiveProfiles("test")
class DemoFlowfestApplicationTests {

@Test
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/flowabledemo/config/TestAppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.reactive.function.client.WebClient;
import org.springframework.web.reactive.function.client.support.WebClientAdapter;
import org.springframework.web.client.RestClient;
import org.springframework.web.client.support.RestClientAdapter;
import org.springframework.web.service.invoker.HttpServiceProxyFactory;

@TestConfiguration
Expand All @@ -16,22 +16,22 @@ public class TestAppConfig {

@Bean
VacationApi vacationApiClient() {
var webClient = WebClient.builder()
var webClient = RestClient.builder()
.baseUrl("http://localhost:" + port)
.build();

var factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
var factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(webClient)).build();

return factory.createClient(VacationApi.class);
}

@Bean
DefinitionsApi definitionsApi() {
var webClient = WebClient.builder()
var webClient = RestClient.builder()
.baseUrl("http://localhost:" + port)
.build();

var factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
var factory = HttpServiceProxyFactory.builderFor(RestClientAdapter.create(webClient)).build();

return factory.createClient(DefinitionsApi.class);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/flowabledemo/vacation/FlowableTestBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private void assertAllTasksEnded(String processInstanceId) {
historyService.createHistoricTaskInstanceQuery()
.processInstanceId(processInstanceId)
.list().forEach(h -> {
assertNotNull("Task " + h.getTaskDefinitionKey() + " has no start time", h.getStartTime());
assertNotNull("Task " + h.getTaskDefinitionKey() + " has no start time", h.getCreateTime());
assertNotNull("Task " + h.getTaskDefinitionKey() + " has no end time", h.getEndTime());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void runVacationBPMN_E2E_Scenario_ManagerApprovedOnFirstReview() {
.containsExactly("vacationRequestProcess");

//verify process created with expected variables
var vacationRequest = processes.get(0);
var vacationRequest = processes.getFirst();
assertThat(vacationRequest.getProcessVariables())
.as("process variables")
.contains(
Expand All @@ -69,13 +69,13 @@ void runVacationBPMN_E2E_Scenario_ManagerApprovedOnFirstReview() {
var managerTasks = vacationApi.fetchAvailableTasks("MANAGER");

//claim task
vacationApi.claimTask(managerTasks.get(0).getId(), "Bob The Manager");
vacationApi.claimTask(managerTasks.getFirst().getId(), "Bob The Manager");
System.out.println(getActivityIds(processInstanceId));

//review and approve request
vacationApi.reviewVacationRequest(VacationProcessResult.builder()
.vacationApproved(true)
.build(), managerTasks.get(0).getId());
.build(), managerTasks.getFirst().getId());

//wait for async email sender task
waitForAsyncTasks();
Expand Down Expand Up @@ -111,7 +111,7 @@ void runVacationBPMN_E2E_Scenario_ManagerApprovedOnSecondReview() {
.containsExactly("vacationRequestProcess");

//verify process created with expected variables
var vacationRequest = processes.get(0);
var vacationRequest = processes.getFirst();
assertThat(vacationRequest.getProcessVariables())
.as("process variables")
.contains(
Expand All @@ -126,12 +126,12 @@ void runVacationBPMN_E2E_Scenario_ManagerApprovedOnSecondReview() {

//fetch manager tasks
var managerTasks = vacationApi.fetchAvailableTasks("MANAGER");
vacationApi.claimTask(managerTasks.get(0).getId(), "Bob The Manager");
vacationApi.claimTask(managerTasks.getFirst().getId(), "Bob The Manager");

//review and approve request
vacationApi.reviewVacationRequest(VacationProcessResult.builder()
.vacationApproved(false)
.build(), managerTasks.get(0).getId());
.build(), managerTasks.getFirst().getId());

//wait for async email sender task
waitForAsyncTasks();
Expand All @@ -141,22 +141,22 @@ void runVacationBPMN_E2E_Scenario_ManagerApprovedOnSecondReview() {

//claim task by employee
var employeeTasks = vacationApi.fetchAvailableTasks("EMPLOYEE");
vacationApi.claimTask(employeeTasks.get(0).getId(), "Sally The Employee");
vacationApi.claimTask(employeeTasks.getFirst().getId(), "Sally The Employee");
//appeal
vacationApi.updateVacationRequest(VacationUpdateRequest.builder()
.numberOfDays(15)
.shouldAppeal(true)
.build(), employeeTasks.get(0).getId());
.build(), employeeTasks.getFirst().getId());
System.out.println(getActivityIds(processInstanceId));

//claim task by manager
managerTasks = vacationApi.fetchAvailableTasks("MANAGER");
vacationApi.claimTask(managerTasks.get(0).getId(), "Bob The Manager");
vacationApi.claimTask(managerTasks.getFirst().getId(), "Bob The Manager");

//review and approve request
vacationApi.reviewVacationRequest(VacationProcessResult.builder()
.vacationApproved(true)
.build(), managerTasks.get(0).getId());
.build(), managerTasks.getFirst().getId());

//wait for async email sender task
waitForAsyncTasks();
Expand Down

0 comments on commit 402bb0d

Please sign in to comment.