tested spring boot

This commit is contained in:
tuanvu
2026-01-06 16:15:23 +01:00
parent 39d603e7e9
commit ad5ca2189b
5 changed files with 48 additions and 48 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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());
}
}