global catastrofe
This commit is contained in:
parent
20bc1999f5
commit
451230933b
@ -12,14 +12,14 @@ import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.service.AuthorService;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.service.BookService;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.service.UserService;
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.authors.AuthorService;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.books.BookService;
|
||||
import com.ip.library.controllers.types.TypeEntity;
|
||||
import com.ip.library.controllers.types.TypeService;
|
||||
import com.ip.library.controllers.users.UserEntity;
|
||||
import com.ip.library.controllers.users.UserService;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.authors.api;
|
||||
package com.ip.library.controllers.authors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,10 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ip.library.controllers.users.UserRole;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.service.AuthorService;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.authors.api;
|
||||
package com.ip.library.controllers.authors;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.ip.library.authors.model;
|
||||
package com.ip.library.controllers.authors;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ip.library.authors_books.model.AuthorsBooksEntity;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.controllers.authors_books.AuthorsBooksEntity;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.core.model.BaseEntity;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
@ -1,12 +1,10 @@
|
||||
package com.ip.library.authors.repository;
|
||||
package com.ip.library.controllers.authors;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
|
||||
public interface AuthorRepository extends
|
||||
CrudRepository<AuthorEntity, Long>,
|
||||
PagingAndSortingRepository<AuthorEntity, Long> {
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.authors.service;
|
||||
package com.ip.library.controllers.authors;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.StreamSupport;
|
||||
@ -7,8 +7,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.repository.AuthorRepository;
|
||||
|
||||
@Service
|
||||
public class AuthorService {
|
@ -1,9 +1,9 @@
|
||||
package com.ip.library.authors_books.model;
|
||||
package com.ip.library.controllers.authors_books;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.authors_books.model;
|
||||
package com.ip.library.controllers.authors_books;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.books.api;
|
||||
package com.ip.library.controllers.books;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -14,11 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.service.BookService;
|
||||
import com.ip.library.controllers.types.TypeService;
|
||||
import com.ip.library.controllers.users.UserRole;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.books.api;
|
||||
package com.ip.library.controllers.books;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -1,11 +1,10 @@
|
||||
package com.ip.library.books.model;
|
||||
package com.ip.library.controllers.books;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ip.library.core.model.BaseEntity;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
@ -17,8 +16,9 @@ import jakarta.persistence.OneToMany;
|
||||
import jakarta.persistence.OrderBy;
|
||||
import jakarta.persistence.Table;
|
||||
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors_books.model.AuthorsBooksEntity;
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.authors_books.AuthorsBooksEntity;
|
||||
import com.ip.library.controllers.types.TypeEntity;
|
||||
|
||||
@Entity
|
||||
@Table(name = "books")
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.books.repository;
|
||||
package com.ip.library.controllers.books;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -9,8 +9,6 @@ import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
|
||||
public interface BookRepository extends
|
||||
CrudRepository<BookEntity, Long>,
|
||||
PagingAndSortingRepository<BookEntity, Long> {
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.books.service;
|
||||
package com.ip.library.controllers.books;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.StreamSupport;
|
||||
@ -8,10 +8,8 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.service.AuthorService;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.repository.BookRepository;
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.authors.AuthorService;
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
|
||||
@Service
|
@ -1,9 +1,9 @@
|
||||
package com.ip.library.favorites.model;
|
||||
package com.ip.library.controllers.favorites;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.users.UserEntity;
|
||||
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.favorites.model;
|
||||
package com.ip.library.controllers.favorites;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.types.api;
|
||||
package com.ip.library.controllers.types;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -13,10 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ip.library.controllers.users.UserRole;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.types.api;
|
||||
package com.ip.library.controllers.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.types.model;
|
||||
package com.ip.library.controllers.types;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -1,11 +1,9 @@
|
||||
package com.ip.library.types.repository;
|
||||
package com.ip.library.controllers.types;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
|
||||
public interface TypeRepository extends CrudRepository<TypeEntity, Long> {
|
||||
Optional<TypeEntity> findByNameIgnoreCase(String name);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.types.service;
|
||||
package com.ip.library.controllers.types;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.StreamSupport;
|
||||
@ -7,8 +7,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.repository.TypeRepository;
|
||||
|
||||
@Service
|
||||
public class TypeService {
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.api;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.service.UserService;
|
||||
|
||||
@RestController
|
||||
public class LoginController {
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.api;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -10,11 +10,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ip.library.books.api.BookDto;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.controllers.books.BookDto;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.users.service.UserService;
|
||||
|
||||
@RestController
|
||||
@Secured(value = { UserRole.Secured.USER, UserRole.Secured.ADMIN })
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.api;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import org.modelmapper.ModelMapper;
|
||||
import org.springframework.security.access.annotation.Secured;
|
||||
@ -15,9 +15,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ip.library.core.api.PageDto;
|
||||
import com.ip.library.core.api.PageDtoMapper;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.users.service.UserService;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.api;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
@ -1,12 +1,12 @@
|
||||
package com.ip.library.users.model;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.favorites.FavoriteEntity;
|
||||
import com.ip.library.core.model.BaseEntity;
|
||||
import com.ip.library.favorites.model.FavoriteEntity;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.repository;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -9,8 +9,7 @@ import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
|
||||
public interface UserRepository extends
|
||||
CrudRepository<UserEntity, Long>,
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.model;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.ip.library.users.service;
|
||||
package com.ip.library.controllers.users;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@ -14,16 +14,13 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.service.BookService;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.books.BookService;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.core.jwt.JwtException;
|
||||
import com.ip.library.core.jwt.JwtProvider;
|
||||
import com.ip.library.core.security.UserPrincipal;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.users.repository.UserRepository;
|
||||
|
||||
@Service
|
||||
public class UserService implements UserDetailsService{
|
||||
@ -77,6 +74,8 @@ public class UserService implements UserDetailsService{
|
||||
public UserEntity create(UserEntity entity) {
|
||||
if (entity == null)
|
||||
throw new IllegalArgumentException("Entity is null");
|
||||
if (entity.getPassword() == null)
|
||||
throw new IllegalArgumentException("Entity.GetPassword is null");
|
||||
checkLoginUniqueness(entity.getLogin());
|
||||
final String password = Optional.ofNullable(entity.getPassword()).orElse("");
|
||||
entity.setPassword(
|
@ -10,7 +10,7 @@ import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
import com.ip.library.users.service.UserService;
|
||||
import com.ip.library.controllers.users.UserService;
|
||||
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
|
@ -21,11 +21,11 @@ import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
import com.ip.library.controllers.users.UserRole;
|
||||
import com.ip.library.controllers.users.UserService;
|
||||
import com.ip.library.core.configuration.Constants;
|
||||
import com.ip.library.core.error.AdviceController;
|
||||
import com.ip.library.core.jwt.JwtFilter;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.users.service.UserService;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
|
@ -6,7 +6,7 @@ import java.util.Set;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.controllers.users.UserEntity;
|
||||
|
||||
public class UserPrincipal implements UserDetails {
|
||||
private final long id;
|
||||
|
@ -8,9 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.authors.AuthorService;
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.service.AuthorService;
|
||||
|
||||
@SpringBootTest
|
||||
class AuthorsTests {
|
||||
|
@ -11,12 +11,12 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
import com.ip.library.authors.model.AuthorEntity;
|
||||
import com.ip.library.authors.service.AuthorService;
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.service.BookService;
|
||||
import com.ip.library.controllers.authors.AuthorEntity;
|
||||
import com.ip.library.controllers.authors.AuthorService;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.books.BookService;
|
||||
import com.ip.library.controllers.types.TypeEntity;
|
||||
import com.ip.library.controllers.types.TypeService;
|
||||
|
||||
@SpringBootTest
|
||||
class BooksTests {
|
||||
|
@ -9,12 +9,12 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import com.ip.library.books.model.BookEntity;
|
||||
import com.ip.library.books.service.BookService;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.service.UserService;
|
||||
import com.ip.library.controllers.books.BookEntity;
|
||||
import com.ip.library.controllers.books.BookService;
|
||||
import com.ip.library.controllers.types.TypeEntity;
|
||||
import com.ip.library.controllers.types.TypeService;
|
||||
import com.ip.library.controllers.users.UserEntity;
|
||||
import com.ip.library.controllers.users.UserService;
|
||||
|
||||
@SpringBootTest
|
||||
class FavoritesTests {
|
||||
|
@ -8,9 +8,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
|
||||
import com.ip.library.controllers.types.TypeEntity;
|
||||
import com.ip.library.controllers.types.TypeService;
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.types.model.TypeEntity;
|
||||
import com.ip.library.types.service.TypeService;
|
||||
|
||||
@SpringBootTest
|
||||
class TypesTests {
|
||||
|
@ -7,16 +7,19 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
import com.ip.library.controllers.users.UserEntity;
|
||||
import com.ip.library.controllers.users.UserRole;
|
||||
import com.ip.library.controllers.users.UserService;
|
||||
import com.ip.library.core.error.NotFoundException;
|
||||
import com.ip.library.users.model.UserEntity;
|
||||
import com.ip.library.users.model.UserRole;
|
||||
import com.ip.library.users.service.UserService;
|
||||
|
||||
@SpringBootTest
|
||||
class UsersTests {
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
private UserEntity user;
|
||||
|
||||
@AfterEach
|
||||
@ -36,7 +39,7 @@ class UsersTests {
|
||||
void createTest() {
|
||||
Assertions.assertEquals(3, userService.getAll().size());
|
||||
Assertions.assertEquals("user3", user.getLogin());
|
||||
Assertions.assertEquals("aqw2sed45", user.getPassword());
|
||||
Assertions.assertTrue(passwordEncoder.matches("aqw2sed45", user.getPassword()));
|
||||
Assertions.assertEquals(UserRole.USER, user.getRole());
|
||||
Assertions.assertEquals(0, user.getFavorites().size());
|
||||
}
|
||||
@ -102,7 +105,7 @@ class UsersTests {
|
||||
@Test
|
||||
void nullPasswordTest() {
|
||||
Assertions.assertThrows(
|
||||
DataIntegrityViolationException.class,
|
||||
IllegalArgumentException.class,
|
||||
() -> userService.create(new UserEntity(user.getLogin() + "TEST", null))
|
||||
);
|
||||
Assertions.assertThrows(
|
||||
|
Loading…
Reference in New Issue
Block a user