diff --git a/backend/src/main/java/com/greenfoxacademy/backend/controller/OwnerController.java b/backend/src/main/java/com/greenfoxacademy/backend/controller/OwnerController.java index fe3890e..7766107 100644 --- a/backend/src/main/java/com/greenfoxacademy/backend/controller/OwnerController.java +++ b/backend/src/main/java/com/greenfoxacademy/backend/controller/OwnerController.java @@ -13,7 +13,6 @@ import com.greenfoxacademy.backend.services.user.OwnerService; import java.security.Principal; import java.util.UUID; - import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/backend/src/main/java/com/greenfoxacademy/backend/models/User.java b/backend/src/main/java/com/greenfoxacademy/backend/models/User.java index bd4beb6..7fc4078 100644 --- a/backend/src/main/java/com/greenfoxacademy/backend/models/User.java +++ b/backend/src/main/java/com/greenfoxacademy/backend/models/User.java @@ -4,9 +4,7 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.MappedSuperclass; - import java.util.UUID; - import lombok.AllArgsConstructor; import lombok.Data; import lombok.Getter; @@ -31,6 +29,7 @@ public abstract class User implements UserDetails { private Long id; private String firstName; private String lastName; + @Column(unique = true) private String email; private String password; diff --git a/backend/src/test/java/com/greenfoxacademy/backend/services/pet/AddPetServiceImplTest.java b/backend/src/test/java/com/greenfoxacademy/backend/services/pet/AddPetServiceImplTest.java index 025a042..258639d 100644 --- a/backend/src/test/java/com/greenfoxacademy/backend/services/pet/AddPetServiceImplTest.java +++ b/backend/src/test/java/com/greenfoxacademy/backend/services/pet/AddPetServiceImplTest.java @@ -30,8 +30,8 @@ class AddPetServiceImplTest { @Test void petSuccessfullyAddedToPetRepository() { - CreatePetDto pet = new CreatePetDto("Morzsi","Dog","Male",new Date(2024,9,13)); - petService.addPet("owner",pet); + CreatePetDto pet = new CreatePetDto("Morzsi", "Dog", "Male", new Date(2024, 9, 13)); + petService.addPet("owner", pet); verify(petService, times(1)).addPet("owner", pet); } diff --git a/frontend/src/pages/Logout.test.tsx b/frontend/src/pages/Logout.test.tsx index 55fecaf..881e64b 100644 --- a/frontend/src/pages/Logout.test.tsx +++ b/frontend/src/pages/Logout.test.tsx @@ -1,5 +1,5 @@ import { render } from "@testing-library/react"; -import {describe, expect, it, vi} from "vitest"; +import { describe, expect, it, vi } from "vitest"; import { usePetClinicState } from "../state"; import { Logout } from "./Logout"; diff --git a/frontend/src/pages/PetList.test.tsx b/frontend/src/pages/PetList.test.tsx index 0526c87..35a2e7e 100644 --- a/frontend/src/pages/PetList.test.tsx +++ b/frontend/src/pages/PetList.test.tsx @@ -1,7 +1,7 @@ import { ChakraProvider } from "@chakra-ui/react"; import { render, screen, waitFor } from "@testing-library/react"; import { BrowserRouter } from "react-router-dom"; -import {describe, expect, Mock, test, vi} from "vitest"; +import { type Mock, describe, expect, test, vi } from "vitest"; import { petList } from "../httpClient"; import { PetList } from "./PetList"; diff --git a/frontend/src/pages/utils/ProtectedPage.test.tsx b/frontend/src/pages/utils/ProtectedPage.test.tsx index 117f890..cdfcb48 100644 --- a/frontend/src/pages/utils/ProtectedPage.test.tsx +++ b/frontend/src/pages/utils/ProtectedPage.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from "@testing-library/react"; import { BrowserRouter } from "react-router-dom"; -import {describe, expect, vi, test} from "vitest"; +import { describe, expect, test, vi } from "vitest"; import { usePetClinicState } from "../../state"; import { ProtectedPage } from "./ProtectedPage";