Skip to content
Snippets Groups Projects
Commit 2e62e1f7 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-106 ITCase for VorgangRepository

parent 71657621
No related branches found
No related tags found
No related merge requests found
...@@ -143,6 +143,11 @@ ...@@ -143,6 +143,11 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
......
logging: logging:
level: level:
ROOT: WARN ROOT: WARN
de.itvsh: INFO '[de.itvsh]': INFO
spring: spring:
application: application:
......
...@@ -7,7 +7,7 @@ import org.springframework.boot.test.context.SpringBootTest; ...@@ -7,7 +7,7 @@ import org.springframework.boot.test.context.SpringBootTest;
class PlutoServerApplicationTests { class PlutoServerApplicationTests {
@Test @Test
void contextLoads() { void contextLoads() { // NOSONAR empty test just starting spring-boot
} }
} }
package de.itvsh.ozg.pluto.vorgang;
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 org.springframework.test.context.ActiveProfiles;
@SpringBootTest
@ActiveProfiles("with_db")
class VorgangRepositoryITCase {
@Autowired
private VorgangRepository repository;
@Test
void persistVorgang() {
var persisted = repository.save(VorgangTestFactory.createBuilder().id(null).build());
assertThat(persisted.getId()).isNotNull();
}
@Test
void loadVorgang() {
var persisted = repository.save(VorgangTestFactory.createBuilder().id(null).build());
var loaded = repository.findById(persisted.getId());
assertThat(loaded).isPresent();
}
}
logging:
level:
'[org.springframework.data.mongodb]': DEBUG
spring:
data:
mongodb:
host: localhost
database: embeded_db
\ 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