Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rw29468/bootfahrten
  • tk07224/bootfahrten
  • systemdesign/bootfahrten
  • dk10357/bootfahrten
  • sr11532/bootfahrten
  • sb21427/bootfahrten
  • lk15446/bootfahrten
  • ae14236/bootfahrten
  • mr10412/bootfahrten
  • db10063/bootfahrten
  • bk17431/bootfahrten
  • bh26834/bootfahrten
  • nb24598/bootfahrten
  • sp22329/bootfahrten
  • ms11770/bootfahrten
  • bk13170/bootfahrten
  • ae25929/bootfahrten
  • at05134/bootfahrten
  • vs21077/bootfahrten
  • yk19198/bootfahrten
  • fh10313/bootfahrten
  • sg18178/bootfahrten
  • sw14033/bootfahrten-sw
  • dr30793/bootfahrten
  • te04946/bootfahrten
  • jk01134/bootfahrten
  • cn09910/bootfahrten
  • mc10364/bootfahrten
  • ms28502/bootfahrten
  • ha18625/bootfahrten
  • md26317/bootfahrten
  • tb10091/bootfahrten
  • thomas.schiller/bootfahrten
  • ma25061/bootfahrten
  • jonas.pfeifer/bootfahrten
  • kilian.lindinger/bootfahrten
  • andreas.kergel/bootfahrten
  • julian.wagner/bootfahrten
  • franziska.michl/bootfahrten
  • lukas.nowak/bootfahrten
  • marvin.lederer/bootfahrten
  • florian.hammerschmid/bootfahrten
  • christian.stelzl/bootfahrten
  • fa26097/bootfahrten
  • fk04915/bootfahrten
  • ma23179/bootfahrten
  • zakariae.louriki/bootfahrten
