tested spring boot
This commit is contained in:
@@ -55,13 +55,6 @@
|
||||
<groupId>org.thymeleaf.extras</groupId>
|
||||
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-docker-compose</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
|
||||
@@ -3,6 +3,7 @@ package hackathon.FrisbYEE.jpa.metier;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -16,17 +17,19 @@ import jakarta.persistence.Enumerated;
|
||||
import jakarta.persistence.CascadeType;
|
||||
|
||||
@Entity
|
||||
@Getter @Setter @NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Access(AccessType.FIELD)
|
||||
|
||||
@Table(name = "app_user")
|
||||
public class User implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Integer id;
|
||||
@Column(unique = true, nullable = false) //pas possible d'avoir le même nom
|
||||
@Column(unique = true, nullable = false) // pas possible d'avoir le même nom
|
||||
private String name;
|
||||
@Column (nullable = false)
|
||||
@Column(nullable = false)
|
||||
private String motDePasse;
|
||||
private String email;
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/frisbyee
|
||||
spring.datasource.username=postgres
|
||||
spring.datasource.password=postgres
|
||||
spring.datasource.username=frisbyee_user
|
||||
spring.datasource.password=secret
|
||||
spring.datasource.driver-class-name=org.postgresql.Driver
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jpa.show-sql=true
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
spring.datasource.url=jdbc:postgresql://localhost:5432/frisbyee
|
||||
spring.datasource.username=frisbyee_user
|
||||
spring.datasource.password=secret
|
||||
server.port=8081
|
||||
@@ -1,27 +0,0 @@
|
||||
package hackathon.FrisbYEE;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.web.servlet.client.RestTestClient;
|
||||
|
||||
import hackathon.FrisbYEE.rest.AthleteResource;
|
||||
|
||||
|
||||
class FrisbYEEApplicationTests {
|
||||
|
||||
//Controller
|
||||
private AthleteResource athleteResource;
|
||||
private RestTestClient mockMvc;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
athleteResource = new AthleteResource();
|
||||
mockMvc = RestTestClient.bindToController(athleteResource).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldReturnUsers() throws Exception {
|
||||
//mockMvc.perform(get("/api/users"))
|
||||
// .andExpect(status().isOk());
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,12 @@ services:
|
||||
container_name: baeldung-keycloak.openid-provider
|
||||
image: quay.io/keycloak/keycloak:26.4
|
||||
command:
|
||||
- start-dev
|
||||
- --import-realm
|
||||
- start-dev
|
||||
- --import-realm
|
||||
ports:
|
||||
- 8080:8080
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./keycloak/:/opt/keycloak/data/import/
|
||||
- ./keycloak/:/opt/keycloak/data/import/
|
||||
environment:
|
||||
KEYCLOAK_ADMIN: admin
|
||||
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
|
||||
@@ -21,9 +21,42 @@ services:
|
||||
KC_HEALTH_ENABLED: true
|
||||
KC_METRICS_ENABLED: true
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: ['CMD-SHELL', '[ -f /tmp/HealthCheck.java ] || echo "public class HealthCheck { public static void main(String[] args) throws java.lang.Throwable { System.exit(java.net.HttpURLConnection.HTTP_OK == ((java.net.HttpURLConnection)new java.net.URL(args[0]).openConnection()).getResponseCode() ? 0 : 1); } }" > /tmp/HealthCheck.java && java /tmp/HealthCheck.java http://localhost:8080/auth/health/live']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
postgres:
|
||||
image: postgres:16
|
||||
container_name: frisbyee-postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: frisbyee
|
||||
POSTGRES_USER: frisbyee_user
|
||||
POSTGRES_PASSWORD: secret
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
version: "3.9"
|
||||
postgres:
|
||||
image: postgres:16
|
||||
container_name: frisbyee-postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: frisbyee
|
||||
POSTGRES_USER: frisbyee_user
|
||||
POSTGRES_PASSWORD: secret
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
version: "3.9"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user