Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI-generated Sonarqube issue remediation: remediation_branch-2024-08-30_22-23 -> master #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class CacheConfiguration {

@Bean
public JCacheManagerCustomizer petclinicCacheConfigurationCustomizer() {
return cm -> {
cm.createCache("vets", cacheConfiguration());
};
return cm -> cm.createCache("vets", cacheConfiguration());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-mysql.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/main/resources/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'error')}">

<body>
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}"/>
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}" alt="Pets"/>
<h2>Something happened...</h2>
<p th:text="${message}">Exception message</p>
</body>

</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand All @@ -80,15 +81,15 @@ 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"));
}

@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")
Expand Down