47 results
Show changes
Commits on Source (8)
......@@ -18,7 +18,7 @@ variables:
# Tell maven to use the cache
MAVEN_OPTS: "-Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository"
# Instruct Testcontainers to use the daemon of DinD.
DOCKER_HOST: "tcp://docker:2375"
# DOCKER_HOST: "tcp://docker:2375"
# Improve performance with overlayfs.
DOCKER_DRIVER: overlay2
# SPRING_PROFILES_ACTIVE: gitlab-ci
......
......@@ -14,7 +14,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.12.RELEASE</version>
<version>2.7.9</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
......@@ -38,6 +38,21 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Wenn sie eine andere Datenbank als h2 verwenden wollen hier einige Beispile -->
<!-- Hier Mysql -->
<!-- dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency -->
<!-- Hier Postgres -->
<!-- dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
......@@ -51,7 +66,7 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.4.1</version>
<version>3.6.4</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
......@@ -67,7 +82,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.5</version>
<version>1.7.0</version>
</dependency>
<dependency>
......@@ -82,24 +97,17 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<from><image>adoptopenjdk:15</image></from>
<to>
<auth>
<username>${env.CI_REGISTRY_USER}</username>
<password>${env.CI_REGISTRY_PASSWORD}</password>
</auth>
<image>${env.CI_REGISTRY_IMAGE}</image>
</to>
</configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
</build>
</project>
</project>
\ No newline at end of file
......@@ -124,8 +124,8 @@ public class BootController {
@Operation(summary = "List all boats", description = "Mit dieser Methode können Sie die Liste von im System integrierten Booten laden.")
@RequestMapping(value="/", method=RequestMethod.GET)
@ResponseBody
public ResponseEntity<List<Boot>> rest_list() {
return ResponseEntity.ok(bootService.findAll());
public List<Boot> rest_list() {
return bootService.findAll();
}
/**
......@@ -134,7 +134,7 @@ public class BootController {
* @return Success or error
*/
@Operation(summary = "Create or modify a boat")
@Parameter(name="boot", required = true)
@io.swagger.v3.oas.annotations.parameters.RequestBody(description="Das Boot was gespeichert werde soll")
@RequestMapping(value="/", method={RequestMethod.POST, RequestMethod.PUT})
@ResponseBody
public ResponseEntity<Boot> rest_save(
......
......@@ -19,7 +19,7 @@ public interface FahrtRepository extends CrudRepository<Fahrt, Long> {
List<Fahrt> findByAnkunftIsNull();
@Query("select f from Fahrt f where f.ruderer = ?1")
@Query("select distinct f from Fahrt f JOIN f.ruderer r where r = ?1")
List<Fahrt> findByRuderer(Person person);
}
......@@ -58,7 +58,7 @@ public class PersonService {
public void delete(Long id) throws DaoException {
Person ruderer = personRepository.findById(id).get();
boolean keineFahrt = fahrtRepository.findByRuderer(ruderer ).isEmpty();
boolean keineFahrt = fahrtRepository.findByRuderer(ruderer).isEmpty();
if (keineFahrt) {
personRepository.deleteById(id);
} else {
......
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:h2:file:./data/demo
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.open-in-view=false
spring.jpa.show-sql=true
#####
# Database configuration
#####
spring.datasource.username=user
spring.datasource.password=password
# !
# This is the h2 database part
spring.datasource.url=jdbc:h2:file:./data/demo
spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.open-in-view=false
spring.jpa.show-sql=true
spring.h2.console.enabled=true
\ No newline at end of file
spring.h2.console.enabled=true
# Oder mysql
# spring.datasource.url=jdbc:mysql://servername:3306/datenankname
# Der zu verwendende Treiber. Achtung: Den müssen Sie in Ihren Abhängigkeiten (pom.xml) auch definieren!
# spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
#
# Oder postgres
# spring.datasource.url=jdbc:postgresql://localhost:5432/testdb
# Der zu verwendende Treiber. Achtung: Den müssen Sie in Ihren Abhängigkeiten (pom.xml) auch definieren!
# spring.datasource.driverClassName=org.postgresql.Driver
......@@ -2,7 +2,7 @@
xmlns:th="http://www.thymeleaf.org">
<div th:fragment="foot">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script th:src="@{/webjars/jquery/3.4.1/jquery.min.js} "></script>
<script th:src="@{/webjars/jquery/3.6.4/jquery.min.js} "></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script th:src="@{/webjars/bootstrap/4.5.3/js/bootstrap.min.js}"></script>
</div>
......
......@@ -2,14 +2,14 @@ package de.thd.pms.dao;
import java.util.List;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import de.thd.pms.model.Boot;
import de.thd.pms.service.BootService;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ContextConfiguration("/test-application-context.xml")
public class BootServiceTest extends AbstractDataAccessTest {
......@@ -52,7 +52,7 @@ public class BootServiceTest extends AbstractDataAccessTest {
deleteFromTables(tables);
bootService.create("Deggendorf", 4, "Vierer");
int rows = countRowsInTable(tabellennameBoot);
assertEquals("Die DB muss eine Zeile enthalten", 1, rows);
assertEquals(1, rows, "Die DB muss eine Zeile enthalten");
// delete all rows from db table
deleteFromTables(tables);
}
......
......@@ -4,9 +4,10 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.test.context.ContextConfiguration;
......@@ -21,7 +22,7 @@ import de.thd.pms.service.DaoException;
import de.thd.pms.service.FahrtService;
import de.thd.pms.service.PersonService;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;
@ContextConfiguration("/test-application-context.xml")
public class FahrtServiceTest extends AbstractDataAccessTest {
......@@ -45,7 +46,7 @@ public class FahrtServiceTest extends AbstractDataAccessTest {
this.bootService = bootService;
}
@Before
@BeforeEach
public void before() {
try {
// create two persons
......@@ -68,7 +69,7 @@ public class FahrtServiceTest extends AbstractDataAccessTest {
}
}
@After
@AfterEach
public void after() {
try {
deleteFromTables(tables);
......
package de.thd.pms.dao;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import de.thd.pms.model.Person;
import de.thd.pms.service.PersonService;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ContextConfiguration("/test-application-context.xml")
public class PersonServiceTest extends AbstractDataAccessTest {
......
package de.thd.pms.fahrtenbuch;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@RunWith(SpringRunner.class)
@ExtendWith(SpringExtension.class)
@SpringBootTest
public class FahrtenbuchApplicationTests {
......