From 6052b5a3431a52612b3c239109ee66606b8c4978 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Thu, 20 Jun 2024 06:39:34 +0200 Subject: [PATCH] added all missing api beans (#147) (cherry picked from commit cfa677902e25fbde1414cb3b8972c9c9331c4c17) --- .../pom.xml | 4 +-- .../rest/client/springboot/CamundaApi.java | 15 +++++++++ .../client/springboot/CamundaApiTest.java | 32 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 camunda-engine-rest-client-openapi-springboot/src/test/java/org/camunda/community/rest/client/springboot/CamundaApiTest.java diff --git a/camunda-engine-rest-client-openapi-java/pom.xml b/camunda-engine-rest-client-openapi-java/pom.xml index d667e7c..e820493 100644 --- a/camunda-engine-rest-client-openapi-java/pom.xml +++ b/camunda-engine-rest-client-openapi-java/pom.xml @@ -57,8 +57,8 @@ - junit - junit + org.junit.jupiter + junit-jupiter-api test diff --git a/camunda-engine-rest-client-openapi-springboot/src/main/java/org/camunda/community/rest/client/springboot/CamundaApi.java b/camunda-engine-rest-client-openapi-springboot/src/main/java/org/camunda/community/rest/client/springboot/CamundaApi.java index 316a1c4..08b29ad 100644 --- a/camunda-engine-rest-client-openapi-springboot/src/main/java/org/camunda/community/rest/client/springboot/CamundaApi.java +++ b/camunda-engine-rest-client-openapi-springboot/src/main/java/org/camunda/community/rest/client/springboot/CamundaApi.java @@ -84,6 +84,16 @@ public IdentityApi identityApi() { return new IdentityApi(apiClient); } + @Bean + public IncidentApi incidentApi() { + return new IncidentApi(apiClient); + } + + @Bean + public JobApi jobApi() { + return new JobApi(apiClient); + } + @Bean public JobDefinitionApi jobDefinitionApi() { return new JobDefinitionApi(apiClient); @@ -149,6 +159,11 @@ public TaskIdentityLinkApi taskIdentityLinkApi() { return new TaskIdentityLinkApi(apiClient); } + @Bean + public TaskVariableApi taskVariableApi() { + return new TaskVariableApi(apiClient); + } + @Bean public TaskLocalVariableApi taskLocalVariableApi() { return new TaskLocalVariableApi(apiClient); diff --git a/camunda-engine-rest-client-openapi-springboot/src/test/java/org/camunda/community/rest/client/springboot/CamundaApiTest.java b/camunda-engine-rest-client-openapi-springboot/src/test/java/org/camunda/community/rest/client/springboot/CamundaApiTest.java new file mode 100644 index 0000000..69756e7 --- /dev/null +++ b/camunda-engine-rest-client-openapi-springboot/src/test/java/org/camunda/community/rest/client/springboot/CamundaApiTest.java @@ -0,0 +1,32 @@ +package org.camunda.community.rest.client.springboot; + +import static org.assertj.core.api.Assertions.*; + +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.api.DynamicTest; +import org.junit.jupiter.api.TestFactory; +import org.junit.platform.commons.support.ReflectionSupport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; + +@SpringBootTest +public class CamundaApiTest { + @Autowired ApplicationContext applicationContext; + + @TestFactory + Stream shouldHaveAllApisAsBean() { + List> allApis = + ReflectionSupport.findAllClassesInPackage( + "org.camunda.community.rest.client.api", c -> !c.isAnonymousClass(), s -> true); + return allApis.stream() + .map( + c -> + DynamicTest.dynamicTest( + c.getName(), + () -> { + assertThat(applicationContext.getBean(c)).isNotNull(); + })); + } +}