diff --git a/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java b/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java index 9d4a53c6..ea86dc36 100755 --- a/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java +++ b/src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java @@ -33,9 +33,7 @@ class CacheConfiguration { @Bean public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() { - return cm -> { - cm.createCache("vets", cacheConfiguration()); - }; + return cm -> cm.createCache("vets", cacheConfiguration()); } /** diff --git a/src/main/resources/application-mysql.properties b/src/main/resources/application-mysql.properties index 823b32b6..1125dea5 100644 --- a/src/main/resources/application-mysql.properties +++ b/src/main/resources/application-mysql.properties @@ -2,6 +2,6 @@ database=mysql spring.datasource.url=jdbc:mysql://localhost/petclinic spring.datasource.username=root -spring.datasource.password=petclinic +spring.datasource.password=${DB_PASSWORD} # Uncomment this the first time the app runs # spring.datasource.initialization-mode=always diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html index b9026690..1fbf8b3b 100644 --- a/src/main/resources/templates/error.html +++ b/src/main/resources/templates/error.html @@ -3,9 +3,9 @@ - + Pets

Something happened...

Exception message

- \ No newline at end of file + diff --git a/src/test/java/org/springframework/samples/petclinic/owner/PetControllerTests.java b/src/test/java/org/springframework/samples/petclinic/owner/PetControllerTests.java index 2ffae302..fea64bce 100755 --- a/src/test/java/org/springframework/samples/petclinic/owner/PetControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/owner/PetControllerTests.java @@ -55,6 +55,7 @@ public class PetControllerTests { private static final int TEST_OWNER_ID = 1; + private static final String PETS_NEW_URL = "/owners/{ownerId}/pets/new"; private static final int TEST_PET_ID = 1; @@ -80,7 +81,7 @@ public void setup() { @Test public void testInitCreationForm() throws Exception { - mockMvc.perform(get("/owners/{ownerId}/pets/new", TEST_OWNER_ID)) + mockMvc.perform(get(PETS_NEW_URL, TEST_OWNER_ID)) .andExpect(status().isOk()) .andExpect(view().name("pets/createOrUpdatePetForm")) .andExpect(model().attributeExists("pet")); @@ -88,7 +89,7 @@ public void testInitCreationForm() throws Exception { @Test public void testProcessCreationFormSuccess() throws Exception { - mockMvc.perform(post("/owners/{ownerId}/pets/new", TEST_OWNER_ID) + mockMvc.perform(post(PETS_NEW_URL, TEST_OWNER_ID) .param("name", "Betty") .param("type", "hamster") .param("birthDate", "2015-02-12")