mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:25:49 +00:00
Aggiunte in configurazioni di avvio:
-Aggiunti profili local e prod modificabili nel campo Environment -Password db criptata (la secret key si trova nel campo Arguments) N.B. la secret key è uguale al nome del profilo che si sta utilizzando
This commit is contained in:
parent
381ffe33bf
commit
8c3caf06e8
41 changed files with 2594 additions and 2600 deletions
11
pom.xml
11
pom.xml
|
@ -11,7 +11,9 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.2.5.RELEASE</version>
|
<version>2.2.5.RELEASE</version>
|
||||||
|
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<name>petclinic</name>
|
<name>petclinic</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -20,7 +22,6 @@
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
|
||||||
<!-- Web dependencies -->
|
<!-- Web dependencies -->
|
||||||
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
|
<webjars-bootstrap.version>3.3.6</webjars-bootstrap.version>
|
||||||
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
|
<webjars-jquery-ui.version>1.11.4</webjars-jquery-ui.version>
|
||||||
|
@ -65,6 +66,12 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Jasypt implementation -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.ulisesbocchio</groupId>
|
||||||
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
|
<version>2.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Databases - postgresql implementation -->
|
<!-- Databases - postgresql implementation -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -72,6 +79,7 @@
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- caching -->
|
<!-- caching -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.cache</groupId>
|
<groupId>javax.cache</groupId>
|
||||||
|
@ -372,5 +380,4 @@
|
||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -19,6 +19,8 @@ package org.springframework.samples.petclinic;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PetClinic Spring Boot Application.
|
* PetClinic Spring Boot Application.
|
||||||
*
|
*
|
||||||
|
@ -26,6 +28,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication(proxyBeanMethods = false)
|
@SpringBootApplication(proxyBeanMethods = false)
|
||||||
|
@EnableEncryptableProperties
|
||||||
public class PetClinicApplication {
|
public class PetClinicApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
@ -1,24 +1,6 @@
|
||||||
# default connection pool
|
|
||||||
spring.datasource.hikari.connectionTimeout=20000
|
|
||||||
spring.datasource.hikari.maximumPoolSize=5
|
|
||||||
# PostgreSQL connection and inizialization
|
|
||||||
spring.datasource.url=jdbc:postgresql://localhost:5432/petclinic
|
|
||||||
spring.datasource.username=postgres
|
|
||||||
spring.datasource.password=pass
|
|
||||||
spring.datasource.sql-script-encoding= UTF-8
|
|
||||||
spring.datasource.schema=classpath*:db/postgres/schema.sql
|
|
||||||
spring.datasource.data=classpath*:db/postgres/data.sql
|
|
||||||
spring.datasource.initialization-mode=always
|
|
||||||
|
|
||||||
|
|
||||||
# Web
|
# Web
|
||||||
spring.thymeleaf.mode=HTML
|
spring.thymeleaf.mode=HTML
|
||||||
|
|
||||||
# JPA
|
|
||||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
|
|
||||||
spring.jpa.hibernate.ddl-auto=none
|
|
||||||
spring.jpa.open-in-view=false
|
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
spring.messages.basename=messages/messages
|
spring.messages.basename=messages/messages
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ class ValidatorTests {
|
||||||
assertThat(violation.getPropertyPath().toString()).isEqualTo("firstName");
|
assertThat(violation.getPropertyPath().toString()).isEqualTo("firstName");
|
||||||
assertThat(violation.getMessage()).isEqualTo("must not be empty");
|
assertThat(violation.getMessage()).isEqualTo("must not be empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* My test */
|
/* My test */
|
||||||
@Test
|
@Test
|
||||||
void validateWhenFirstNameNotEmpty() {
|
void validateWhenFirstNameNotEmpty() {
|
||||||
|
@ -70,6 +71,7 @@ class ValidatorTests {
|
||||||
|
|
||||||
assertThat(constraintViolations).hasSize(0);
|
assertThat(constraintViolations).hasSize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* My test */
|
/* My test */
|
||||||
@Test
|
@Test
|
||||||
void shouldNotValidateWhenLastNameEmpty() {
|
void shouldNotValidateWhenLastNameEmpty() {
|
||||||
|
|
Loading…
Reference in a new issue