Skip to content

Commit

Permalink
added all missing api beans (#147)
Browse files Browse the repository at this point in the history
(cherry picked from commit cfa6779)
  • Loading branch information
jonathanlukas committed Jun 20, 2024
1 parent c5c4726 commit 6052b5a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions camunda-engine-rest-client-openapi-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DynamicTest> shouldHaveAllApisAsBean() {
List<Class<?>> 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();
}));
}
}

0 comments on commit 6052b5a

Please sign in to comment.