Skip to content
Snippets Groups Projects
Commit 4808fb09 authored by OZGCloud's avatar OZGCloud
Browse files

add autoconfiguration

parent 8cd05a38
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ class DummyVorgangService implements OzgCloudVorgangService {
.build();
private static final OzgCloudEingang EINGANG_2 = OzgCloudEingang.builder().build();
private DummyVorgangService() {
public DummyVorgangService() {
idToVorgang = buildMap();
vorgangs = initList();
}
......
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.ozgcloud.api-lib</groupId>
<artifactId>api-lib-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>ozg-cloud-spring-boot-starter</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>de.ozgcloud.api-lib</groupId>
<artifactId>api-lib-core</artifactId>
<version>${project.version}</version>
</dependency>
<!--Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package de.ozgcloud.client.autoconfigure;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@AutoConfiguration
@ComponentScan(basePackages = "de.ozgcloud.apilib.**")
public class OzgCloudClientAutoConfiguration {
}
de.ozgcloud.client.autoconfigure.OzgCloudClientAutoConfiguration
\ No newline at end of file
package de.ozgcloud.apilib.autoconfig;
import java.util.TimeZone;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ApiLibTestApplication {
public static void main(String[] args) {
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
SpringApplication.run(ApiLibTestApplication.class, args);
}
}
package de.ozgcloud.client.autoconfigure;
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import de.ozgcloud.apilib.autoconfig.ApiLibTestApplication;
import de.ozgcloud.apilib.vorgang.OzgCloudVorgangService;
@SpringBootTest(classes = ApiLibTestApplication.class)
class OzgCloudStarterITCase {
@Autowired(required = false)
private OzgCloudVorgangService vorgangService;
@Test
void shouldInitializeVorgangService() {
assertThat(vorgangService).isNotNull();
}
}
......@@ -19,6 +19,7 @@
<packaging>pom</packaging>
<modules>
<module>api-lib-core</module>
<module>ozg-cloud-spring-boot-starter</module>
</modules>
</project>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment