chore: Initial import of FLEX training material

This commit is contained in:
Alexander Kobjolke 2024-11-07 21:02:53 +01:00
parent c01246d4f7
commit 12235acc42
1020 changed files with 53940 additions and 0 deletions

View file

@ -0,0 +1,3 @@
# curl -v -X GET -u admin:admin1 http://localhost:8081/actuator/backofficeEventsPublished
GET http://localhost:8081/actuator/backofficeEventsPublished
Authorization: Basic admin admin1

View file

@ -0,0 +1,3 @@
# curl -v -X GET -u admin:admin1 http://localhost:8081/actuator/health
GET http://localhost:8081/actuator/health
Authorization: Basic admin admin1

View file

@ -0,0 +1,3 @@
# curl -v -X GET -u admin:admin1 http://localhost:8081/actuator/info
GET http://localhost:8081/actuator/info
Authorization: Basic admin admin1

View file

@ -0,0 +1,3 @@
# curl -v -X GET -u admin:admin1 http://localhost:8081/actuator/metrics
GET http://localhost:8081/actuator/metrics
Authorization: Basic admin admin1

View file

@ -0,0 +1,3 @@
# curl -v -X GET -u admin:admin1 http://localhost:8081/actuator/prometheus
GET http://localhost:8081/actuator/prometheus
Authorization: Basic admin admin1

View file

@ -0,0 +1,21 @@
package de.accso.flexinale;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(classes = {FlexinaleDistributedApplicationBackoffice.class})
@ActiveProfiles("smoketest")
public class ApplicationPropertiesFileTest {
@Value("${application.version}")
private String propertyApplicationVersion;
@Test
public void testReadsTestPropertiesFile() {
assertThat(propertyApplicationVersion).isEqualTo("test");
}
}

View file

@ -0,0 +1,20 @@
package de.accso.flexinale;
import de.accso.flexinale.common.shared_kernel.DoNotCheckInArchitectureTests;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
@SpringBootTest(classes = {FlexinaleDistributedApplicationBackoffice.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@ActiveProfiles("smoketest")
@DoNotCheckInArchitectureTests
class FlexinaleDistributedApplicationBackofficeSmokeTest {
@Test
@SuppressWarnings("EmptyMethod")
void testLoadInitialApplicationContext() {
// nope
}
}

View file

@ -0,0 +1,31 @@
package de.accso.flexinale;
import de.accso.flexinale.common.application.Config;
import de.accso.flexinale.common.shared_kernel.DoNotCheckInArchitectureTests;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(classes = {FlexinaleDistributedApplicationBackoffice.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
@ActiveProfiles("configtest")
@DoNotCheckInArchitectureTests
class FlexinaleDistributedApplicationBackofficeSpringConfigTest {
@Autowired
Config config;
@Test
void testLoadSpringConfig() {
// arrange, act
// nope, is loaded auto-magically by Spring, see application-configtest.properties
// assert
assertThat(config.getQuoteOnline()).isEqualTo(33); // default
assertThat(config.getMinZeitZwischenVorfuehrungenInMinuten()).isEqualTo(30); // default
}
}

View file

@ -0,0 +1,39 @@
application.title=FLEXinale as Distributed Services, Backoffice
application.version=test
spring.banner.location=classpath:/flexinale-banner.txt
#########################################################################
# For endpoint /version
#########################################################################
build.version=@pom.version@
build.date=@maven.build.timestamp@
#########################################################################
# Persistence
#########################################################################
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/distributed-backoffice
spring.datasource.name=flexinale
spring.datasource.username=flexinale
spring.datasource.password=flexinale
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.database=postgresql
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.generate-ddl=true
# spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
#########################################################################
# Web
#########################################################################
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
server.error.path=/error
server.port=9091
#########################################################################
# flexinale properties
#########################################################################
# Quote for online kontingent in percent
de.accso.flexinale.kontingent.quote.online=33
# time in minutes
de.accso.flexinale.vorfuehrung.min-zeit-zwischen-vorfuehrungen-in-minuten=30

View file

@ -0,0 +1,20 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{YYYYMMdd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.springframework.orm.jpa" level="INFO"/>
<logger name="org.springframework.boot.autoconfigure.domain.EntityScan" level="INFO"/>
<logger name="org.apache.kafka" level="WARN"/>
<logger name="org.apache.kafka.clients.admin.AdminClient" level="INFO"/>
<logger name="org.apache.kafka.clients.consumer.ConsumerConfig" level="INFO"/>
<logger name="org.apache.kafka.clients.producer.ProducerConfig" level="INFO"/>
<logger name="de.accso" level="INFO"/>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>