Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: MatheusVict <[email protected]>
  • Loading branch information
MatheusVict committed Nov 27, 2023
1 parent 3dffb76 commit 5765b62
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "adoptions")
@Entity
@Table(name = "adoptions")
public class Adoption {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class User implements UserDetails {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id = 0L;

@GeneratedValue(strategy = GenerationType.UUID)
private String uuid = "";

@Column(nullable = false)
Expand Down

This file was deleted.

10 changes: 10 additions & 0 deletions src/main/resources/templates/change_password.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
class PostsRepositoryTest {

@Autowired
private PostsRepository postsRepository;
private UserRepository userRepository;

@Autowired
private UserRepository userRepository;
private PostsRepository postsRepository;

@BeforeEach
void setUp() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.pet.foundation.pataamiga.service.impl;

import com.pet.foundation.pataamiga.domain.email.dto.EmailDTO;
import com.pet.foundation.pataamiga.domain.user.User;
import com.pet.foundation.pataamiga.exceptions.EmailAlreadyExists;
import com.pet.foundation.pataamiga.exceptions.UserNotFoundException;
import com.pet.foundation.pataamiga.repositories.UserRepository;
import com.pet.foundation.pataamiga.service.EmailService;
import com.pet.foundation.pataamiga.utils.CreateUserDTOCreator;
import com.pet.foundation.pataamiga.utils.UserCreator;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -30,6 +32,9 @@ class UserServiceTest {
@Mock
private UserRepository userRepository;

@Mock
private EmailService emailService;

@BeforeEach
void setUp() {

Expand All @@ -41,6 +46,8 @@ void setUp() {

BDDMockito.when(userRepository.save(ArgumentMatchers.any(User.class)))
.thenReturn(UserCreator.returnValidUser());

BDDMockito.doNothing().when(emailService).sendEmail(ArgumentMatchers.any(EmailDTO.class));
}

@AfterEach
Expand Down

0 comments on commit 5765b62

Please sign in to comment.