From 9eb54aa700a857ce0e1bf9d5fbba27e0dc042865 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 12:35:40 -0300 Subject: [PATCH 01/65] feat: add user entity Signed-off-by: MatheusVict --- .../semprealerta/domain/user/Address.java | 19 ++++++ .../semprealerta/domain/user/Contact.java | 17 ++++++ .../semprealerta/domain/user/User.java | 59 +++++++++++++++++++ .../semprealerta/domain/user/UserRoles.java | 16 +++++ 4 files changed, 111 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java new file mode 100644 index 0000000..a281468 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java @@ -0,0 +1,19 @@ +package com.institutosemprealerta.semprealerta.domain.user; + +import jakarta.persistence.Embeddable; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@NoArgsConstructor +@Embeddable +public class Address { + private String street; + private String number; + private String city; + private String zipCode; +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java new file mode 100644 index 0000000..bd0b82e --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java @@ -0,0 +1,17 @@ +package com.institutosemprealerta.semprealerta.domain.user; + +import jakarta.persistence.Embeddable; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Embeddable +public class Contact { + private String email; + private String phone; +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java new file mode 100644 index 0000000..acf22b5 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java @@ -0,0 +1,59 @@ +package com.institutosemprealerta.semprealerta.domain.user; + + +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; +import java.util.HashSet; +import java.util.Set; + +@Entity +@Table(name = "users") +@Getter +@Setter +public class User { + @Id + private int registration; + private String name; + private String password; + private String gender; + private LocalDate birthDate; + + private UserRoles roles; + @Embedded + private Contact contact; + + @Embedded + private Address address; + + public User() { + this.registration = generateRegistration(); + } + + public User(String name, String password, String gender, LocalDate birthDate, UserRoles roles, Contact contact, Address address) { + this.registration = this.generateRegistration(); + this.name = name; + this.password = password; + this.gender = gender; + this.birthDate = birthDate; + this.roles = roles; + this.contact = contact; + this.address = address; + } + + private int generateRegistration() { + Set registrations = new HashSet<>(8); + + while (registrations.size() < 8) { + for (int i = 0; i < 8; i++) { + registrations.add((int) (Math.random() * 10)); + } + } + return Integer.parseInt(registrations.toString()); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java new file mode 100644 index 0000000..b3e1b1e --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java @@ -0,0 +1,16 @@ +package com.institutosemprealerta.semprealerta.domain.user; + +public enum UserRoles { + ADMIN("ADMIN"), + USER("USER"); + + private final String role; + + UserRoles(String role) { + this.role = role; + } + + public String getRole() { + return role; + } +} From f5fbef3cffe27eaaa82714489d3c8fea2137b793 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 12:50:35 -0300 Subject: [PATCH 02/65] feat: add migrations Signed-off-by: MatheusVict --- src/main/resources/application-dev.yml | 16 ++++++++++++++++ src/main/resources/application-prod.yml | 0 src/main/resources/application.properties | 1 - .../db/migration/V1__create-user-table.sql | 16 ++++++++++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/application-dev.yml create mode 100644 src/main/resources/application-prod.yml delete mode 100644 src/main/resources/application.properties create mode 100644 src/main/resources/db/migration/V1__create-user-table.sql diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..3d8bee0 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,16 @@ +spring: + datasource: + url: jdbc:postgresql://localhost:5432/postgres?serverTimezone=UTC + username: postgres + password: 123 + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + flyway: + enabled: true + locations: classpath:db/migration + baseline-on-migrate: true \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/resources/db/migration/V1__create-user-table.sql b/src/main/resources/db/migration/V1__create-user-table.sql new file mode 100644 index 0000000..df12367 --- /dev/null +++ b/src/main/resources/db/migration/V1__create-user-table.sql @@ -0,0 +1,16 @@ +CREATE TABLE users +( + registration INTEGER NOT NULL, + name VARCHAR(255), + password VARCHAR(255), + gender VARCHAR(255), + birth_date date, + roles SMALLINT, + email VARCHAR(255), + phone VARCHAR(255), + street VARCHAR(255), + number VARCHAR(255), + city VARCHAR(255), + zip_code VARCHAR(255), + CONSTRAINT pk_users PRIMARY KEY (registration) +); \ No newline at end of file From 4982e86ca1dbd2d3ea809339ca2e481d06da0ebb Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 13:00:51 -0300 Subject: [PATCH 03/65] repository Signed-off-by: MatheusVict --- .../semprealerta/repository/UserRepository.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java new file mode 100644 index 0000000..7a8d0e9 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.repository; + +import com.institutosemprealerta.semprealerta.domain.user.User; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface UserRepository extends JpaRepository { +} From 63e36c20cb8943733f28a01ca769d258d1dc2f95 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 13:58:12 -0300 Subject: [PATCH 04/65] feat: add repository hexagonal --- .../domain/ports/out/UserRepository.java | 14 ++++++ .../semprealerta/domain/user/User.java | 2 + .../adpters/JpaUserRepositoryAdapter.java | 47 +++++++++++++++++++ .../repositories/JpaUserRepository.java | 9 ++++ .../repository/UserRepository.java | 7 --- 5 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java delete mode 100644 src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java new file mode 100644 index 0000000..d365ca8 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java @@ -0,0 +1,14 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out; + +import com.institutosemprealerta.semprealerta.domain.user.User; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.Optional; + +public interface UserRepository { + void save(User user); + Optional findById(int id); + void update(int id, User user); + void delete(int id); + +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java index acf22b5..61765fc 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java @@ -7,6 +7,7 @@ import jakarta.persistence.Table; import lombok.Getter; import lombok.Setter; +import org.hibernate.annotations.DynamicUpdate; import java.time.LocalDate; import java.util.HashSet; @@ -14,6 +15,7 @@ @Entity @Table(name = "users") +@DynamicUpdate @Getter @Setter public class User { diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java new file mode 100644 index 0000000..22cfa7b --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -0,0 +1,47 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +import java.util.Optional; + +@Component +public class JpaUserRepositoryAdapter implements UserRepository { + + private final JpaUserRepository userRepository; + + public JpaUserRepositoryAdapter(JpaUserRepository jpaUserRepository) { + this.userRepository = jpaUserRepository; + } + + @Override + public void save(User user) { + this.userRepository.save(user); + } + + @Override + public Optional findById(int id) { + return this.userRepository.findById(id); + } + + @Override + public void update(int id, User user) { + User userToUpdate = this.userRepository.findById(id) + .orElseThrow(() -> new RuntimeException("User not found")); + + user.setRegistration(userToUpdate.getRegistration()); + + this.userRepository.save(user); + } + + @Override + public void delete(int id) { + User userToDelete = this.userRepository.findById(id) + .orElseThrow(() -> new RuntimeException("User not found")); + + this.userRepository.delete(userToDelete); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java new file mode 100644 index 0000000..5994731 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java @@ -0,0 +1,9 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.domain.user.User; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JpaUserRepository extends JpaRepository { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java deleted file mode 100644 index 7a8d0e9..0000000 --- a/src/main/java/com/institutosemprealerta/semprealerta/repository/UserRepository.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.institutosemprealerta.semprealerta.repository; - -import com.institutosemprealerta.semprealerta.domain.user.User; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface UserRepository extends JpaRepository { -} From 652112f795fee36bb91c5698ecfd6c4183cdbd34 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 14:14:06 -0300 Subject: [PATCH 05/65] feat: add find by email and registration --- .../semprealerta/domain/ports/out/UserRepository.java | 2 ++ .../adpters/JpaUserRepositoryAdapter.java | 10 ++++++++++ .../infrastructure/repositories/JpaUserRepository.java | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java index d365ca8..de6adee 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java @@ -10,5 +10,7 @@ public interface UserRepository { Optional findById(int id); void update(int id, User user); void delete(int id); + Optional findByRegistration(int registration); + Optional findByEmail(String email); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index 22cfa7b..aed38f8 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -44,4 +44,14 @@ public void delete(int id) { this.userRepository.delete(userToDelete); } + + @Override + public Optional findByRegistration(int registration) { + return this.userRepository.findById(registration); + } + + @Override + public Optional findByEmail(String email) { + return this.userRepository.findByEmail(email); + } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java index 5994731..1b7211f 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java @@ -2,8 +2,13 @@ import com.institutosemprealerta.semprealerta.domain.user.User; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; +import java.util.Optional; + @Repository public interface JpaUserRepository extends JpaRepository { + @Query("SELECT u FROM User u WHERE u.contact.email = ?1") + Optional findByEmail(String email); } From a1cce5b751c5bbdcaafb7c296729a8257078a6e9 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 14:14:36 -0300 Subject: [PATCH 06/65] feat: add user service Signed-off-by: MatheusVict --- .../application/service/UserService.java | 11 +++++ .../service/impl/UserServiceImpl.java | 43 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java new file mode 100644 index 0000000..842c8d6 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java @@ -0,0 +1,11 @@ +package com.institutosemprealerta.semprealerta.application.service; + +import com.institutosemprealerta.semprealerta.domain.user.User; + +public interface UserService { + void save(User user); + void update(int id, User user); + void delete(int id); + User findByRegistration(int registration); + User findByEmail(String email); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..f09d3b3 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java @@ -0,0 +1,43 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import org.springframework.stereotype.Service; + +@Service +public class UserServiceImpl implements UserService { + + private final UserRepository userRepository; + + public UserServiceImpl(UserRepository userRepository) { + this.userRepository = userRepository; + } + + @Override + public void save(User user) { + this.userRepository.save(user); + } + + @Override + public void update(int id, User user) { + this.userRepository.update(id, user); + } + + @Override + public void delete(int id) { + this.userRepository.delete(id); + } + + @Override + public User findByRegistration(int registration) { + return this.userRepository.findByRegistration(registration) + .orElseThrow(() -> new RuntimeException("User not found")); + } + + @Override + public User findByEmail(String email) { + return this.userRepository.findByEmail(email) + .orElseThrow(() -> new RuntimeException("User not found")); + } +} From 02bd8413786d3304399ffaefc54a0299896ed512 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 16:50:18 -0300 Subject: [PATCH 07/65] refactor: user directory --- .../domain/ports/model/UserDTO.java | 23 +++++++++++++++ .../entity}/user/Address.java | 2 +- .../entity}/user/Contact.java | 2 +- .../entity}/user/User.java | 28 +++++++++++++++---- .../entity}/user/UserRoles.java | 2 +- .../db/migration/V1__create-user-table.sql | 1 + 6 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java rename src/main/java/com/institutosemprealerta/semprealerta/{domain => infrastructure/entity}/user/Address.java (82%) rename src/main/java/com/institutosemprealerta/semprealerta/{domain => infrastructure/entity}/user/Contact.java (79%) rename src/main/java/com/institutosemprealerta/semprealerta/{domain => infrastructure/entity}/user/User.java (62%) rename src/main/java/com/institutosemprealerta/semprealerta/{domain => infrastructure/entity}/user/UserRoles.java (74%) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java new file mode 100644 index 0000000..3217d07 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java @@ -0,0 +1,23 @@ +package com.institutosemprealerta.semprealerta.domain.ports.model; + + +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; + +import java.time.LocalDate; + +public record UserDTO( + String name, + String email, + String password, + String phone, + String gender, + LocalDate birthDate, + UserRoles roles, + String street, + String number, + String city, + String zipCode + +) { + +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Address.java similarity index 82% rename from src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java rename to src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Address.java index a281468..9f09f59 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Address.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Address.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.domain.user; +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; import jakarta.persistence.Embeddable; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Contact.java similarity index 79% rename from src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java rename to src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Contact.java index bd0b82e..5c48e24 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/Contact.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/Contact.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.domain.user; +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; import jakarta.persistence.Embeddable; import lombok.AllArgsConstructor; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java similarity index 62% rename from src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java rename to src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 61765fc..67dc39a 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -1,15 +1,15 @@ -package com.institutosemprealerta.semprealerta.domain.user; +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; -import jakarta.persistence.Embedded; -import jakarta.persistence.Entity; -import jakarta.persistence.Id; -import jakarta.persistence.Table; +import com.institutosemprealerta.semprealerta.domain.ports.model.UserDTO; +import jakarta.persistence.*; import lombok.Getter; import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; import org.hibernate.annotations.DynamicUpdate; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.HashSet; import java.util.Set; @@ -33,6 +33,10 @@ public class User { @Embedded private Address address; + @CreationTimestamp + @Column(name = "created_at", updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") + private LocalDateTime createdAt; + public User() { this.registration = generateRegistration(); } @@ -48,6 +52,20 @@ public User(String name, String password, String gender, LocalDate birthDate, Us this.address = address; } + public User fromModelToDomain(UserDTO dto) { + return new User( + dto.name(), + dto.password(), + dto.gender(), + dto.birthDate(), + dto.roles(), + new Contact(dto.email(), dto.phone()), + new Address(dto.street(), dto.number(), dto.city(), dto.zipCode()) + ); + } + + + private int generateRegistration() { Set registrations = new HashSet<>(8); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserRoles.java similarity index 74% rename from src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java rename to src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserRoles.java index b3e1b1e..330bb8f 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/user/UserRoles.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserRoles.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.domain.user; +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; public enum UserRoles { ADMIN("ADMIN"), diff --git a/src/main/resources/db/migration/V1__create-user-table.sql b/src/main/resources/db/migration/V1__create-user-table.sql index df12367..69b1979 100644 --- a/src/main/resources/db/migration/V1__create-user-table.sql +++ b/src/main/resources/db/migration/V1__create-user-table.sql @@ -6,6 +6,7 @@ CREATE TABLE users gender VARCHAR(255), birth_date date, roles SMALLINT, + created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW(), email VARCHAR(255), phone VARCHAR(255), street VARCHAR(255), From d2053870d6ed40b7fc4c32073bc14825bca8eb00 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 16:51:09 -0300 Subject: [PATCH 08/65] refactor: user repository to use adapter --- .../semprealerta/domain/ports/out/UserRepository.java | 3 +-- .../infrastructure/adpters/JpaUserRepositoryAdapter.java | 3 +-- .../infrastructure/repositories/JpaUserRepository.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java index de6adee..c28d170 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java @@ -1,7 +1,6 @@ package com.institutosemprealerta.semprealerta.domain.ports.out; -import com.institutosemprealerta.semprealerta.domain.user.User; -import org.springframework.data.jpa.repository.JpaRepository; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import java.util.Optional; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index aed38f8..6d06612 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -1,9 +1,8 @@ package com.institutosemprealerta.semprealerta.infrastructure.adpters; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; -import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Component; import java.util.Optional; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java index 1b7211f..84cf8d5 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java @@ -1,6 +1,6 @@ package com.institutosemprealerta.semprealerta.infrastructure.repositories; -import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; From 673d8d6372b78f0544f354f938fa1f24d69d65a8 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 16:51:33 -0300 Subject: [PATCH 09/65] feat: user service Signed-off-by: MatheusVict --- .../semprealerta/application/service/UserService.java | 2 +- .../semprealerta/application/service/impl/UserServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java index 842c8d6..97594ef 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java @@ -1,6 +1,6 @@ package com.institutosemprealerta.semprealerta.application.service; -import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; public interface UserService { void save(User user); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java index f09d3b3..201253e 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java @@ -1,7 +1,7 @@ package com.institutosemprealerta.semprealerta.application.service.impl; import com.institutosemprealerta.semprealerta.application.service.UserService; -import com.institutosemprealerta.semprealerta.domain.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; import org.springframework.stereotype.Service; From e6cb55f90f60966270e3423a8300ed5144421363 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 20:03:47 -0300 Subject: [PATCH 10/65] feat: controller --- .../semprealerta/domain/model/UserDTO.java | 51 +++++++++++++++++++ .../domain/ports/model/UserDTO.java | 23 --------- .../domain/ports/out/UserResponse.java | 35 +++++++++++++ .../controllers/UserController.java | 44 ++++++++++++++++ .../semprealerta/utils/DateManipulation.java | 16 ++++++ 5 files changed, 146 insertions(+), 23 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java delete mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/utils/DateManipulation.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java new file mode 100644 index 0000000..0c10584 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java @@ -0,0 +1,51 @@ +package com.institutosemprealerta.semprealerta.domain.model; + + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; +import com.institutosemprealerta.semprealerta.utils.DateManipulation; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +public record UserDTO( + String name, + String email, + String password, + String phone, + String gender, + String birthDate, + UserRoles roles, + String street, + String number, + String city, + String zipCode + +) { + public User toDomain() { + LocalDate birth = DateManipulation.stringToLocalDate(birthDate); + Contact contact = new Contact( + email, + phone + ); + + Address address = new Address( + street, + number, + city, + zipCode + ); + return new User( + name, + password, + gender, + birth, + roles, + contact, + address + ); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java deleted file mode 100644 index 3217d07..0000000 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/model/UserDTO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.institutosemprealerta.semprealerta.domain.ports.model; - - -import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; - -import java.time.LocalDate; - -public record UserDTO( - String name, - String email, - String password, - String phone, - String gender, - LocalDate birthDate, - UserRoles roles, - String street, - String number, - String city, - String zipCode - -) { - -} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java new file mode 100644 index 0000000..aad8f91 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java @@ -0,0 +1,35 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; +import jakarta.persistence.Embedded; + +import java.time.LocalDate; + +public record UserResponse( + int registration, + String name, + + String gender, + LocalDate birthDate, + + UserRoles roles, + + Contact contact, + Address address +) { + + public static UserResponse toResponse(User user) { + return new UserResponse( + user.getRegistration(), + user.getName(), + user.getGender(), + user.getBirthDate(), + user.getRoles(), + user.getContact(), + user.getAddress() + ); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java new file mode 100644 index 0000000..10626eb --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -0,0 +1,44 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.UserResponse; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import org.apache.catalina.connector.Response; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +@RestController +@RequestMapping("api/v1/user") +public class UserController { + + private final UserService userService; + + public UserController(UserService userService) { + this.userService = userService; + } + + @PostMapping + public ResponseEntity createUser(@RequestBody UserDTO user) { + userService.save(user.toDomain()); + return ResponseEntity.status(Response.SC_CREATED).build(); + } + + @GetMapping("/{id}") + public ResponseEntity findById(@PathVariable int id) { + User userFound = userService.findByRegistration(id); + return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); + } + + @PutMapping("/{id}") + public ResponseEntity updateUser(@PathVariable int id, @RequestBody UserDTO user) { + userService.update(id, user.toDomain()); + return ResponseEntity.status(Response.SC_NO_CONTENT).build(); + } + + @DeleteMapping("/{id}") + public ResponseEntity deleteUser(@PathVariable int id) { + userService.delete(id); + return ResponseEntity.status(Response.SC_NO_CONTENT).build(); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/utils/DateManipulation.java b/src/main/java/com/institutosemprealerta/semprealerta/utils/DateManipulation.java new file mode 100644 index 0000000..9a4e128 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/utils/DateManipulation.java @@ -0,0 +1,16 @@ +package com.institutosemprealerta.semprealerta.utils; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; + +public abstract class DateManipulation { + public static LocalDate stringToLocalDate(String date) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + return LocalDate.parse(date, formatter); + } + + public static String localDateToString(LocalDate date) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + return date.format(formatter); + } +} From 996b705f919111aa6ed29fbe27815407abf34350 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 20:12:43 -0300 Subject: [PATCH 11/65] feat: find by registration Signed-off-by: MatheusVict --- .../application/service/UserService.java | 1 + .../service/impl/UserServiceImpl.java | 6 ++++++ .../adpters/JpaUserRepositoryAdapter.java | 2 +- .../controllers/UserController.java | 8 +++++++- .../infrastructure/entity/user/User.java | 18 +++++++++++++----- .../repositories/JpaUserRepository.java | 2 ++ .../db/migration/V1__create-user-table.sql | 10 +++++++--- 7 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java index 97594ef..faebd2a 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java @@ -8,4 +8,5 @@ public interface UserService { void delete(int id); User findByRegistration(int registration); User findByEmail(String email); + User findById(int id); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java index 201253e..56ea915 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java @@ -40,4 +40,10 @@ public User findByEmail(String email) { return this.userRepository.findByEmail(email) .orElseThrow(() -> new RuntimeException("User not found")); } + + @Override + public User findById(int id) { + return this.userRepository.findById(id) + .orElseThrow(() -> new RuntimeException("User not found")); + } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index 6d06612..a6b47e4 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -46,7 +46,7 @@ public void delete(int id) { @Override public Optional findByRegistration(int registration) { - return this.userRepository.findById(registration); + return this.userRepository.findByRegistration(registration); } @Override diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java index 10626eb..2860848 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -26,7 +26,13 @@ public ResponseEntity createUser(@RequestBody UserDTO user) { @GetMapping("/{id}") public ResponseEntity findById(@PathVariable int id) { - User userFound = userService.findByRegistration(id); + User userFound = userService.findById(id); + return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); + } + + @GetMapping("/registration/{reg}") + public ResponseEntity findByRegistration(@PathVariable int reg) { + User userFound = userService.findByRegistration(reg); return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 67dc39a..d56cd29 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -1,7 +1,8 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.user; -import com.institutosemprealerta.semprealerta.domain.ports.model.UserDTO; +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.utils.DateManipulation; import jakarta.persistence.*; import lombok.Getter; import lombok.Setter; @@ -10,6 +11,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -20,6 +22,9 @@ @Setter public class User { @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + @Column(unique = true) private int registration; private String name; private String password; @@ -53,11 +58,12 @@ public User(String name, String password, String gender, LocalDate birthDate, Us } public User fromModelToDomain(UserDTO dto) { + LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate()); return new User( dto.name(), dto.password(), dto.gender(), - dto.birthDate(), + birth, dto.roles(), new Contact(dto.email(), dto.phone()), new Address(dto.street(), dto.number(), dto.city(), dto.zipCode()) @@ -65,15 +71,17 @@ public User fromModelToDomain(UserDTO dto) { } - private int generateRegistration() { Set registrations = new HashSet<>(8); while (registrations.size() < 8) { for (int i = 0; i < 8; i++) { - registrations.add((int) (Math.random() * 10)); + int digit = (int) (Math.random() * 9) + 1; + registrations.add(digit); } } - return Integer.parseInt(registrations.toString()); + StringBuilder builder = new StringBuilder(); + registrations.forEach(builder::append); + return Integer.parseInt(builder.toString()); } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java index 84cf8d5..ec8fcca 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java @@ -11,4 +11,6 @@ public interface JpaUserRepository extends JpaRepository { @Query("SELECT u FROM User u WHERE u.contact.email = ?1") Optional findByEmail(String email); + + Optional findByRegistration(int registration); } diff --git a/src/main/resources/db/migration/V1__create-user-table.sql b/src/main/resources/db/migration/V1__create-user-table.sql index 69b1979..0f68b6c 100644 --- a/src/main/resources/db/migration/V1__create-user-table.sql +++ b/src/main/resources/db/migration/V1__create-user-table.sql @@ -1,6 +1,7 @@ CREATE TABLE users ( - registration INTEGER NOT NULL, + id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, + registration INTEGER, name VARCHAR(255), password VARCHAR(255), gender VARCHAR(255), @@ -13,5 +14,8 @@ CREATE TABLE users number VARCHAR(255), city VARCHAR(255), zip_code VARCHAR(255), - CONSTRAINT pk_users PRIMARY KEY (registration) -); \ No newline at end of file + CONSTRAINT pk_users PRIMARY KEY (id) +); + +ALTER TABLE users + ADD CONSTRAINT uc_users_registration UNIQUE (registration); \ No newline at end of file From c6447ee01f74f5c40d5f99fd110dda60904f19a4 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 20:17:57 -0300 Subject: [PATCH 12/65] fix: update user by id dupicitly Signed-off-by: MatheusVict --- .../infrastructure/adpters/JpaUserRepositoryAdapter.java | 1 + .../semprealerta/infrastructure/entity/user/User.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index a6b47e4..47d79cf 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -31,6 +31,7 @@ public void update(int id, User user) { User userToUpdate = this.userRepository.findById(id) .orElseThrow(() -> new RuntimeException("User not found")); + user.setId(userToUpdate.getId()); user.setRegistration(userToUpdate.getRegistration()); this.userRepository.save(user); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index d56cd29..893f4bc 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -17,7 +17,6 @@ @Entity @Table(name = "users") -@DynamicUpdate @Getter @Setter public class User { From 47cf7dd6c72f8deec4871eccb2ee0806d09adf9a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 20:56:52 -0300 Subject: [PATCH 13/65] feat: add unique registration Signed-off-by: MatheusVict --- .../application/service/UserService.java | 2 +- .../service/impl/UserServiceImpl.java | 2 +- .../domain/ports/out/UserRepository.java | 2 +- .../domain/ports/out/UserResponse.java | 2 +- .../adpters/JpaUserRepositoryAdapter.java | 4 +- .../controllers/UserController.java | 2 +- .../infrastructure/entity/user/User.java | 44 +++++++++---------- .../repositories/JpaUserRepository.java | 2 +- .../semprealerta/utils/HashGeneration.java | 10 +++++ .../db/migration/V1__create-user-table.sql | 2 +- 10 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/utils/HashGeneration.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java index faebd2a..f84b57d 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java @@ -6,7 +6,7 @@ public interface UserService { void save(User user); void update(int id, User user); void delete(int id); - User findByRegistration(int registration); + User findByRegistration(String registration); User findByEmail(String email); User findById(int id); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java index 56ea915..732d5f3 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java @@ -30,7 +30,7 @@ public void delete(int id) { } @Override - public User findByRegistration(int registration) { + public User findByRegistration(String registration) { return this.userRepository.findByRegistration(registration) .orElseThrow(() -> new RuntimeException("User not found")); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java index c28d170..42c6d51 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserRepository.java @@ -9,7 +9,7 @@ public interface UserRepository { Optional findById(int id); void update(int id, User user); void delete(int id); - Optional findByRegistration(int registration); + Optional findByRegistration(String registration); Optional findByEmail(String email); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java index aad8f91..d931ef0 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java @@ -9,7 +9,7 @@ import java.time.LocalDate; public record UserResponse( - int registration, + String registration, String name, String gender, diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index 47d79cf..f7e27a1 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -46,7 +46,7 @@ public void delete(int id) { } @Override - public Optional findByRegistration(int registration) { + public Optional findByRegistration(String registration) { return this.userRepository.findByRegistration(registration); } @@ -54,4 +54,6 @@ public Optional findByRegistration(int registration) { public Optional findByEmail(String email) { return this.userRepository.findByEmail(email); } + + } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java index 2860848..20855bb 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -31,7 +31,7 @@ public ResponseEntity findById(@PathVariable int id) { } @GetMapping("/registration/{reg}") - public ResponseEntity findByRegistration(@PathVariable int reg) { + public ResponseEntity findByRegistration(@PathVariable String reg) { User userFound = userService.findByRegistration(reg); return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 893f4bc..591c8a3 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -7,13 +7,11 @@ import lombok.Getter; import lombok.Setter; import org.hibernate.annotations.CreationTimestamp; -import org.hibernate.annotations.DynamicUpdate; import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; +import java.util.Random; + @Entity @Table(name = "users") @@ -24,7 +22,7 @@ public class User { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(unique = true) - private int registration; + private String registration; private String name; private String password; private String gender; @@ -42,11 +40,10 @@ public class User { private LocalDateTime createdAt; public User() { - this.registration = generateRegistration(); } + public User(String name, String password, String gender, LocalDate birthDate, UserRoles roles, Contact contact, Address address) { - this.registration = this.generateRegistration(); this.name = name; this.password = password; this.gender = gender; @@ -56,6 +53,24 @@ public User(String name, String password, String gender, LocalDate birthDate, Us this.address = address; } + @PrePersist + public void generateRegistration() { + String prefix = this.name.substring(0, 3).toLowerCase() + "-"; + this.registration = generateRegistration(prefix); + } + + private String generateRegistration(String prefix) { + StringBuilder registration = new StringBuilder(prefix); + Random random = new Random(); + + for (int i = 0; i < 8; i++) { + int digit = random.nextInt(10); + registration.append(digit); + } + + return registration.toString(); + } + public User fromModelToDomain(UserDTO dto) { LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate()); return new User( @@ -68,19 +83,4 @@ public User fromModelToDomain(UserDTO dto) { new Address(dto.street(), dto.number(), dto.city(), dto.zipCode()) ); } - - - private int generateRegistration() { - Set registrations = new HashSet<>(8); - - while (registrations.size() < 8) { - for (int i = 0; i < 8; i++) { - int digit = (int) (Math.random() * 9) + 1; - registrations.add(digit); - } - } - StringBuilder builder = new StringBuilder(); - registrations.forEach(builder::append); - return Integer.parseInt(builder.toString()); - } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java index ec8fcca..fd4967e 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepository.java @@ -12,5 +12,5 @@ public interface JpaUserRepository extends JpaRepository { @Query("SELECT u FROM User u WHERE u.contact.email = ?1") Optional findByEmail(String email); - Optional findByRegistration(int registration); + Optional findByRegistration(String registration); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/utils/HashGeneration.java b/src/main/java/com/institutosemprealerta/semprealerta/utils/HashGeneration.java new file mode 100644 index 0000000..a884f31 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/utils/HashGeneration.java @@ -0,0 +1,10 @@ +package com.institutosemprealerta.semprealerta.utils; + +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +public abstract class HashGeneration { + + +} diff --git a/src/main/resources/db/migration/V1__create-user-table.sql b/src/main/resources/db/migration/V1__create-user-table.sql index 0f68b6c..46d9da6 100644 --- a/src/main/resources/db/migration/V1__create-user-table.sql +++ b/src/main/resources/db/migration/V1__create-user-table.sql @@ -1,7 +1,7 @@ CREATE TABLE users ( id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, - registration INTEGER, + registration VARCHAR(255), name VARCHAR(255), password VARCHAR(255), gender VARCHAR(255), From ea36a40f680ee91892e2db8fec36328c76701bbe Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 20 Feb 2024 21:17:55 -0300 Subject: [PATCH 14/65] feat: validation dto Signed-off-by: MatheusVict --- .../semprealerta/domain/model/UserDTO.java | 13 ++++++++++--- .../infrastructure/controllers/UserController.java | 3 ++- .../infrastructure/entity/user/User.java | 4 ++-- src/main/resources/application-dev.yml | 4 +--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java index 0c10584..bb70fb5 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java @@ -7,17 +7,24 @@ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; import com.institutosemprealerta.semprealerta.utils.DateManipulation; +import jakarta.validation.constraints.*; import java.time.LocalDate; import java.time.format.DateTimeFormatter; public record UserDTO( + @NotBlank String name, + @Email String email, + @NotBlank String password, + @NotBlank String phone, String gender, - String birthDate, + @PastOrPresent + LocalDate birthDate, + @NotNull UserRoles roles, String street, String number, @@ -26,7 +33,7 @@ public record UserDTO( ) { public User toDomain() { - LocalDate birth = DateManipulation.stringToLocalDate(birthDate); + //LocalDate birth = DateManipulation.stringToLocalDate(birthDate); Contact contact = new Contact( email, phone @@ -42,7 +49,7 @@ public User toDomain() { name, password, gender, - birth, + birthDate, roles, contact, address diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java index 20855bb..0f2fe1e 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -4,6 +4,7 @@ import com.institutosemprealerta.semprealerta.domain.model.UserDTO; import com.institutosemprealerta.semprealerta.domain.ports.out.UserResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import jakarta.validation.Valid; import org.apache.catalina.connector.Response; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -19,7 +20,7 @@ public UserController(UserService userService) { } @PostMapping - public ResponseEntity createUser(@RequestBody UserDTO user) { + public ResponseEntity createUser(@Valid @RequestBody UserDTO user) { userService.save(user.toDomain()); return ResponseEntity.status(Response.SC_CREATED).build(); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 591c8a3..76cd971 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -72,12 +72,12 @@ private String generateRegistration(String prefix) { } public User fromModelToDomain(UserDTO dto) { - LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate()); + //LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate()); return new User( dto.name(), dto.password(), dto.gender(), - birth, + dto.birthDate(), dto.roles(), new Contact(dto.email(), dto.phone()), new Address(dto.street(), dto.number(), dto.city(), dto.zipCode()) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 3d8bee0..ace88a2 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -7,9 +7,7 @@ spring: hibernate: ddl-auto: update show-sql: true - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect + flyway: enabled: true locations: classpath:db/migration From 1df51be7c4022df7f97427a5449d10054cebb8c8 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sun, 25 Feb 2024 22:06:27 -0300 Subject: [PATCH 15/65] feat: add upload, download and list all files Signed-off-by: MatheusVict --- .gitignore | 1 + .../application/service/StorageService.java | 17 +++ .../service/impl/StorageServiceImpl.java | 100 ++++++++++++++++++ .../config/FileStorageProperties.java | 18 ++++ .../controllers/FilesStorageController.java | 71 +++++++++++++ src/main/resources/application-dev.yml | 10 +- src/main/resources/application.yml | 6 ++ 7 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/FileStorageProperties.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java create mode 100644 src/main/resources/application.yml diff --git a/.gitignore b/.gitignore index 549e00a..7c60eb9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ HELP.md +pdf/ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java new file mode 100644 index 0000000..95dba46 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java @@ -0,0 +1,17 @@ +package com.institutosemprealerta.semprealerta.application.service; + +import org.springframework.core.io.Resource; +import org.springframework.web.multipart.MultipartFile; + +import java.nio.file.Path; +import java.util.stream.Stream; + +public interface StorageService { + void init(); + String store(MultipartFile file); + Stream loadAll(); + Path load(String filename); + Resource loadAsResource(String filename); + void delete(String filename); + void deleteAll(); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java new file mode 100644 index 0000000..872ca5d --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java @@ -0,0 +1,100 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.application.service.StorageService; +import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; +import org.springframework.core.io.Resource; +import org.springframework.core.io.UrlResource; +import org.springframework.stereotype.Service; +import org.springframework.util.FileSystemUtils; +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; + +@Service +public class StorageServiceImpl implements StorageService { + private final Path fileStorageLocation; + + public StorageServiceImpl(FileStorageProperties fileStorageProperties) { + this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir()) + .toAbsolutePath().normalize(); + } + + @Override + public void init() { + try { + Files.createDirectories(fileStorageLocation); + } catch (IOException e) { + throw new RuntimeException("Could not create the directory where the uploaded files will be stored.", e); + } + } + + @Override + public String store(MultipartFile file) { + if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) { + throw new RuntimeException("Failed to store empty file " + file.getOriginalFilename()); + } + String fileName = StringUtils.cleanPath(file.getOriginalFilename()); + + try { + Path targetLocation = fileStorageLocation.resolve(fileName); + init(); + file.transferTo(targetLocation.toFile()); + } catch (IOException e) { + throw new RuntimeException("Could not store file " + fileName + ". Please try again!", e); + } + return fileName; + } + + @Override + public Stream loadAll() { + try { + return Files.walk(this.fileStorageLocation, 1) + .filter(path -> !path.equals(this.fileStorageLocation)) + .map(this.fileStorageLocation::relativize); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public Path load(String filename) { + Path file = fileStorageLocation.resolve(filename).normalize(); + if (!Files.exists(file)) { + throw new RuntimeException("File not found " + filename); + } + return file; + } + + @Override + public Resource loadAsResource(String filename) { + URI fileUri = load(filename).toUri(); + try { + return new UrlResource(fileUri); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + } + + @Override + public void delete(String filename) { + Path file = load(filename); + + try { + Files.deleteIfExists(file); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void deleteAll() { + FileSystemUtils.deleteRecursively(fileStorageLocation.toFile()); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/FileStorageProperties.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/FileStorageProperties.java new file mode 100644 index 0000000..0624cb3 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/FileStorageProperties.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.infrastructure.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ConfigurationProperties(prefix = "file") +public class FileStorageProperties { + private String uploadDir; + + public String getUploadDir() { + return uploadDir; + } + + public void setUploadDir(String uploadDir) { + this.uploadDir = uploadDir; + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java new file mode 100644 index 0000000..cf61676 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java @@ -0,0 +1,71 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.StorageService; +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.core.io.Resource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.servlet.support.ServletUriComponentsBuilder; + +import java.io.IOException; +import java.util.List; + +@Controller +@RequestMapping("/api/v1/files") +public class FilesStorageController { + private StorageService storageService; + + public FilesStorageController(StorageService storageService) { + + this.storageService = storageService; + } + + @PostMapping("/upload") + public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file) { + + String fileName = storageService.store(file); + + String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath() + .path("/api/v1/files/download/") + .path(fileName) + .toUriString(); + return ResponseEntity.ok("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri); + } + + @GetMapping("/download/{fileName:.+}") + @ResponseBody + public ResponseEntity downloadFile( + @PathVariable String fileName, + HttpServletRequest request + ) { + + try { + Resource resource = storageService.loadAsResource(fileName); + String contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath()); + + if (contentType == null) { + contentType = MediaType.APPLICATION_OCTET_STREAM.getType(); + } + + return ResponseEntity.ok() + .contentType(MediaType.parseMediaType(contentType)) + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"") + .body(resource); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @GetMapping("/list") + public ResponseEntity> listFiles() throws IOException { + List fileNames = storageService.loadAll() + .map(path -> path.getFileName().toString()) + .toList(); + + return ResponseEntity.ok(fileNames); + } +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index ace88a2..d2bb520 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -7,8 +7,16 @@ spring: hibernate: ddl-auto: update show-sql: true + servlet: + multipart: + max-file-size: 200MB + max-request-size: 215MB flyway: enabled: true locations: classpath:db/migration - baseline-on-migrate: true \ No newline at end of file + baseline-on-migrate: true + +file: + upload-dir: pdf + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..90cdd40 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,6 @@ +file: + upload-dir: pdf + +spring: + profiles: + active: dev From 2ee0aadbaf2ed73817e5d1d631e8145a0b93bd20 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 26 Feb 2024 14:13:09 -0300 Subject: [PATCH 16/65] chore: change entity properties --- .../semprealerta/domain/model/File.java | 33 ++++++++++++ .../entity/file/FileEntity.java | 54 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/model/File.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntity.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/File.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/File.java new file mode 100644 index 0000000..b3aa5a4 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/File.java @@ -0,0 +1,33 @@ +package com.institutosemprealerta.semprealerta.domain.model; + +import lombok.Builder; +@Builder +public class File { + private String fileName; + private String fileDownloadUri; + private String fileType; + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileDownloadUri() { + return fileDownloadUri; + } + + public void setFileDownloadUri(String fileDownloadUri) { + this.fileDownloadUri = fileDownloadUri; + } + + public String getFileType() { + return fileType; + } + + public void setFileType(String fileType) { + this.fileType = fileType; + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntity.java new file mode 100644 index 0000000..0d55bad --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntity.java @@ -0,0 +1,54 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.file; + +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; + +import java.time.LocalDateTime; + +@Entity +@Table(name = "files") +@Getter +@Setter +public class FileEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String fileName; + private String fileDownloadUri; + private String fileType; + + @CreationTimestamp + private LocalDateTime uploadDate; + + public FileEntity(String fileName, String fileDownloadUri, String fileType) { + this.fileName = fileName; + this.fileDownloadUri = fileDownloadUri; + this.fileType = fileType; + } + + public FileEntity() { + } + + public static FileEntity fromDomainToModel(File file) { + return new FileEntity( + file.getFileName(), + file.getFileDownloadUri(), + file.getFileType() + ); + } + + public static FileResponse toResponse(FileEntity fileEntity) { + return new FileResponse( + fileEntity.getId(), + fileEntity.getFileName(), + fileEntity.getFileDownloadUri(), + fileEntity.getFileType(), + fileEntity.getUploadDate() + ); + } +} From b36ca65a06c851020be03153da0f59eafc0b5cbe Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 26 Feb 2024 14:13:51 -0300 Subject: [PATCH 17/65] feat: save file information at the database --- mvnw.cmd | 8 ++-- .../domain/ports/out/FileRepository.java | 13 +++++++ .../adpters/JpaFileRepositoryAdapter.java | 38 +++++++++++++++++++ .../repositories/JpaFileRepository.java | 9 +++++ .../db/migration/V2__create-file-table.sql | 9 +++++ 5 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/FileRepository.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapter.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepository.java create mode 100644 src/main/resources/db/migration/V2__create-file-table.sql diff --git a/mvnw.cmd b/mvnw.cmd index 95ba6f5..ed2c040 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,10 +1,10 @@ @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file +@REM or more contributor license agreements. See the NOTICE fileEntity @REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file +@REM regarding copyright ownership. The ASF licenses this fileEntity @REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance +@REM "License"); you may not use this fileEntity except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM https://www.apache.org/licenses/LICENSE-2.0 @@ -153,7 +153,7 @@ if exist %WRAPPER_JAR% ( ) @REM End of extension -@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar fileEntity SET WRAPPER_SHA_256_SUM="" FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/FileRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/FileRepository.java new file mode 100644 index 0000000..a1a8b51 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/FileRepository.java @@ -0,0 +1,13 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out; + +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; + +import java.util.List; + +public interface FileRepository { + void save(File file); + void delete(Long id); + List listAll(); + +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapter.java new file mode 100644 index 0000000..5b37978 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapter.java @@ -0,0 +1,38 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaFileRepository; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class JpaFileRepositoryAdapter implements FileRepository { + + private final JpaFileRepository fileRepository; + + public JpaFileRepositoryAdapter(JpaFileRepository fileRepository) { + this.fileRepository = fileRepository; + } + + @Override + public void save(File file) { + FileEntity fileEntity = FileEntity.fromDomainToModel(file); + fileRepository.save(fileEntity); + } + + @Override + public void delete(Long id) { + fileRepository.deleteById(id); + } + + @Override + public List listAll() { + return fileRepository.findAll().stream() + .map(FileEntity::toResponse) + .toList(); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepository.java new file mode 100644 index 0000000..822c2d0 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepository.java @@ -0,0 +1,9 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface JpaFileRepository extends JpaRepository { +} diff --git a/src/main/resources/db/migration/V2__create-file-table.sql b/src/main/resources/db/migration/V2__create-file-table.sql new file mode 100644 index 0000000..fd6d482 --- /dev/null +++ b/src/main/resources/db/migration/V2__create-file-table.sql @@ -0,0 +1,9 @@ +CREATE TABLE files +( + id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, + file_name VARCHAR(255), + file_download_uri VARCHAR(255), + file_type VARCHAR(255), + upload_date TIMESTAMP WITHOUT TIME ZONE, + CONSTRAINT pk_files PRIMARY KEY (id) +); \ No newline at end of file From 90bdb84dac77e7c4cb259c82ea36ca1025baaa17 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 26 Feb 2024 14:14:13 -0300 Subject: [PATCH 18/65] feat: add file repository --- .../application/service/StorageService.java | 7 +++- .../service/impl/StorageServiceImpl.java | 37 +++++++++++++------ .../controllers/UserController.java | 2 +- 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java index 95dba46..0bdd517 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java @@ -1,15 +1,18 @@ package com.institutosemprealerta.semprealerta.application.service; +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import org.springframework.core.io.Resource; import org.springframework.web.multipart.MultipartFile; import java.nio.file.Path; +import java.util.List; import java.util.stream.Stream; public interface StorageService { void init(); - String store(MultipartFile file); - Stream loadAll(); + String store(MultipartFile file, String fileType); + List loadAll(); Path load(String filename); Resource loadAsResource(String filename); void delete(String filename); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java index 872ca5d..8e95b54 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java @@ -1,7 +1,11 @@ package com.institutosemprealerta.semprealerta.application.service.impl; import com.institutosemprealerta.semprealerta.application.service.StorageService; +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; +import lombok.extern.log4j.Log4j2; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.stereotype.Service; @@ -15,15 +19,20 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.List; +import java.util.UUID; import java.util.stream.Stream; @Service +@Log4j2 public class StorageServiceImpl implements StorageService { private final Path fileStorageLocation; + private final FileRepository fileRepository; - public StorageServiceImpl(FileStorageProperties fileStorageProperties) { + public StorageServiceImpl(FileStorageProperties fileStorageProperties, FileRepository fileRepository) { this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir()) .toAbsolutePath().normalize(); + this.fileRepository = fileRepository; } @Override @@ -36,16 +45,27 @@ public void init() { } @Override - public String store(MultipartFile file) { + public String store(MultipartFile file, String fileType) { if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) { - throw new RuntimeException("Failed to store empty file " + file.getOriginalFilename()); + throw new RuntimeException("File name is empty"); } String fileName = StringUtils.cleanPath(file.getOriginalFilename()); try { Path targetLocation = fileStorageLocation.resolve(fileName); init(); + file.transferTo(targetLocation.toFile()); + + String fileDownloadUri = "/api/v1/files/download/" + fileName; + + File fileData = File.builder() + .fileName(fileName) + .fileType(fileType) + .fileDownloadUri(fileDownloadUri) + .build(); + + this.fileRepository.save(fileData); } catch (IOException e) { throw new RuntimeException("Could not store file " + fileName + ". Please try again!", e); } @@ -53,14 +73,9 @@ public String store(MultipartFile file) { } @Override - public Stream loadAll() { - try { - return Files.walk(this.fileStorageLocation, 1) - .filter(path -> !path.equals(this.fileStorageLocation)) - .map(this.fileStorageLocation::relativize); - } catch (IOException e) { - throw new RuntimeException(e); - } + public List loadAll() { + + return this.fileRepository.listAll(); } @Override diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java index 0f2fe1e..b21b45e 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -2,7 +2,7 @@ import com.institutosemprealerta.semprealerta.application.service.UserService; import com.institutosemprealerta.semprealerta.domain.model.UserDTO; -import com.institutosemprealerta.semprealerta.domain.ports.out.UserResponse; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import jakarta.validation.Valid; import org.apache.catalina.connector.Response; From 883754fd20444cb7e8d019983795585cc06c0b10 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 26 Feb 2024 14:14:32 -0300 Subject: [PATCH 19/65] feat: add file controller --- .../domain/ports/out/responses/FileResponse.java | 12 ++++++++++++ .../ports/out/{ => responses}/UserResponse.java | 3 +-- .../controllers/FilesStorageController.java | 13 +++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/FileResponse.java rename src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/{ => responses}/UserResponse.java (90%) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/FileResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/FileResponse.java new file mode 100644 index 0000000..dd8bbd0 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/FileResponse.java @@ -0,0 +1,12 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.responses; + +import java.time.LocalDateTime; + +public record FileResponse( + long id, + String fileName, + String fileDownloadUri, + String fileType, + LocalDateTime uploadDate +) { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/UserResponse.java similarity index 90% rename from src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/UserResponse.java index d931ef0..0b1b14a 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/UserResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/UserResponse.java @@ -1,10 +1,9 @@ -package com.institutosemprealerta.semprealerta.domain.ports.out; +package com.institutosemprealerta.semprealerta.domain.ports.out.responses; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; -import jakarta.persistence.Embedded; import java.time.LocalDate; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java index cf61676..84af0e4 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java @@ -1,6 +1,8 @@ package com.institutosemprealerta.semprealerta.infrastructure.controllers; import com.institutosemprealerta.semprealerta.application.service.StorageService; +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.io.Resource; import org.springframework.http.HttpHeaders; @@ -25,14 +27,15 @@ public FilesStorageController(StorageService storageService) { } @PostMapping("/upload") - public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file) { + public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("file_type") String fileType) { - String fileName = storageService.store(file); + String fileName = storageService.store(file, fileType); String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath() .path("/api/v1/files/download/") .path(fileName) .toUriString(); + return ResponseEntity.ok("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri); } @@ -61,10 +64,8 @@ public ResponseEntity downloadFile( } @GetMapping("/list") - public ResponseEntity> listFiles() throws IOException { - List fileNames = storageService.loadAll() - .map(path -> path.getFileName().toString()) - .toList(); + public ResponseEntity> listFiles() throws IOException { + List fileNames = storageService.loadAll(); return ResponseEntity.ok(fileNames); } From 1989440f1aa85f0f87c7217be220e8f7b51c7fbb Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 27 Feb 2024 12:42:01 -0300 Subject: [PATCH 20/65] tests: jpa user repository test Signed-off-by: MatheusVict --- pom.xml | 6 +- .../infrastructure/entity/user/User.java | 2 + .../entity/user/ContactFactory.java | 16 +++++ .../entity/user/UserEntityFactory.java | 31 +++++++++ .../repositories/JpaUserRepositoryTest.java | 69 +++++++++++++++++++ 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/ContactFactory.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserEntityFactory.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepositoryTest.java diff --git a/pom.xml b/pom.xml index 882861c..761d82a 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,11 @@ org.flywaydb flyway-core - + + com.h2database + h2 + test + org.postgresql postgresql diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 76cd971..1a65c57 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -53,6 +53,8 @@ public User(String name, String password, String gender, LocalDate birthDate, Us this.address = address; } + + @PrePersist public void generateRegistration() { String prefix = this.name.substring(0, 3).toLowerCase() + "-"; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/ContactFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/ContactFactory.java new file mode 100644 index 0000000..d2b227e --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/ContactFactory.java @@ -0,0 +1,16 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; + +public class ContactFactory { + public static final ContactFactory INSTANCE = new ContactFactory(); + + private ContactFactory() { + } + + public Contact newContact() { + return new Contact(); + } + + public Contact newContact(String email, String phone) { + return new Contact(email, phone); + } +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserEntityFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserEntityFactory.java new file mode 100644 index 0000000..c83382c --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/UserEntityFactory.java @@ -0,0 +1,31 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; + +import java.time.LocalDate; + +public class UserEntityFactory { + public static final UserEntityFactory INSTANCE = new UserEntityFactory(); + + private UserEntityFactory() { + } + + public User newUser() { + return new User(); + } + + public User newUser( + String name, + String password, + String gender, + LocalDate birthday, + UserRoles userRoles, + String email, + String phone, + Address address + ) { + Contact contact = ContactFactory.INSTANCE.newContact(email, phone); + + return new User(name, password, gender, birthday, userRoles, contact, address); + } + + +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepositoryTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepositoryTest.java new file mode 100644 index 0000000..4b1cfcd --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaUserRepositoryTest.java @@ -0,0 +1,69 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserEntityFactory; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; + +import java.time.LocalDate; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; + +@DataJpaTest +@DisplayName("Tests for JpaUserRepository") +class JpaUserRepositoryTest { + + @Autowired + private JpaUserRepository jpaUserRepository; + + @BeforeEach + void setUp() { + User userToCreate = UserEntityFactory.INSTANCE.newUser( + "Teste", + "123456", + "M", + LocalDate.now(), + null, + "user@email.com", + "123456", + null + ); + this.jpaUserRepository.save(userToCreate); + } + + @AfterEach + void tearDown() { + this.jpaUserRepository.deleteAll(); + } + + @Test + void findByEmail() { + Optional userFound = this.jpaUserRepository.findByEmail("user@email.com"); + LocalDate now = LocalDate.now(); + + assertTrue(userFound.isPresent()); + assertNotNull(userFound.get().getId()); + assertEquals("Teste", userFound.get().getName()); + assertEquals("123456", userFound.get().getPassword()); + assertEquals("M", userFound.get().getGender()); + assertEquals(now, userFound.get().getBirthDate()); + + } + + @Test + void findByRegistration() { + Optional userFound = this.jpaUserRepository.findByEmail("user@email.com"); + + userFound.ifPresent(user -> { + Optional userByRegistration = this.jpaUserRepository.findByRegistration(user.getRegistration()); + assertTrue(userByRegistration.isPresent()); + assertEquals(user, userByRegistration.get()); + assertNotNull(userByRegistration.get().getId()); + }); + } +} \ No newline at end of file From 77ad104a3a8cdef681ae1e53a79078af6335903d Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 27 Feb 2024 13:31:15 -0300 Subject: [PATCH 21/65] tests: user service test Signed-off-by: MatheusVict --- .../service/impl/UserServiceImplTest.java | 98 +++++++++++++++++++ .../entity/user/mocks/UserMocks.java | 47 +++++++++ 2 files changed, 145 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java new file mode 100644 index 0000000..3e17a3c --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java @@ -0,0 +1,98 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class UserServiceImplTest { + + @InjectMocks + private UserServiceImpl userService; + + @Mock + private UserRepository userRepository; + + @BeforeEach + void setUp() { + User userValid = UserMocks.returnValidUser(); + + lenient().when(userRepository.findById(ArgumentMatchers.anyInt())).thenReturn(Optional.of(userValid)); + lenient().when(userRepository.findByRegistration(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); + lenient().when(userRepository.findByEmail(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); + lenient().doNothing().when(userRepository).save(ArgumentMatchers.any(User.class)); + lenient().doNothing().when(userRepository).update(ArgumentMatchers.anyInt(), ArgumentMatchers.any(User.class)); + lenient().doNothing().when(userRepository).delete(ArgumentMatchers.anyInt()); + } + + @AfterEach + void tearDown() { + } + + @Test + @DisplayName("Should Save User Successfully") + void should_Save_User_Successfully() { + User userToCreate = UserMocks.returnValidUserToCreate(); + assertDoesNotThrow(() -> userService.save(userToCreate)); + } + + @Test + @DisplayName("Should Update User Successfully") + void should_update_User_Successfully() { + User userToUpdate = UserMocks.returnValidUserToUpdate(); + assertDoesNotThrow(() -> userService.update(1, userToUpdate)); + } + + @Test + @DisplayName("Should Delete User Successfully") + void should_Delete_User_Successfully() { + assertDoesNotThrow(() -> userService.delete(1)); + } + + @Test + @DisplayName("Should Find User By Registration Successfully") + void should_findUserByRegistration_Successfully() { + User expectedUser = UserMocks.returnValidUser(); + User userFound = userService.findByRegistration(expectedUser.getRegistration()); + + assertEquals(expectedUser.getRegistration(), userFound.getRegistration()); + assertEquals(expectedUser.getName(), userFound.getName()); + assertNotNull(userFound.getId()); + } + + @Test + @DisplayName("Should Find User By Email Successfully") + void should_findUserByEmail_Successfully() { + User expectedUser = UserMocks.returnValidUser(); + User userFound = userService.findByEmail(expectedUser.getContact().getEmail()); + + assertEquals(expectedUser.getContact().getEmail(), userFound.getContact().getEmail()); + assertEquals(expectedUser.getName(), userFound.getName()); + assertNotNull(userFound.getId()); + } + + @Test + @DisplayName("Should Find User By Id Successfully") + void should_findUserById_Successfully() { + User expectedUser = UserMocks.returnValidUser(); + User userFound = userService.findById(1); + + assertEquals(expectedUser.getRegistration(), userFound.getRegistration()); + assertEquals(expectedUser.getName(), userFound.getName()); + assertNotNull(userFound.getId()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java new file mode 100644 index 0000000..b504ad4 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java @@ -0,0 +1,47 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.*; + +import java.time.LocalDate; +import java.time.LocalDateTime; + +public class UserMocks { + public static User returnValidUser() { + User user = UserEntityFactory.INSTANCE.newUser(); + + LocalDate birthDate = LocalDate.of(1990, 1, 1); + + user.setId(1L); + user.setRegistration("123456"); + user.setName("John Doe"); + user.setBirthDate(birthDate); + user.setGender("M"); + user.setContact(returnValidContact()); + user.setPassword("123456"); + user.setAddress(returnValidAddress()); + user.setRoles(UserRoles.USER); + user.setCreatedAt(LocalDateTime.now()); + + return user; + } + + public static User returnValidUserToCreate() { + User user = returnValidUser(); + user.setId(null); + return user; + } + + public static User returnValidUserToUpdate() { + User user = returnValidUser(); + user.setRegistration("654321"); + return user; + } + + public static Contact returnValidContact() { + return ContactFactory.INSTANCE.newContact("user@email.com", "123456789"); + } + + public static Address returnValidAddress() { + return new Address("Street", "123", "NY", "123546"); + } +} From ccb136877062dc43e947e541d46f9e810e6af342 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 27 Feb 2024 13:48:08 -0300 Subject: [PATCH 22/65] test: jpa adapter repository Signed-off-by: MatheusVict --- .../service/impl/UserServiceImplTest.java | 1 + .../adpters/JpaUserRepositoryAdapterTest.java | 109 ++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java index 3e17a3c..03bdc3d 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java @@ -41,6 +41,7 @@ void setUp() { @AfterEach void tearDown() { + reset(userRepository); } @Test diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java new file mode 100644 index 0000000..6c30e85 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java @@ -0,0 +1,109 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.lenient; +import static org.mockito.Mockito.reset; + +@ExtendWith(MockitoExtension.class) +@DisplayName("JpaUserRepositoryAdapter") +class JpaUserRepositoryAdapterTest { + + @InjectMocks + private JpaUserRepositoryAdapter jpaUserRepositoryAdapter; + + @Mock + private JpaUserRepository userRepository; + + + @BeforeEach + void setUp() { + User userValid = UserMocks.returnValidUser(); + + lenient().when(userRepository.findById(ArgumentMatchers.anyInt())).thenReturn(Optional.of(userValid)); + lenient().when(userRepository.findByRegistration(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); + lenient().when(userRepository.findByEmail(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); + lenient().when(userRepository.save(ArgumentMatchers.any(User.class))).thenReturn(userValid); + lenient().doNothing().when(userRepository).delete(ArgumentMatchers.any(User.class)); + } + + @AfterEach + void tearDown() { + reset(userRepository); + } + + @Test + @DisplayName("Should Save User Successfully") + void should_Save_UserSuccessfully() { + User userToCreate = UserMocks.returnValidUserToCreate(); + assertDoesNotThrow(() -> jpaUserRepositoryAdapter.save(userToCreate)); + } + + @Test + @DisplayName("Should Find User By Id Successfully") + void should_findUserById_Successfully() { + User expectedUser = UserMocks.returnValidUser(); + + User user = jpaUserRepositoryAdapter.findById(1).orElse(new User()); + + assertNotNull(user); + assertEquals(expectedUser.getId(), user.getId()); + assertEquals(expectedUser.getRegistration(), user.getRegistration()); + assertEquals(expectedUser.getName(), user.getName()); + + } + + @Test + @DisplayName("Should Update A User Successfully") + void should_Update_A_User_Successfully() { + User userToUpdate = UserMocks.returnValidUserToUpdate(); + assertDoesNotThrow(() -> jpaUserRepositoryAdapter.update(1, userToUpdate)); + } + + @Test + @DisplayName("Should Delete A User Successfully") + void should_Delete_A_User_Successfully() { + assertDoesNotThrow(() -> jpaUserRepositoryAdapter.delete(1)); + } + + @Test + @DisplayName("Should Find User By Registration Successfully") + void should_findUserByRegistration_Successfully() { + User expectedUser = UserMocks.returnValidUser(); + String expectedRegistration = expectedUser.getRegistration(); + User userFound = jpaUserRepositoryAdapter.findByRegistration(expectedRegistration).orElse(new User()); + + assertNotNull(userFound); + assertEquals(expectedRegistration, userFound.getRegistration()); + assertEquals(expectedUser.getName(), userFound.getName()); + assertNotNull(userFound.getId()); + } + + @Test + @DisplayName("Should Find User By Email Successfully") + void should_findUserByEmail_Successfully() { + + User expectedUser = UserMocks.returnValidUser(); + String expectedEmail = expectedUser.getContact().getEmail(); + User userFound = jpaUserRepositoryAdapter.findByEmail(expectedEmail).orElse(new User()); + + assertNotNull(userFound); + assertEquals(expectedEmail, userFound.getContact().getEmail()); + assertEquals(expectedUser.getName(), userFound.getName()); + assertNotNull(userFound.getId()); + } +} \ No newline at end of file From 532d7c587c755100d9a3e863384f105b3955c832 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 27 Feb 2024 14:12:08 -0300 Subject: [PATCH 23/65] tests: user controller Signed-off-by: MatheusVict --- .../controllers/UserController.java | 7 +- .../service/impl/UserServiceImplTest.java | 8 +- .../adpters/JpaUserRepositoryAdapterTest.java | 8 +- .../controllers/UserControllerTest.java | 113 ++++++++++++++++++ .../entity/user/mocks/UserMocks.java | 25 +++- 5 files changed, 147 insertions(+), 14 deletions(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java index b21b45e..c4c8df9 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java @@ -6,6 +6,7 @@ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import jakarta.validation.Valid; import org.apache.catalina.connector.Response; +import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @@ -22,7 +23,7 @@ public UserController(UserService userService) { @PostMapping public ResponseEntity createUser(@Valid @RequestBody UserDTO user) { userService.save(user.toDomain()); - return ResponseEntity.status(Response.SC_CREATED).build(); + return ResponseEntity.status(HttpStatus.CREATED).build(); } @GetMapping("/{id}") @@ -40,12 +41,12 @@ public ResponseEntity findByRegistration(@PathVariable String reg) @PutMapping("/{id}") public ResponseEntity updateUser(@PathVariable int id, @RequestBody UserDTO user) { userService.update(id, user.toDomain()); - return ResponseEntity.status(Response.SC_NO_CONTENT).build(); + return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); } @DeleteMapping("/{id}") public ResponseEntity deleteUser(@PathVariable int id) { userService.delete(id); - return ResponseEntity.status(Response.SC_NO_CONTENT).build(); + return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); } } diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java index 03bdc3d..c7980bf 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java @@ -29,7 +29,7 @@ class UserServiceImplTest { @BeforeEach void setUp() { - User userValid = UserMocks.returnValidUser(); + User userValid = UserMocks.returnValidUserEntity(); lenient().when(userRepository.findById(ArgumentMatchers.anyInt())).thenReturn(Optional.of(userValid)); lenient().when(userRepository.findByRegistration(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); @@ -67,7 +67,7 @@ void should_Delete_User_Successfully() { @Test @DisplayName("Should Find User By Registration Successfully") void should_findUserByRegistration_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); User userFound = userService.findByRegistration(expectedUser.getRegistration()); assertEquals(expectedUser.getRegistration(), userFound.getRegistration()); @@ -78,7 +78,7 @@ void should_findUserByRegistration_Successfully() { @Test @DisplayName("Should Find User By Email Successfully") void should_findUserByEmail_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); User userFound = userService.findByEmail(expectedUser.getContact().getEmail()); assertEquals(expectedUser.getContact().getEmail(), userFound.getContact().getEmail()); @@ -89,7 +89,7 @@ void should_findUserByEmail_Successfully() { @Test @DisplayName("Should Find User By Id Successfully") void should_findUserById_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); User userFound = userService.findById(1); assertEquals(expectedUser.getRegistration(), userFound.getRegistration()); diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java index 6c30e85..e43c962 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapterTest.java @@ -32,7 +32,7 @@ class JpaUserRepositoryAdapterTest { @BeforeEach void setUp() { - User userValid = UserMocks.returnValidUser(); + User userValid = UserMocks.returnValidUserEntity(); lenient().when(userRepository.findById(ArgumentMatchers.anyInt())).thenReturn(Optional.of(userValid)); lenient().when(userRepository.findByRegistration(ArgumentMatchers.anyString())).thenReturn(Optional.of(userValid)); @@ -56,7 +56,7 @@ void should_Save_UserSuccessfully() { @Test @DisplayName("Should Find User By Id Successfully") void should_findUserById_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); User user = jpaUserRepositoryAdapter.findById(1).orElse(new User()); @@ -83,7 +83,7 @@ void should_Delete_A_User_Successfully() { @Test @DisplayName("Should Find User By Registration Successfully") void should_findUserByRegistration_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); String expectedRegistration = expectedUser.getRegistration(); User userFound = jpaUserRepositoryAdapter.findByRegistration(expectedRegistration).orElse(new User()); @@ -97,7 +97,7 @@ void should_findUserByRegistration_Successfully() { @DisplayName("Should Find User By Email Successfully") void should_findUserByEmail_Successfully() { - User expectedUser = UserMocks.returnValidUser(); + User expectedUser = UserMocks.returnValidUserEntity(); String expectedEmail = expectedUser.getContact().getEmail(); User userFound = jpaUserRepositoryAdapter.findByEmail(expectedEmail).orElse(new User()); diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java new file mode 100644 index 0000000..4daea57 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java @@ -0,0 +1,113 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import java.util.Objects; + +import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("User Controller") +class UserControllerTest { + + @InjectMocks + private UserController userController; + + @Mock + private UserService userService; + + @BeforeEach + void setUp() { + User validUser = UserMocks.returnValidUserEntity(); + + lenient().doNothing().when(userService).save(ArgumentMatchers.any(User.class)); + lenient().when(userService.findById(ArgumentMatchers.anyInt())).thenReturn(validUser); + lenient().when(userService.findByRegistration(ArgumentMatchers.anyString())).thenReturn(validUser); + lenient().doNothing().when(userService).update(ArgumentMatchers.anyInt(), ArgumentMatchers.any(User.class)); + lenient().doNothing().when(userService).delete(ArgumentMatchers.anyInt()); + + } + + @AfterEach + void tearDown() { + reset(userService); + } + + @Test + @DisplayName("Should create user successfully") + void should_CreateUser_Successfully() { + UserDTO userDTO = UserMocks.returnValidUserDTO(); + + ResponseEntity response = userController.createUser(userDTO); + + assertNotNull(response); + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.CREATED.value(), response.getStatusCode().value()); + assertFalse(response.hasBody()); + } + + @Test + @DisplayName("Should find user by id successfully") + void should_FindUserById_Successfully() { + ResponseEntity response = userController.findById(1); + User expectedUser = UserMocks.returnValidUserEntity(); + + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertTrue(response.hasBody()); + assertEquals(HttpStatus.OK.value(), response.getStatusCode().value()); + assertEquals(expectedUser.getName(), Objects.requireNonNull(response.getBody()).name()); + } + + @Test + @DisplayName("Should find user by registration successfully") + void should_findByUserRegistration_Successfully() { + User expectedUser = UserMocks.returnValidUserEntity(); + String expectedRegistration = expectedUser.getRegistration(); + + ResponseEntity response = userController.findByRegistration(expectedRegistration); + + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.OK.value(), response.getStatusCode().value()); + assertTrue(response.hasBody()); + assertEquals(expectedUser.getName(), Objects.requireNonNull(response.getBody()).name()); + } + + @Test + @DisplayName("Should update user successfully") + void should_updateUser_Successfully() { + UserDTO userDTO = UserMocks.returnValidUserDTO(); + ResponseEntity response = userController.updateUser(1, userDTO); + + assertNotNull(response); + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.NO_CONTENT.value(), response.getStatusCode().value()); + assertFalse(response.hasBody()); + } + + @Test + @DisplayName("Should delete user successfully") + void should_deleteUser_Successfully() { + ResponseEntity response = userController.deleteUser(1); + + assertNotNull(response); + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.NO_CONTENT.value(), response.getStatusCode().value()); + assertFalse(response.hasBody()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java index b504ad4..4bf14cd 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java @@ -1,12 +1,13 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks; +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.*; import java.time.LocalDate; import java.time.LocalDateTime; public class UserMocks { - public static User returnValidUser() { + public static User returnValidUserEntity() { User user = UserEntityFactory.INSTANCE.newUser(); LocalDate birthDate = LocalDate.of(1990, 1, 1); @@ -26,13 +27,13 @@ public static User returnValidUser() { } public static User returnValidUserToCreate() { - User user = returnValidUser(); + User user = returnValidUserEntity(); user.setId(null); return user; } public static User returnValidUserToUpdate() { - User user = returnValidUser(); + User user = returnValidUserEntity(); user.setRegistration("654321"); return user; } @@ -44,4 +45,22 @@ public static Contact returnValidContact() { public static Address returnValidAddress() { return new Address("Street", "123", "NY", "123546"); } + + + public static UserDTO returnValidUserDTO() { + User user = returnValidUserEntity(); + return new UserDTO( + user.getName(), + user.getContact().getEmail(), + user.getPassword(), + user.getContact().getPhone(), + user.getGender(), + user.getBirthDate(), + user.getRoles(), + user.getAddress().getStreet(), + user.getAddress().getNumber(), + user.getAddress().getCity(), + user.getAddress().getZipCode() + ); + } } From 467a02a3f5862714386fbdb356794c503907ce3a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 28 Feb 2024 12:23:22 -0300 Subject: [PATCH 24/65] tests: jpa file repository test Signed-off-by: MatheusVict --- .../entity/file/FileEntityFactory.java | 26 ++++++++++ .../entity/file/mocks/FileMocks.java | 9 ++++ .../repositories/JpaFileRepositoryTest.java | 49 +++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntityFactory.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepositoryTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntityFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntityFactory.java new file mode 100644 index 0000000..a3d2303 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/FileEntityFactory.java @@ -0,0 +1,26 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.file; + +import com.institutosemprealerta.semprealerta.domain.model.File; + +public class FileEntityFactory { + public static final FileEntityFactory INSTANCE = new FileEntityFactory(); + + private FileEntityFactory() { + } + + public FileEntity create(File file) { + return new FileEntity(file.getFileName(), file.getFileDownloadUri(), file.getFileType()); + } + + public FileEntity create( + String fileName, + String fileDownloadUri, + String fileType + ) { + return new FileEntity(fileName, fileDownloadUri, fileType); + } + + public FileEntity create() { + return new FileEntity(); + } +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java new file mode 100644 index 0000000..7bb96b5 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java @@ -0,0 +1,9 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; + +public class FileMocks { + public static FileEntity createFileEntity() { + return new FileEntity("fileName", "fileDownloadUri", "fileType"); + } +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepositoryTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepositoryTest.java new file mode 100644 index 0000000..c81d418 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaFileRepositoryTest.java @@ -0,0 +1,49 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks.FileMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; + +import static org.junit.jupiter.api.Assertions.*; + +@DataJpaTest +@DisplayName("JpaFileRepositoryTest") +class JpaFileRepositoryTest { + + @Autowired + private JpaFileRepository jpaFileRepository; + + + @AfterEach + void tearDown() { + this.jpaFileRepository.deleteAll(); + } + + @Test + @DisplayName("Should save file data to database") + void should_save_file_data_to_database() { + + FileEntity fileToCreate = FileMocks.createFileEntity(); + FileEntity fileCreated = this.jpaFileRepository.save(fileToCreate); + + assertNotNull(fileCreated); + assertEquals(fileToCreate.getFileName(), fileCreated.getFileName()); + assertEquals(fileToCreate.getFileDownloadUri(), fileCreated.getFileDownloadUri()); + assertEquals(fileToCreate.getFileType(), fileCreated.getFileType()); + } + + @Test + @DisplayName("Should delete file by file id") + void should_delete_file_by_file_id() { + FileEntity fileToCreate = FileMocks.createFileEntity(); + FileEntity fileCreated = this.jpaFileRepository.save(fileToCreate); + + assertDoesNotThrow(() -> this.jpaFileRepository.deleteById(fileCreated.getId())); + } +} \ No newline at end of file From 0550cfdde53607951e7c5b51bd906cded04091c4 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 28 Feb 2024 12:45:53 -0300 Subject: [PATCH 25/65] test: jpa file repository adapter Signed-off-by: MatheusVict --- .../adpters/JpaFileRepositoryAdapterTest.java | 71 +++++++++++++++++++ .../entity/file/mocks/FileMocks.java | 9 +++ 2 files changed, 80 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapterTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapterTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapterTest.java new file mode 100644 index 0000000..5bf3ffe --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaFileRepositoryAdapterTest.java @@ -0,0 +1,71 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntityFactory; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks.FileMocks; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaFileRepository; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class JpaFileRepositoryAdapterTest { + + @InjectMocks + private JpaFileRepositoryAdapter jpaFileRepositoryAdapter; + + @Mock + private JpaFileRepository jpaFileRepository; + + private final FileEntity validFile = FileEntityFactory.INSTANCE.create( + "file.txt", + "http://localhost:8080/api/v1/files/download/1", + "text/plain" + ); + + @BeforeEach + void setUp() { + + when(jpaFileRepository.save(ArgumentMatchers.any(FileEntity.class))).thenReturn(validFile); + when(jpaFileRepository.findAll()).thenReturn(List.of(validFile)); + doNothing().when(jpaFileRepository).deleteById(ArgumentMatchers.anyLong()); + } + + @AfterEach + void tearDown() { + reset(jpaFileRepository); + } + + @Test + void save() { + File fileToCreate = FileMocks.createFile(); + assertDoesNotThrow(() -> jpaFileRepositoryAdapter.save(fileToCreate)); + } + + @Test + void delete() { + assertDoesNotThrow(() -> jpaFileRepositoryAdapter.delete(1L)); + } + + @Test + void listAll() { + validFile.setId(1L); + List fileResponses = jpaFileRepositoryAdapter.listAll(); + + assertNotNull(fileResponses); + assertFalse(fileResponses.isEmpty()); + assertEquals(validFile.getId(), fileResponses.get(0).id()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java index 7bb96b5..c74a8af 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java @@ -1,9 +1,18 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks; +import com.institutosemprealerta.semprealerta.domain.model.File; import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; public class FileMocks { public static FileEntity createFileEntity() { return new FileEntity("fileName", "fileDownloadUri", "fileType"); } + + public static File createFile() { + return File.builder() + .fileName("fileName") + .fileDownloadUri("fileDownloadUri") + .fileType("fileType") + .build(); + } } From df3f7bd5bb6e4b826c4c98ded596253993e3b029 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Thu, 29 Feb 2024 14:08:11 -0300 Subject: [PATCH 26/65] test: service test Signed-off-by: MatheusVict --- .../service/impl/StorageServiceImpl.java | 3 - .../service/impl/StorageServiceImplTest.java | 150 ++++++++++++++++++ .../entity/file/mocks/FileMocks.java | 7 + 3 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java index 8e95b54..819acfc 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java @@ -20,11 +20,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.UUID; -import java.util.stream.Stream; @Service -@Log4j2 public class StorageServiceImpl implements StorageService { private final Path fileStorageLocation; private final FileRepository fileRepository; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java new file mode 100644 index 0000000..3de9636 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java @@ -0,0 +1,150 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; +import com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks.FileMocks; +import org.junit.jupiter.api.*; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.core.io.Resource; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.net.URI; +import java.nio.file.*; +import java.nio.file.spi.FileSystemProvider; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +class StorageServiceImplTest { + + private StorageServiceImpl storageService; + + @Mock + private FileRepository fileRepository; + + @Mock + private FileStorageProperties fileStorageProperties; + + @Mock + private MultipartFile mockFile; + + @Mock + private FileSystem mockFileSystem; + + @Mock + private FileSystemProvider mockFileSystemProvider; + + private final FileResponse fileResponse = FileMocks.returnValidFileResponse(); + + @BeforeEach + void setUp() throws IOException { + + when(fileStorageProperties.getUploadDir()).thenReturn("pdf"); + storageService = new StorageServiceImpl(fileStorageProperties, fileRepository); + + when(mockFile.getOriginalFilename()).thenReturn("file.txt"); + when(mockFile.isEmpty()).thenReturn(false); + when(mockFile.getSize()).thenReturn(100L); + when(mockFile.getContentType()).thenReturn("text/plain"); + + + Path pathToDirectory = Paths.get("pdf"); + Path pathToFile = Paths.get("pdf/file.txt"); + if (!Files.exists(pathToDirectory)) { + Files.createDirectories(pathToDirectory); + } + if (!Files.exists(pathToFile)) { + Files.createFile(pathToFile); + } + + when(mockFileSystem.provider()).thenReturn(mockFileSystemProvider); + + + when(fileRepository.listAll()).thenReturn(List.of(fileResponse)); + doNothing().when(fileRepository).save(any(File.class)); + + } + + @AfterEach + void tearDown() { + reset( + fileRepository, + fileStorageProperties, + mockFile, + mockFileSystem, + mockFileSystemProvider + ); + } + + @AfterAll + static void afterAll() { + Path pathToFile = Paths.get("pdf/file.txt"); + try { + Files.deleteIfExists(pathToFile); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Test + void init() { + } + + @Test + @DisplayName("Should Store File With Valid Name") + void should_Store_File_With_ValidName() { + String fileName = storageService.store(mockFile, "text/plain"); + + assertNotNull(fileName); + assertEquals("file.txt", fileName); + verify(fileRepository, times(1)).save(any(File.class)); + } + + @Test + @DisplayName("should load file path") + void should_Load_File_Path() { + assertDoesNotThrow(() -> storageService.load("file.txt")); + } + + @Test + @DisplayName("Should Load All Files Successfully") + void should_LoadAll_Files_Successfully() throws IOException { + List allFiles = storageService.loadAll(); + + assertNotNull(allFiles); + assertEquals(1, allFiles.size()); + assertEquals(fileResponse.fileName(), allFiles.get(0).fileName()); + verify(fileRepository, times(1)).listAll(); + } + + @Test + @DisplayName("Should Load File Successfully") + void should_loadAsResource_Successfully() { + String fileName = "file.txt"; + + Resource response = storageService.loadAsResource(fileName); + + assertNotNull(response); + } + + @Test + @DisplayName("Should Load File As Resource Successfully") + void should_Delete_A_Resource() { + String fileName = fileResponse.fileName(); + assertDoesNotThrow(() -> storageService.delete(fileName)); + + } + + @Test + @DisplayName("Should Delete File Successfully") + void should_DeleteAll_Successfully() { + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java index c74a8af..9ff7602 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/file/mocks/FileMocks.java @@ -1,8 +1,11 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks; import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity; +import java.time.LocalDateTime; + public class FileMocks { public static FileEntity createFileEntity() { return new FileEntity("fileName", "fileDownloadUri", "fileType"); @@ -15,4 +18,8 @@ public static File createFile() { .fileType("fileType") .build(); } + + public static FileResponse returnValidFileResponse() { + return new FileResponse(1L, "file.txt", "/api/v1/download/1", "fileType", LocalDateTime.now()); + } } From 1105bdb6976d4292ee3c08179385b7dced97a334 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Thu, 29 Feb 2024 15:40:44 -0300 Subject: [PATCH 27/65] test: files tests Signed-off-by: MatheusVict --- .../controllers/FilesStorageController.java | 1 - .../FilesStorageControllerTest.java | 110 ++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java index 84af0e4..6c6f7a7 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java @@ -22,7 +22,6 @@ public class FilesStorageController { private StorageService storageService; public FilesStorageController(StorageService storageService) { - this.storageService = storageService; } diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java new file mode 100644 index 0000000..b68c046 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java @@ -0,0 +1,110 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.StorageService; +import jakarta.servlet.http.HttpServletRequest; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.core.io.Resource; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.mock.web.MockHttpServletRequest; +import org.springframework.mock.web.MockHttpServletResponse; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class FilesStorageControllerTest { + + @InjectMocks + FilesStorageController filesStorageController; + + @Mock + StorageService storageService; + + @Mock + Resource mockResource; + + @Mock + HttpServletRequest mockRequest; + + + private final MultipartFile mockFile = new MockMultipartFile("file.txt", "content".getBytes()); + + @BeforeEach + void setUp() throws IOException { + String contentFile = "Hello, World!"; + InputStream is = new ByteArrayInputStream(contentFile.getBytes(StandardCharsets.UTF_8)); + when(mockResource.getInputStream()).thenReturn(is); + + when(mockResource.getFilename()).thenReturn("file.txt"); + when(storageService.store(any(), any())).thenReturn("file.txt"); + + Path tempFile = Files.createTempFile("temp", ".txt"); + File file = tempFile.toFile(); + when(mockResource.getFile()).thenReturn(file); + + when(storageService.loadAsResource(any())).thenReturn(mockResource); + } + + @AfterEach + void tearDown() { + reset(storageService, mockResource); + } + + @Test + @DisplayName("Should upload file successfully") + void should_UploadFile_Successfully() { + MockHttpServletRequest request = new MockHttpServletRequest(); + MockHttpServletResponse response = new MockHttpServletResponse(); + + ServletRequestAttributes sra = new ServletRequestAttributes(request, response); + RequestContextHolder.setRequestAttributes(sra); + + String fileType = "pdf"; + String expected = "File uploaded successfully, file name: file.txt on path: http://localhost/api/v1/files/download/file.txt"; + ResponseEntity responseEntity = filesStorageController.uploadFile(mockFile, fileType); + + assertTrue(responseEntity.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); + assertEquals(expected, responseEntity.getBody()); + } + + @Test + @DisplayName("Should download file successfully") + void should_DownloadFile_Successfully() { + MockHttpServletRequest request = new MockHttpServletRequest(); + + ResponseEntity response = filesStorageController.downloadFile("file.txt", request); + + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("attachment; filename=\"file.txt\"", response.getHeaders().get(HttpHeaders.CONTENT_DISPOSITION).get(0)); + } + + @Test + @DisplayName("Should list files successfully") + void should_ListFiles_Successfully() { + } +} \ No newline at end of file From e6c4da9de9c0d19b41dd2431732ba93742cf5d21 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Fri, 1 Mar 2024 13:17:02 -0300 Subject: [PATCH 28/65] feat: post entity Signed-off-by: MatheusVict --- .../entity/post/PostEntity.java | 23 +++++++++++++++++++ .../db/migration/V3__create-post-table.sql | 9 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java create mode 100644 src/main/resources/db/migration/V3__create-post-table.sql diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java new file mode 100644 index 0000000..74ef810 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java @@ -0,0 +1,23 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.post; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +@Entity +@Table(name = "post") +public class PostEntity { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + @Column(nullable = false) + private String title; + @Column(nullable = false) + private String slug; + @Column(columnDefinition = "TEXT") + private String content; + private String banner; + +} diff --git a/src/main/resources/db/migration/V3__create-post-table.sql b/src/main/resources/db/migration/V3__create-post-table.sql new file mode 100644 index 0000000..e8557e6 --- /dev/null +++ b/src/main/resources/db/migration/V3__create-post-table.sql @@ -0,0 +1,9 @@ +CREATE TABLE post +( + id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, + title VARCHAR(255) NOT NULL, + slug VARCHAR(255) NOT NULL, + content TEXT, + banner VARCHAR(255), + CONSTRAINT pk_post PRIMARY KEY (id) +); \ No newline at end of file From 2c3e25a2382ded4b18d02a649337d54d5e57e427 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Fri, 1 Mar 2024 13:40:20 -0300 Subject: [PATCH 29/65] feat: add slugify generator Signed-off-by: MatheusVict --- pom.xml | 6 ++++++ .../domain/ports/in/SlugGenerator.java | 5 +++++ .../ports/in/impl/SlugifySlugGenerator.java | 17 +++++++++++++++++ .../config/ApplicationConfig.java | 15 +++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/SlugGenerator.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java diff --git a/pom.xml b/pom.xml index 761d82a..140ca28 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,12 @@ lombok true + + + com.github.slugify + slugify + 3.0.6 + org.springframework.boot spring-boot-starter-test diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/SlugGenerator.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/SlugGenerator.java new file mode 100644 index 0000000..31387bc --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/SlugGenerator.java @@ -0,0 +1,5 @@ +package com.institutosemprealerta.semprealerta.domain.ports.in; + +public interface SlugGenerator { + String generate(String input); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java new file mode 100644 index 0000000..dbde6ee --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java @@ -0,0 +1,17 @@ +package com.institutosemprealerta.semprealerta.domain.ports.in.impl; + +import com.github.slugify.Slugify; +import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; + +public class SlugifySlugGenerator implements SlugGenerator { + private final Slugify slug; + + public SlugifySlugGenerator() { + this.slug = Slugify.builder().build(); + } + + @Override + public String generate(String input) { + return slug.slugify(input); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java new file mode 100644 index 0000000..3c48969 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java @@ -0,0 +1,15 @@ +package com.institutosemprealerta.semprealerta.infrastructure.config; + +import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; +import com.institutosemprealerta.semprealerta.domain.ports.in.impl.SlugifySlugGenerator; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ApplicationConfig { + + @Bean + public SlugGenerator slugGenerator() { + return new SlugifySlugGenerator(); + } +} From d9252729244c09d8707c50ab9971eba0709ef151 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 11:14:19 -0300 Subject: [PATCH 30/65] refactor: adjusct entity --- .../semprealerta/domain/model/Post.java | 27 +++++++++++++++++++ .../entity/post/PostEntity.java | 22 ++++++++++++++- .../db/migration/V3__create-post-table.sql | 15 ++++++----- 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java new file mode 100644 index 0000000..17752b4 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java @@ -0,0 +1,27 @@ +package com.institutosemprealerta.semprealerta.domain.model; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Post { + + private Long id; + private String title; + private String slug; + + private String content; + private String banner; + + public Post(Long id, String title, String slug, String content, String banner) { + this.id = id; + this.title = title; + this.slug = slug; + this.content = content; + this.banner = banner; + } + + public Post() { + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java index 74ef810..73f86c3 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java @@ -1,13 +1,17 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.post; +import com.institutosemprealerta.semprealerta.domain.model.Post; import jakarta.persistence.*; import lombok.Getter; import lombok.Setter; +import org.hibernate.annotations.CreationTimestamp; + +import java.time.LocalDateTime; @Setter @Getter @Entity -@Table(name = "post") +@Table(name = "posts") public class PostEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -19,5 +23,21 @@ public class PostEntity { @Column(columnDefinition = "TEXT") private String content; private String banner; + @CreationTimestamp + private LocalDateTime createdAt; + + public static PostEntity fromModel(Post post) { + PostEntity postEntity = new PostEntity(); + postEntity.setId(post.getId()); + postEntity.setTitle(post.getTitle()); + postEntity.setSlug(post.getSlug()); + postEntity.setContent(post.getContent()); + postEntity.setBanner(post.getBanner()); + return postEntity; + } + + public static Post toModel(PostEntity postEntity) { + return new Post(postEntity.getId(), postEntity.getTitle(), postEntity.getSlug(), postEntity.getContent(), postEntity.getBanner()); + } } diff --git a/src/main/resources/db/migration/V3__create-post-table.sql b/src/main/resources/db/migration/V3__create-post-table.sql index e8557e6..ca58cde 100644 --- a/src/main/resources/db/migration/V3__create-post-table.sql +++ b/src/main/resources/db/migration/V3__create-post-table.sql @@ -1,9 +1,10 @@ -CREATE TABLE post +CREATE TABLE posts ( - id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, - title VARCHAR(255) NOT NULL, - slug VARCHAR(255) NOT NULL, - content TEXT, - banner VARCHAR(255), - CONSTRAINT pk_post PRIMARY KEY (id) + id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, + title VARCHAR(255) NOT NULL, + slug VARCHAR(255) NOT NULL, + content TEXT, + banner VARCHAR(255), + created_at TIMESTAMP WITHOUT TIME ZONE, + CONSTRAINT pk_posts PRIMARY KEY (id) ); \ No newline at end of file From 22eff4f8e1558049493f2768291e01b4484def82 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 11:24:04 -0300 Subject: [PATCH 31/65] feat: post repository Signed-off-by: MatheusVict --- .../semprealerta/domain/model/Post.java | 6 +- .../domain/ports/out/PostRepository.java | 21 +++++++ .../ports/out/responses/PostResponse.java | 6 ++ .../adpters/JpaPostRepositoryAdapter.java | 60 +++++++++++++++++++ .../entity/post/PostEntity.java | 7 ++- .../repositories/JpaPostRepository.java | 12 ++++ .../db/migration/V3__create-post-table.sql | 2 +- 7 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepository.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java index 17752b4..ce108c6 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java @@ -3,6 +3,8 @@ import lombok.Getter; import lombok.Setter; +import java.time.LocalDateTime; + @Getter @Setter public class Post { @@ -13,13 +15,15 @@ public class Post { private String content; private String banner; + private LocalDateTime createdAt; - public Post(Long id, String title, String slug, String content, String banner) { + public Post(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) { this.id = id; this.title = title; this.slug = slug; this.content = content; this.banner = banner; + this.createdAt = createdAt; } public Post() { diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java new file mode 100644 index 0000000..bf76888 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java @@ -0,0 +1,21 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out; + +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +public interface PostRepository { + void save(Post post); + + void delete(Long id); + + void update(Long id, Post post); + + List listAll(Pageable pageable); + + Post findBySlug(String slug); + Post findById(Long id); + +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java new file mode 100644 index 0000000..fdd82e6 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java @@ -0,0 +1,6 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.responses; + +public record PostResponse( + +) { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java new file mode 100644 index 0000000..066e043 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java @@ -0,0 +1,60 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +public class JpaPostRepositoryAdapter implements PostRepository { + private final JpaPostRepository jpaPostRepository; + + public JpaPostRepositoryAdapter(JpaPostRepository jpaPostRepository) { + this.jpaPostRepository = jpaPostRepository; + } + + @Override + public void save(Post post) { + PostEntity postToSave = PostEntity.fromModel(post); + jpaPostRepository.save(postToSave); + } + + @Override + public void delete(Long id) { + jpaPostRepository.deleteById(id); + } + + @Override + public void update(Long id, Post post) { + this.findById(id); + PostEntity postToUpdate = PostEntity.fromModel(post); + postToUpdate.setId(id); + jpaPostRepository.save(postToUpdate); + } + + @Override + public List listAll(Pageable pageable) { + return jpaPostRepository.findAll(pageable) + .stream() + .map(postEntity -> PostEntity.toModel(postEntity)) + .toList(); + } + + @Override + public Post findBySlug(String slug) { + return jpaPostRepository.findBySlug(slug) + .map(postEntity -> PostEntity.toModel(postEntity)) + .orElseThrow(() -> new RuntimeException("Post not found")); + } + + @Override + public Post findById(Long id) { + return jpaPostRepository.findById(id) + .map(postEntity -> PostEntity.toModel(postEntity)) + .orElseThrow(() -> new RuntimeException("Post not found")); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java index 73f86c3..4f00988 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java @@ -24,6 +24,7 @@ public class PostEntity { private String content; private String banner; @CreationTimestamp + @Column(nullable = false, updatable = false) private LocalDateTime createdAt; public static PostEntity fromModel(Post post) { @@ -37,7 +38,11 @@ public static PostEntity fromModel(Post post) { } public static Post toModel(PostEntity postEntity) { - return new Post(postEntity.getId(), postEntity.getTitle(), postEntity.getSlug(), postEntity.getContent(), postEntity.getBanner()); + return new Post(postEntity.getId(), postEntity.getTitle(), postEntity.getSlug(), postEntity.getContent(), postEntity.getBanner(), postEntity.getCreatedAt()); + } + + public Post toModel() { + return new Post(this.getId(), this.getTitle(), this.getSlug(), this.getContent(), this.getBanner(), this.getCreatedAt()); } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepository.java new file mode 100644 index 0000000..bac153a --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepository.java @@ -0,0 +1,12 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +import java.util.Optional; + +@Repository +public interface JpaPostRepository extends JpaRepository{ + Optional findBySlug(String slug); +} diff --git a/src/main/resources/db/migration/V3__create-post-table.sql b/src/main/resources/db/migration/V3__create-post-table.sql index ca58cde..00afba3 100644 --- a/src/main/resources/db/migration/V3__create-post-table.sql +++ b/src/main/resources/db/migration/V3__create-post-table.sql @@ -5,6 +5,6 @@ CREATE TABLE posts slug VARCHAR(255) NOT NULL, content TEXT, banner VARCHAR(255), - created_at TIMESTAMP WITHOUT TIME ZONE, + created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL, CONSTRAINT pk_posts PRIMARY KEY (id) ); \ No newline at end of file From 5049dfbe8b9eca8238e36e187383793fcc8ef2ed Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:14:48 -0300 Subject: [PATCH 32/65] chore: change flyway cache --- src/main/resources/application-dev.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index d2bb520..01e05b1 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -16,6 +16,7 @@ spring: enabled: true locations: classpath:db/migration baseline-on-migrate: true + validate-on-migrate: false file: upload-dir: pdf From cfcf388bd8c0d6a59af49883d26024438f8bfe4a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:15:06 -0300 Subject: [PATCH 33/65] chore: page size --- .../infrastructure/config/ApplicationConfig.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java index 3c48969..f144020 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java @@ -4,6 +4,9 @@ import com.institutosemprealerta.semprealerta.domain.ports.in.impl.SlugifySlugGenerator; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; @Configuration public class ApplicationConfig { @@ -12,4 +15,9 @@ public class ApplicationConfig { public SlugGenerator slugGenerator() { return new SlugifySlugGenerator(); } + + @Bean + public Pageable defaultPageable() { + return PageRequest.of(0, 10, Sort.by("createdAt").descending()); + } } From 440b007d3f5157387b857ec33614b7e18c753135 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:15:42 -0300 Subject: [PATCH 34/65] fix: return page --- .../application/service/PostService.java | 18 ++++++ .../service/impl/PostServiceImpl.java | 62 +++++++++++++++++++ .../domain/ports/out/PostRepository.java | 5 +- .../adpters/JpaPostRepositoryAdapter.java | 13 ++-- 4 files changed, 90 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java new file mode 100644 index 0000000..da29577 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.application.service; + +import com.institutosemprealerta.semprealerta.domain.model.Post; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + + +import java.util.List; + +public interface PostService { + String save(Post post); + void delete(Long id); + void update(Long id, Post post); + Page listAll(Pageable pageable); + + Post findBySlug(String slug); + Post findById(Long id); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java new file mode 100644 index 0000000..a5d517e --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java @@ -0,0 +1,62 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; +import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; +import org.springframework.data.domain.Page; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +@Service +public class PostServiceImpl implements PostService { + private final PostRepository postRepository; + private final SlugGenerator slugGenerator; + + public PostServiceImpl(PostRepository postRepository, SlugGenerator slugGenerator) { + this.postRepository = postRepository; + this.slugGenerator = slugGenerator; + } + + @Override + public String save(Post post) { + String slug = this.generateSlug(post.getTitle()); + post.setSlug(slug); + + return postRepository.save(post); + } + + @Override + public void delete(Long id) { + postRepository.delete(id); + } + + @Override + public void update(Long id, Post post) { + String slug = this.generateSlug(post.getTitle()); + post.setSlug(slug); + postRepository.update(id, post); + } + + @Override + public Page listAll(Pageable pageable) { + return postRepository.listAll(pageable); + } + + + @Override + public Post findBySlug(String slug) { + return postRepository.findBySlug(slug); + } + + @Override + public Post findById(Long id) { + return postRepository.findById(id); + } + + private String generateSlug(String title) { + return slugGenerator.generate(title); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java index bf76888..34e614c 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/PostRepository.java @@ -2,18 +2,19 @@ import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import java.util.List; public interface PostRepository { - void save(Post post); + String save(Post post); void delete(Long id); void update(Long id, Post post); - List listAll(Pageable pageable); + Page listAll(Pageable pageable); Post findBySlug(String slug); Post findById(Long id); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java index 066e043..bc44d38 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java @@ -4,6 +4,7 @@ import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; @@ -18,13 +19,15 @@ public JpaPostRepositoryAdapter(JpaPostRepository jpaPostRepository) { } @Override - public void save(Post post) { + public String save(Post post) { PostEntity postToSave = PostEntity.fromModel(post); - jpaPostRepository.save(postToSave); + PostEntity postSaved = jpaPostRepository.save(postToSave); + return postSaved.getSlug(); } @Override public void delete(Long id) { + this.findById(id); jpaPostRepository.deleteById(id); } @@ -37,11 +40,9 @@ public void update(Long id, Post post) { } @Override - public List listAll(Pageable pageable) { + public Page listAll(Pageable pageable) { return jpaPostRepository.findAll(pageable) - .stream() - .map(postEntity -> PostEntity.toModel(postEntity)) - .toList(); + .map(postEntity -> PostEntity.toModel(postEntity)); } @Override From ee29a8e0bd2083085e84c0fec044acac3320643a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:15:59 -0300 Subject: [PATCH 35/65] fix: transform on bean --- .../semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java index dbde6ee..b2de9fb 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGenerator.java @@ -2,7 +2,9 @@ import com.github.slugify.Slugify; import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; +import org.springframework.stereotype.Component; +@Component public class SlugifySlugGenerator implements SlugGenerator { private final Slugify slug; From f604c6d25d62a19c45ce340402b295ab40b905c5 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:16:15 -0300 Subject: [PATCH 36/65] fix: entity properties --- .../entity/post/PostEntity.java | 2 +- .../db/migration/V3__create-post-table.sql | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java index 4f00988..163a126 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java @@ -11,7 +11,7 @@ @Setter @Getter @Entity -@Table(name = "posts") +@Table(name = "post") public class PostEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) diff --git a/src/main/resources/db/migration/V3__create-post-table.sql b/src/main/resources/db/migration/V3__create-post-table.sql index 00afba3..47d9049 100644 --- a/src/main/resources/db/migration/V3__create-post-table.sql +++ b/src/main/resources/db/migration/V3__create-post-table.sql @@ -1,10 +1,13 @@ -CREATE TABLE posts +CREATE TABLE post ( - id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, - title VARCHAR(255) NOT NULL, - slug VARCHAR(255) NOT NULL, - content TEXT, - banner VARCHAR(255), - created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL, - CONSTRAINT pk_posts PRIMARY KEY (id) -); \ No newline at end of file + id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, + title VARCHAR(255) NOT NULL, + slug VARCHAR(255) NOT NULL, + content TEXT, + banner VARCHAR(255), + CONSTRAINT pk_post PRIMARY KEY (id) +); + + +ALTER TABLE post + ADD COLUMN created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL; From 0360501b6d566f0382dce52d2a558769841d596a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:16:27 -0300 Subject: [PATCH 37/65] feat: rest post controller --- .../controllers/PostController.java | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java new file mode 100644 index 0000000..ba0ab91 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java @@ -0,0 +1,49 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.domain.model.Post; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.net.URI; +import java.util.List; + +@RestController +@RequestMapping("api/v1/posts") +public class PostController { + private final PostService postService; + + public PostController(PostService postService) { + this.postService = postService; + } + + @GetMapping + public ResponseEntity> getAllPosts(Pageable pageable) { + return ResponseEntity.ok(postService.listAll(pageable)); + } + + @PostMapping + public ResponseEntity createPost(@RequestBody Post post) { + String slug = postService.save(post); + return ResponseEntity.created(URI.create("/api/v1/posts/" + slug)).build(); + } + + @GetMapping("/{slug}") + public ResponseEntity getPostBySlug(@PathVariable String slug) { + return ResponseEntity.ok(postService.findBySlug(slug)); + } + + @PutMapping("/{id}") + public ResponseEntity updatePost(@PathVariable Long id, @RequestBody Post post) { + postService.update(id, post); + return ResponseEntity.noContent().build(); + } + + @DeleteMapping("/{id}") + public ResponseEntity deletePost(@PathVariable Long id) { + postService.delete(id); + return ResponseEntity.noContent().build(); + } +} From 585de193532dc20c9d86a4d769a8cf809f1c2e59 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 13:29:29 -0300 Subject: [PATCH 38/65] test: jpa post repository Signed-off-by: MatheusVict --- .../entity/post/PostEntity.java | 19 +++++++ .../entity/post/PostEntityFactory.java | 28 +++++++++++ .../repositories/JpaPostRepositoryTest.java | 49 +++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepositoryTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java index 163a126..ac50c6f 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntity.java @@ -27,6 +27,25 @@ public class PostEntity { @Column(nullable = false, updatable = false) private LocalDateTime createdAt; + public PostEntity() { + } + + public PostEntity(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) { + this.id = id; + this.title = title; + this.slug = slug; + this.content = content; + this.banner = banner; + this.createdAt = createdAt; + } + + public PostEntity(String title, String slug, String content, String banner) { + this.title = title; + this.slug = slug; + this.content = content; + this.banner = banner; + } + public static PostEntity fromModel(Post post) { PostEntity postEntity = new PostEntity(); postEntity.setId(post.getId()); diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java new file mode 100644 index 0000000..c4dfe17 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java @@ -0,0 +1,28 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.post; + +public class PostEntityFactory { + public static PostEntityFactory INSTANCE = new PostEntityFactory(); + + private PostEntityFactory() { + } + + public PostEntity createPostEntity() { + return new PostEntity(); + } + + public PostEntity createPostEntity( + String title, + String slug, + String content, + String banner + ) { + return new PostEntity( + title, + slug, + content, + banner + ); + } + + +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepositoryTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepositoryTest.java new file mode 100644 index 0000000..fe8c085 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/repositories/JpaPostRepositoryTest.java @@ -0,0 +1,49 @@ +package com.institutosemprealerta.semprealerta.infrastructure.repositories; + +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntityFactory; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; + +import static org.junit.jupiter.api.Assertions.*; + +@DataJpaTest +@DisplayName("JpaPostRepositoryTest") +class JpaPostRepositoryTest { + + @Autowired + private JpaPostRepository jpaPostRepository; + + private final PostEntity postToCreate = PostEntityFactory.INSTANCE.createPostEntity( + "title", + "slug", + "content", + "banner" + ); + + @BeforeEach + void setUp() { + this.jpaPostRepository.save(postToCreate); + } + + @AfterEach + void tearDown() { + this.jpaPostRepository.deleteAll(); + } + + @Test + @DisplayName("Should find post by slug") + void should_find_post_by_slug() { + PostEntity postFound = this.jpaPostRepository.findBySlug("slug").orElse(null); + + assertNotNull(postFound); + assertEquals(postToCreate.getTitle(), postFound.getTitle()); + assertEquals(postToCreate.getSlug(), postFound.getSlug()); + assertEquals(postToCreate.getContent(), postFound.getContent()); + assertEquals(postToCreate.getBanner(), postFound.getBanner()); + } +} \ No newline at end of file From 5a8fdf3a1765b61fa54eae4466e762bfd0673d0a Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 14:24:45 -0300 Subject: [PATCH 39/65] test: jpa post repository adapter Signed-off-by: MatheusVict --- pom.xml | 6 + .../adpters/JpaPostRepositoryAdapterTest.java | 118 ++++++++++++++++++ .../entity/post/PostEntityFactory.java | 20 +++ .../entity/post/mocks/PostMocks.java | 49 ++++++++ .../wrapper/PageableResponse.java | 42 +++++++ 5 files changed, 235 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapterTest.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/wrapper/PageableResponse.java diff --git a/pom.xml b/pom.xml index 140ca28..39e4d42 100644 --- a/pom.xml +++ b/pom.xml @@ -62,6 +62,12 @@ slugify 3.0.6 + + com.github.javafaker + javafaker + 1.0.2 + test + org.springframework.boot spring-boot-starter-test diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapterTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapterTest.java new file mode 100644 index 0000000..88f0c72 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapterTest.java @@ -0,0 +1,118 @@ +package com.institutosemprealerta.semprealerta.infrastructure.adpters; + +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks.PostMocks; +import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("JpaPostRepositoryAdapterTest") +class JpaPostRepositoryAdapterTest { + + @InjectMocks + private JpaPostRepositoryAdapter jpaPostRepositoryAdapter; + + @Mock + private JpaPostRepository jpaPostRepository; + + private final PostEntity postMocks = PostMocks.returnValidPostEntity(); + + @BeforeEach + void setUp() { + List postEntityList = List.of(postMocks); + + Pageable pageable = PageRequest.of(0, 10); + Page postEntityPage = new PageImpl<>(postEntityList, pageable, postEntityList.size()); + + when(jpaPostRepository.findAll(any(Pageable.class))).thenReturn(postEntityPage); + when(jpaPostRepository.save(any(PostEntity.class))).thenReturn(postMocks); + when(jpaPostRepository.findBySlug(any(String.class))).thenReturn(java.util.Optional.of(postMocks)); + when(jpaPostRepository.findById(any(Long.class))).thenReturn(java.util.Optional.of(postMocks)); + doNothing().when(jpaPostRepository).deleteById(any(Long.class)); + } + + @AfterEach + void tearDown() { + reset(jpaPostRepository); + } + + @Test + @DisplayName("Should Save A Post Successfully") + void should_Save_A_Post_Successfully() { + PostEntity postEntity = PostMocks.returnValidPostToBeCreated(); + + String slug = jpaPostRepositoryAdapter.save(PostEntity.toModel(postEntity)); + + assertNotNull(slug); + assertEquals(postEntity.getSlug(), slug); + } + + @Test + @DisplayName("Should Delete A Post Successfully") + void should_Delete_A_Post_Successfully() { + assertDoesNotThrow(() -> jpaPostRepositoryAdapter.delete(postMocks.getId())); + } + + @Test + @DisplayName("Should Update A Post Successfully") + void should_Update_A_Post_Successfully() { + PostEntity postEntity = PostMocks.returnValidPostToBeUpdated(); + + assertDoesNotThrow(() -> jpaPostRepositoryAdapter.update(postMocks.getId(), PostEntity.toModel(postEntity))); + } + + @Test + @DisplayName("Should ListAll PageablePost Successfully") + void should_ListAll_PageablePost_Successfully() { + PageRequest pageable = PageRequest.of(0, 10); + Page postPage = jpaPostRepositoryAdapter.listAll(pageable); + + assertNotNull(postPage); + assertEquals(1, postPage.getTotalElements()); + assertEquals(postMocks.getId(), postPage.getContent().get(0).getId()); + } + + @Test + @DisplayName("Should Find A PostBySlug Successfully") + void should_Find_A_PostBySlug_Successfully() { + Post post = jpaPostRepositoryAdapter.findBySlug(postMocks.getSlug()); + + assertNotNull(post); + assertEquals(postMocks.getId(), post.getId()); + assertEquals(postMocks.getTitle(), post.getTitle()); + assertEquals(postMocks.getSlug(), post.getSlug()); + assertEquals(postMocks.getContent(), post.getContent()); + assertEquals(postMocks.getBanner(), post.getBanner()); + } + + @Test + @DisplayName("Should Find A Post By Id Successfully") + void should_Find_A_Post_ById_Successfully() { + Post post = jpaPostRepositoryAdapter.findById(postMocks.getId()); + + assertNotNull(post); + assertEquals(postMocks.getId(), post.getId()); + assertEquals(postMocks.getTitle(), post.getTitle()); + assertEquals(postMocks.getSlug(), post.getSlug()); + assertEquals(postMocks.getContent(), post.getContent()); + assertEquals(postMocks.getBanner(), post.getBanner()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java index c4dfe17..5af5cec 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/PostEntityFactory.java @@ -1,5 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.post; +import java.time.LocalDateTime; + public class PostEntityFactory { public static PostEntityFactory INSTANCE = new PostEntityFactory(); @@ -24,5 +26,23 @@ public PostEntity createPostEntity( ); } + public PostEntity createPostEntity( + Long id, + String title, + String slug, + String content, + String banner, + LocalDateTime createdAt + ) { + return new PostEntity( + id, + title, + slug, + content, + banner, + createdAt + ); + } + } diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java new file mode 100644 index 0000000..ece64f1 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java @@ -0,0 +1,49 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks; + +import com.github.javafaker.Faker; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntityFactory; + +import java.time.LocalDateTime; + +public class PostMocks { + private static final Faker faker = new Faker(); + + private static final Long id = faker.number().randomNumber(); + private static final String title = faker.lorem().sentence(); + private static final String slug = faker.lorem().sentence(); + private static final String content = faker.lorem().paragraph(); + private static final String banner = faker.internet().image(); + private static final LocalDateTime createdAt = LocalDateTime.now(); + + public static PostEntity returnValidPostEntity() { + return PostEntityFactory.INSTANCE.createPostEntity( + id, + title, + slug, + content, + banner, + createdAt + ); + } + + public static PostEntity returnValidPostToBeCreated() { + return PostEntityFactory.INSTANCE.createPostEntity( + title, + slug, + content, + banner + ); + } + + public static PostEntity returnValidPostToBeUpdated() { + return PostEntityFactory.INSTANCE.createPostEntity( + id, + title, + slug, + faker.dune().saying(), + banner, + createdAt + ); + } +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/wrapper/PageableResponse.java b/src/test/java/com/institutosemprealerta/semprealerta/wrapper/PageableResponse.java new file mode 100644 index 0000000..2820e19 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/wrapper/PageableResponse.java @@ -0,0 +1,42 @@ +package com.institutosemprealerta.semprealerta.wrapper; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import lombok.Getter; +import lombok.Setter; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import java.util.List; + +import static com.fasterxml.jackson.annotation.JsonCreator.Mode.PROPERTIES; + +@Getter +@Setter +public class PageableResponse extends PageImpl { + private boolean first; + private boolean last; + private int totalPages; + private int numberOfElements; + + @JsonCreator(mode = PROPERTIES ) + public PageableResponse(@JsonProperty("content") List content, + @JsonProperty("number") int number, + @JsonProperty("size") int size, + @JsonProperty("totalElements") int totalElements, + @JsonProperty("last") boolean last, + @JsonProperty("first") boolean first, + @JsonProperty("totalPages") int totalPages, + @JsonProperty("numberOfElements") int numberOfElements, + @JsonProperty("pageable") JsonNode pageable, + @JsonProperty("sort") JsonNode sort) { + super(content, PageRequest.of(number, size), totalElements); + + this.last = last; + this.first = first; + this.totalPages = totalPages; + this.numberOfElements = numberOfElements; + + } +} \ No newline at end of file From cb9f537a4fd82dc61642820ec20431ad57b7aef9 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 14:49:17 -0300 Subject: [PATCH 40/65] test: post service test Signed-off-by: MatheusVict --- .../service/impl/PostServiceImplTest.java | 129 ++++++++++++++++++ .../entity/post/mocks/PostMocks.java | 34 +++++ 2 files changed, 163 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java new file mode 100644 index 0000000..3430c9f --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java @@ -0,0 +1,129 @@ +package com.institutosemprealerta.semprealerta.application.service.impl; + +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; +import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks.PostMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Post Service Test") +class PostServiceImplTest { + + @InjectMocks + private PostServiceImpl postService; + + @Mock + private PostRepository postRepository; + + @Mock + private SlugGenerator slugGenerator; + + private final Post postMock = PostMocks.returnValidPostModel(); + + @BeforeEach + void setUp() { + List posts = List.of(postMock); + + Pageable pageable = PageRequest.of(0, 10); + Page postPage = new PageImpl<>(posts, pageable, posts.size()); + + when(postService.listAll(any(Pageable.class))).thenReturn(postPage); + when(postRepository.save(any(Post.class))).thenReturn(postMock.getSlug()); + when(postRepository.findBySlug(anyString())).thenReturn(postMock); + when(postRepository.findById(anyLong())).thenReturn(postMock); + doNothing().when(postRepository).delete(anyLong()); + doNothing().when(postRepository).update(anyLong(), any(Post.class)); + + when(slugGenerator.generate(anyString())).thenReturn(postMock.getSlug()); + } + + @AfterEach + void tearDown() { + reset(postRepository, slugGenerator); + } + + @Test + @DisplayName("Should save a post successfully") + void should_SaveAPost_Successfully() { + Post postToCreate = PostMocks.returnValidPostModelToBeCreated(); + String slug = postService.save(postToCreate); + + assertNotNull(slug); + assertEquals(postToCreate.getSlug(), slug); + verify(slugGenerator, times(1)).generate(postToCreate.getTitle()); + } + + @Test + @DisplayName("Should delete a post successfully") + void should_DeleteAPost_Successfully() { + assertDoesNotThrow(() -> postService.delete(postMock.getId())); + verify(postRepository, times(1)).delete(postMock.getId()); + } + + @Test + @DisplayName("Should update a post successfully") + void should_UpdateAPost_Successfully() { + Post postToUpdate = PostMocks.returnValidPostModelToBeUpdated(); + + assertDoesNotThrow(() -> postService.update(postMock.getId(), postToUpdate)); + verify(postRepository, times(1)).update(postMock.getId(), postToUpdate); + verify(slugGenerator, times(1)).generate(postToUpdate.getTitle()); + } + + @Test + @DisplayName("Should list all pageable successfully") + void should_ListAllPageable_Successfully() { + PageRequest pageable = PageRequest.of(0, 10); + + Page posts = postService.listAll(pageable); + + assertNotNull(posts); + assertEquals(1, posts.getTotalElements()); + assertEquals(postMock.getId(), posts.getContent().get(0).getId()); + } + + @Test + @DisplayName("Should find by slug successfully") + void should_FindBySlug_Successfully() { + Post post = postService.findBySlug(postMock.getSlug()); + + assertNotNull(post); + assertEquals(postMock.getId(), post.getId()); + assertEquals(postMock.getTitle(), post.getTitle()); + assertEquals(postMock.getSlug(), post.getSlug()); + assertEquals(postMock.getContent(), post.getContent()); + assertEquals(postMock.getBanner(), post.getBanner()); + } + + @Test + @DisplayName("Should find by id successfully") + void should_FindById_Successfully() { + Post post = postService.findById(postMock.getId()); + + assertNotNull(post); + assertEquals(postMock.getId(), post.getId()); + assertEquals(postMock.getTitle(), post.getTitle()); + assertEquals(postMock.getSlug(), post.getSlug()); + assertEquals(postMock.getContent(), post.getContent()); + assertEquals(postMock.getBanner(), post.getBanner()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java index ece64f1..acfb6b2 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks; import com.github.javafaker.Faker; +import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntityFactory; @@ -46,4 +47,37 @@ public static PostEntity returnValidPostToBeUpdated() { createdAt ); } + + public static Post returnValidPostModel() { + return new Post( + id, + title, + slug, + content, + banner, + createdAt + ); + } + + public static Post returnValidPostModelToBeCreated() { + return new Post( + null, + title, + slug, + content, + banner, + null + ); + } + + public static Post returnValidPostModelToBeUpdated() { + return new Post( + id, + title, + slug, + faker.dune().saying(), + banner, + createdAt + ); + } } From e2c00d460ed9f95325d97a3217c3d1b3a4a92b78 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Sat, 2 Mar 2024 15:06:47 -0300 Subject: [PATCH 41/65] test: controller tests Signed-off-by: MatheusVict --- .gitignore | 1 + htmlReport/css/coverage.css | 154 ++ htmlReport/css/idea.min.css | 118 ++ htmlReport/img/arrowDown.gif | Bin 0 -> 89 bytes htmlReport/img/arrowUp.gif | Bin 0 -> 91 bytes htmlReport/index.html | 439 ++++++ htmlReport/index_SORT_BY_BLOCK.html | 439 ++++++ htmlReport/index_SORT_BY_BLOCK_DESC.html | 439 ++++++ htmlReport/index_SORT_BY_CLASS.html | 439 ++++++ htmlReport/index_SORT_BY_CLASS_DESC.html | 439 ++++++ htmlReport/index_SORT_BY_LINE.html | 439 ++++++ htmlReport/index_SORT_BY_LINE_DESC.html | 439 ++++++ htmlReport/index_SORT_BY_METHOD.html | 439 ++++++ htmlReport/index_SORT_BY_METHOD_DESC.html | 439 ++++++ htmlReport/index_SORT_BY_NAME_DESC.html | 439 ++++++ htmlReport/js/highlight.min.js | 1388 +++++++++++++++++ htmlReport/js/highlightjs-line-numbers.min.js | 24 + htmlReport/ns-1/index.html | 143 ++ htmlReport/ns-1/index_SORT_BY_BLOCK.html | 143 ++ htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html | 143 ++ htmlReport/ns-1/index_SORT_BY_CLASS.html | 143 ++ htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html | 143 ++ htmlReport/ns-1/index_SORT_BY_LINE.html | 143 ++ htmlReport/ns-1/index_SORT_BY_LINE_DESC.html | 143 ++ htmlReport/ns-1/index_SORT_BY_METHOD.html | 143 ++ .../ns-1/index_SORT_BY_METHOD_DESC.html | 143 ++ htmlReport/ns-1/index_SORT_BY_NAME_DESC.html | 143 ++ htmlReport/ns-1/sources/source-1.html | 127 ++ htmlReport/ns-10/index.html | 68 + htmlReport/ns-10/index_SORT_BY_BLOCK.html | 68 + .../ns-10/index_SORT_BY_BLOCK_DESC.html | 68 + htmlReport/ns-10/index_SORT_BY_CLASS.html | 68 + .../ns-10/index_SORT_BY_CLASS_DESC.html | 68 + htmlReport/ns-10/index_SORT_BY_LINE.html | 68 + htmlReport/ns-10/index_SORT_BY_LINE_DESC.html | 68 + htmlReport/ns-10/index_SORT_BY_METHOD.html | 68 + .../ns-10/index_SORT_BY_METHOD_DESC.html | 68 + htmlReport/ns-10/index_SORT_BY_NAME_DESC.html | 68 + htmlReport/ns-10/sources/source-1.html | 93 ++ htmlReport/ns-10/sources/source-2.html | 89 ++ htmlReport/ns-10/sources/source-3.html | 86 + htmlReport/ns-2/index.html | 197 +++ htmlReport/ns-2/index_SORT_BY_BLOCK.html | 197 +++ htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html | 197 +++ htmlReport/ns-2/index_SORT_BY_CLASS.html | 197 +++ htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html | 197 +++ htmlReport/ns-2/index_SORT_BY_LINE.html | 197 +++ htmlReport/ns-2/index_SORT_BY_LINE_DESC.html | 197 +++ htmlReport/ns-2/index_SORT_BY_METHOD.html | 197 +++ .../ns-2/index_SORT_BY_METHOD_DESC.html | 197 +++ htmlReport/ns-2/index_SORT_BY_NAME_DESC.html | 197 +++ htmlReport/ns-2/sources/source-1.html | 166 ++ htmlReport/ns-2/sources/source-2.html | 216 +++ htmlReport/ns-2/sources/source-3.html | 153 ++ htmlReport/ns-3/index.html | 197 +++ htmlReport/ns-3/index_SORT_BY_BLOCK.html | 197 +++ htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html | 197 +++ htmlReport/ns-3/index_SORT_BY_CLASS.html | 197 +++ htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html | 197 +++ htmlReport/ns-3/index_SORT_BY_LINE.html | 197 +++ htmlReport/ns-3/index_SORT_BY_LINE_DESC.html | 197 +++ htmlReport/ns-3/index_SORT_BY_METHOD.html | 197 +++ .../ns-3/index_SORT_BY_METHOD_DESC.html | 197 +++ htmlReport/ns-3/index_SORT_BY_NAME_DESC.html | 197 +++ htmlReport/ns-3/sources/source-1.html | 163 ++ htmlReport/ns-3/sources/source-2.html | 135 ++ htmlReport/ns-3/sources/source-3.html | 162 ++ htmlReport/ns-4/index.html | 143 ++ htmlReport/ns-4/index_SORT_BY_BLOCK.html | 143 ++ htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html | 143 ++ htmlReport/ns-4/index_SORT_BY_CLASS.html | 143 ++ htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html | 143 ++ htmlReport/ns-4/index_SORT_BY_LINE.html | 143 ++ htmlReport/ns-4/index_SORT_BY_LINE_DESC.html | 143 ++ htmlReport/ns-4/index_SORT_BY_METHOD.html | 143 ++ .../ns-4/index_SORT_BY_METHOD_DESC.html | 143 ++ htmlReport/ns-4/index_SORT_BY_NAME_DESC.html | 143 ++ htmlReport/ns-4/sources/source-1.html | 123 ++ htmlReport/ns-5/index.html | 197 +++ htmlReport/ns-5/index_SORT_BY_BLOCK.html | 197 +++ htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html | 197 +++ htmlReport/ns-5/index_SORT_BY_CLASS.html | 197 +++ htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html | 197 +++ htmlReport/ns-5/index_SORT_BY_LINE.html | 197 +++ htmlReport/ns-5/index_SORT_BY_LINE_DESC.html | 197 +++ htmlReport/ns-5/index_SORT_BY_METHOD.html | 197 +++ .../ns-5/index_SORT_BY_METHOD_DESC.html | 197 +++ htmlReport/ns-5/index_SORT_BY_NAME_DESC.html | 197 +++ htmlReport/ns-5/sources/source-1.html | 116 ++ htmlReport/ns-5/sources/source-2.html | 110 ++ htmlReport/ns-5/sources/source-3.html | 138 ++ htmlReport/ns-6/index.html | 197 +++ htmlReport/ns-6/index_SORT_BY_BLOCK.html | 197 +++ htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html | 197 +++ htmlReport/ns-6/index_SORT_BY_CLASS.html | 197 +++ htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html | 197 +++ htmlReport/ns-6/index_SORT_BY_LINE.html | 197 +++ htmlReport/ns-6/index_SORT_BY_LINE_DESC.html | 197 +++ htmlReport/ns-6/index_SORT_BY_METHOD.html | 197 +++ .../ns-6/index_SORT_BY_METHOD_DESC.html | 197 +++ htmlReport/ns-6/index_SORT_BY_NAME_DESC.html | 197 +++ htmlReport/ns-6/sources/source-1.html | 142 ++ htmlReport/ns-6/sources/source-2.html | 165 ++ htmlReport/ns-6/sources/source-3.html | 163 ++ htmlReport/ns-7/index.html | 170 ++ htmlReport/ns-7/index_SORT_BY_BLOCK.html | 170 ++ htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html | 170 ++ htmlReport/ns-7/index_SORT_BY_CLASS.html | 170 ++ htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html | 170 ++ htmlReport/ns-7/index_SORT_BY_LINE.html | 170 ++ htmlReport/ns-7/index_SORT_BY_LINE_DESC.html | 170 ++ htmlReport/ns-7/index_SORT_BY_METHOD.html | 170 ++ .../ns-7/index_SORT_BY_METHOD_DESC.html | 170 ++ htmlReport/ns-7/index_SORT_BY_NAME_DESC.html | 170 ++ htmlReport/ns-7/sources/source-1.html | 127 ++ htmlReport/ns-7/sources/source-2.html | 122 ++ htmlReport/ns-8/index.html | 197 +++ htmlReport/ns-8/index_SORT_BY_BLOCK.html | 197 +++ htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html | 197 +++ htmlReport/ns-8/index_SORT_BY_CLASS.html | 197 +++ htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html | 197 +++ htmlReport/ns-8/index_SORT_BY_LINE.html | 197 +++ htmlReport/ns-8/index_SORT_BY_LINE_DESC.html | 197 +++ htmlReport/ns-8/index_SORT_BY_METHOD.html | 197 +++ .../ns-8/index_SORT_BY_METHOD_DESC.html | 197 +++ htmlReport/ns-8/index_SORT_BY_NAME_DESC.html | 197 +++ htmlReport/ns-8/sources/source-1.html | 175 +++ htmlReport/ns-8/sources/source-2.html | 153 ++ htmlReport/ns-8/sources/source-3.html | 156 ++ htmlReport/ns-9/index.html | 143 ++ htmlReport/ns-9/index_SORT_BY_BLOCK.html | 143 ++ htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html | 143 ++ htmlReport/ns-9/index_SORT_BY_CLASS.html | 143 ++ htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html | 143 ++ htmlReport/ns-9/index_SORT_BY_LINE.html | 143 ++ htmlReport/ns-9/index_SORT_BY_LINE_DESC.html | 143 ++ htmlReport/ns-9/index_SORT_BY_METHOD.html | 143 ++ .../ns-9/index_SORT_BY_METHOD_DESC.html | 143 ++ htmlReport/ns-9/index_SORT_BY_NAME_DESC.html | 143 ++ htmlReport/ns-9/sources/source-1.html | 171 ++ htmlReport/ns-a/index.html | 143 ++ htmlReport/ns-a/index_SORT_BY_BLOCK.html | 143 ++ htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html | 143 ++ htmlReport/ns-a/index_SORT_BY_CLASS.html | 143 ++ htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html | 143 ++ htmlReport/ns-a/index_SORT_BY_LINE.html | 143 ++ htmlReport/ns-a/index_SORT_BY_LINE_DESC.html | 143 ++ htmlReport/ns-a/index_SORT_BY_METHOD.html | 143 ++ .../ns-a/index_SORT_BY_METHOD_DESC.html | 143 ++ htmlReport/ns-a/index_SORT_BY_NAME_DESC.html | 143 ++ htmlReport/ns-a/sources/source-1.html | 184 +++ htmlReport/ns-b/index.html | 224 +++ htmlReport/ns-b/index_SORT_BY_BLOCK.html | 224 +++ htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html | 224 +++ htmlReport/ns-b/index_SORT_BY_CLASS.html | 224 +++ htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html | 224 +++ htmlReport/ns-b/index_SORT_BY_LINE.html | 224 +++ htmlReport/ns-b/index_SORT_BY_LINE_DESC.html | 224 +++ htmlReport/ns-b/index_SORT_BY_METHOD.html | 224 +++ .../ns-b/index_SORT_BY_METHOD_DESC.html | 224 +++ htmlReport/ns-b/index_SORT_BY_NAME_DESC.html | 224 +++ htmlReport/ns-b/sources/source-1.html | 123 ++ htmlReport/ns-b/sources/source-2.html | 121 ++ htmlReport/ns-b/sources/source-3.html | 205 +++ htmlReport/ns-b/sources/source-4.html | 120 ++ htmlReport/ns-c/index.html | 170 ++ htmlReport/ns-c/index_SORT_BY_BLOCK.html | 170 ++ htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html | 170 ++ htmlReport/ns-c/index_SORT_BY_CLASS.html | 170 ++ htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html | 170 ++ htmlReport/ns-c/index_SORT_BY_LINE.html | 170 ++ htmlReport/ns-c/index_SORT_BY_LINE_DESC.html | 170 ++ htmlReport/ns-c/index_SORT_BY_METHOD.html | 170 ++ .../ns-c/index_SORT_BY_METHOD_DESC.html | 170 ++ htmlReport/ns-c/index_SORT_BY_NAME_DESC.html | 170 ++ htmlReport/ns-c/sources/source-1.html | 120 ++ htmlReport/ns-c/sources/source-2.html | 114 ++ htmlReport/ns-d/index.html | 68 + htmlReport/ns-d/index_SORT_BY_BLOCK.html | 68 + htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html | 68 + htmlReport/ns-d/index_SORT_BY_CLASS.html | 68 + htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html | 68 + htmlReport/ns-d/index_SORT_BY_LINE.html | 68 + htmlReport/ns-d/index_SORT_BY_LINE_DESC.html | 68 + htmlReport/ns-d/index_SORT_BY_METHOD.html | 68 + .../ns-d/index_SORT_BY_METHOD_DESC.html | 68 + htmlReport/ns-d/index_SORT_BY_NAME_DESC.html | 68 + htmlReport/ns-d/sources/source-1.html | 82 + htmlReport/ns-e/index.html | 68 + htmlReport/ns-e/index_SORT_BY_BLOCK.html | 68 + htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html | 68 + htmlReport/ns-e/index_SORT_BY_CLASS.html | 68 + htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html | 68 + htmlReport/ns-e/index_SORT_BY_LINE.html | 68 + htmlReport/ns-e/index_SORT_BY_LINE_DESC.html | 68 + htmlReport/ns-e/index_SORT_BY_METHOD.html | 68 + .../ns-e/index_SORT_BY_METHOD_DESC.html | 68 + htmlReport/ns-e/index_SORT_BY_NAME_DESC.html | 68 + htmlReport/ns-e/sources/source-1.html | 92 ++ htmlReport/ns-e/sources/source-2.html | 99 ++ htmlReport/ns-e/sources/source-3.html | 90 ++ htmlReport/ns-f/index.html | 68 + htmlReport/ns-f/index_SORT_BY_BLOCK.html | 68 + htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html | 68 + htmlReport/ns-f/index_SORT_BY_CLASS.html | 68 + htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html | 68 + htmlReport/ns-f/index_SORT_BY_LINE.html | 68 + htmlReport/ns-f/index_SORT_BY_LINE_DESC.html | 68 + htmlReport/ns-f/index_SORT_BY_METHOD.html | 68 + .../ns-f/index_SORT_BY_METHOD_DESC.html | 68 + htmlReport/ns-f/index_SORT_BY_NAME_DESC.html | 68 + htmlReport/ns-f/sources/source-1.html | 95 ++ htmlReport/ns-f/sources/source-2.html | 97 ++ htmlReport/ns-f/sources/source-3.html | 89 ++ .../SempreAlertaApplicationTests.java | 4 +- .../controllers/PostControllerTest.java | 109 ++ .../entity/post/mocks/PostMocks.java | 2 +- 217 files changed, 35000 insertions(+), 2 deletions(-) create mode 100644 htmlReport/css/coverage.css create mode 100644 htmlReport/css/idea.min.css create mode 100644 htmlReport/img/arrowDown.gif create mode 100644 htmlReport/img/arrowUp.gif create mode 100644 htmlReport/index.html create mode 100644 htmlReport/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/index_SORT_BY_CLASS.html create mode 100644 htmlReport/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/index_SORT_BY_LINE.html create mode 100644 htmlReport/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/index_SORT_BY_METHOD.html create mode 100644 htmlReport/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/js/highlight.min.js create mode 100644 htmlReport/js/highlightjs-line-numbers.min.js create mode 100644 htmlReport/ns-1/index.html create mode 100644 htmlReport/ns-1/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-1/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-1/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-1/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-1/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-1/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-1/sources/source-1.html create mode 100644 htmlReport/ns-10/index.html create mode 100644 htmlReport/ns-10/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-10/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-10/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-10/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-10/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-10/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-10/sources/source-1.html create mode 100644 htmlReport/ns-10/sources/source-2.html create mode 100644 htmlReport/ns-10/sources/source-3.html create mode 100644 htmlReport/ns-2/index.html create mode 100644 htmlReport/ns-2/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-2/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-2/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-2/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-2/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-2/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-2/sources/source-1.html create mode 100644 htmlReport/ns-2/sources/source-2.html create mode 100644 htmlReport/ns-2/sources/source-3.html create mode 100644 htmlReport/ns-3/index.html create mode 100644 htmlReport/ns-3/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-3/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-3/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-3/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-3/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-3/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-3/sources/source-1.html create mode 100644 htmlReport/ns-3/sources/source-2.html create mode 100644 htmlReport/ns-3/sources/source-3.html create mode 100644 htmlReport/ns-4/index.html create mode 100644 htmlReport/ns-4/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-4/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-4/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-4/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-4/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-4/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-4/sources/source-1.html create mode 100644 htmlReport/ns-5/index.html create mode 100644 htmlReport/ns-5/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-5/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-5/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-5/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-5/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-5/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-5/sources/source-1.html create mode 100644 htmlReport/ns-5/sources/source-2.html create mode 100644 htmlReport/ns-5/sources/source-3.html create mode 100644 htmlReport/ns-6/index.html create mode 100644 htmlReport/ns-6/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-6/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-6/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-6/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-6/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-6/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-6/sources/source-1.html create mode 100644 htmlReport/ns-6/sources/source-2.html create mode 100644 htmlReport/ns-6/sources/source-3.html create mode 100644 htmlReport/ns-7/index.html create mode 100644 htmlReport/ns-7/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-7/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-7/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-7/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-7/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-7/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-7/sources/source-1.html create mode 100644 htmlReport/ns-7/sources/source-2.html create mode 100644 htmlReport/ns-8/index.html create mode 100644 htmlReport/ns-8/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-8/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-8/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-8/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-8/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-8/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-8/sources/source-1.html create mode 100644 htmlReport/ns-8/sources/source-2.html create mode 100644 htmlReport/ns-8/sources/source-3.html create mode 100644 htmlReport/ns-9/index.html create mode 100644 htmlReport/ns-9/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-9/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-9/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-9/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-9/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-9/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-9/sources/source-1.html create mode 100644 htmlReport/ns-a/index.html create mode 100644 htmlReport/ns-a/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-a/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-a/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-a/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-a/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-a/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-a/sources/source-1.html create mode 100644 htmlReport/ns-b/index.html create mode 100644 htmlReport/ns-b/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-b/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-b/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-b/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-b/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-b/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-b/sources/source-1.html create mode 100644 htmlReport/ns-b/sources/source-2.html create mode 100644 htmlReport/ns-b/sources/source-3.html create mode 100644 htmlReport/ns-b/sources/source-4.html create mode 100644 htmlReport/ns-c/index.html create mode 100644 htmlReport/ns-c/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-c/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-c/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-c/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-c/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-c/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-c/sources/source-1.html create mode 100644 htmlReport/ns-c/sources/source-2.html create mode 100644 htmlReport/ns-d/index.html create mode 100644 htmlReport/ns-d/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-d/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-d/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-d/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-d/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-d/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-d/sources/source-1.html create mode 100644 htmlReport/ns-e/index.html create mode 100644 htmlReport/ns-e/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-e/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-e/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-e/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-e/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-e/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-e/sources/source-1.html create mode 100644 htmlReport/ns-e/sources/source-2.html create mode 100644 htmlReport/ns-e/sources/source-3.html create mode 100644 htmlReport/ns-f/index.html create mode 100644 htmlReport/ns-f/index_SORT_BY_BLOCK.html create mode 100644 htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html create mode 100644 htmlReport/ns-f/index_SORT_BY_CLASS.html create mode 100644 htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html create mode 100644 htmlReport/ns-f/index_SORT_BY_LINE.html create mode 100644 htmlReport/ns-f/index_SORT_BY_LINE_DESC.html create mode 100644 htmlReport/ns-f/index_SORT_BY_METHOD.html create mode 100644 htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html create mode 100644 htmlReport/ns-f/index_SORT_BY_NAME_DESC.html create mode 100644 htmlReport/ns-f/sources/source-1.html create mode 100644 htmlReport/ns-f/sources/source-2.html create mode 100644 htmlReport/ns-f/sources/source-3.html create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java diff --git a/.gitignore b/.gitignore index 7c60eb9..3b5258c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ +htmlReport ### STS ### .apt_generated diff --git a/htmlReport/css/coverage.css b/htmlReport/css/coverage.css new file mode 100644 index 0000000..cef7765 --- /dev/null +++ b/htmlReport/css/coverage.css @@ -0,0 +1,154 @@ +/* + * Copyright 2000-2021 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +* { + margin: 0; + padding: 0; +} + +body { + background-color: #fff; + font-family: helvetica neue, tahoma, arial, sans-serif; + font-size: 82%; + color: #151515; +} + +h1 { + margin: 0.5em 0; + color: #010101; + font-weight: normal; + font-size: 18px; +} + +h2 { + margin: 0.5em 0; + color: #010101; + font-weight: normal; + font-size: 16px; +} + +a { + color: #1564C2; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +span.separator { + color: #9BA9BA; + padding-left: 5px; + padding-right: 5px; +} + +div.content { + width: 99%; +} + +table.coverageStats { + width: 100%; + border-collapse: collapse; +} + +table.overallStats { + width: 20%; +} + +table.coverageStats td, table.coverageStats th { + padding: 4px 2px; + border-bottom: 1px solid #ccc; +} + +table.coverageStats th { + background-color: #959BA4; + border: none; + font-weight: bold; + text-align: left; + color: #FFF; +} + +table.coverageStats th.coverageStat { + width: 15%; +} + +table.coverageStats th a { + color: #FFF; +} + +table.coverageStats th a:hover { + text-decoration: none; +} + +table.coverageStats th.sortedDesc a { + background: url(../img/arrowDown.gif) no-repeat 100% 2px; + padding-right: 20px; +} + +table.coverageStats th.sortedAsc a { + background: url(../img/arrowUp.gif) no-repeat 100% 2px; + padding-right: 20px; +} + +div.footer { + margin: 2em .5em; + font-size: 85%; + text-align: left; + line-height: 140%; +} + +code.sourceCode { + width: 100%; + border: 1px solid #ccc; + font: normal 12px 'Menlo', 'Bitstream Vera Sans Mono', 'Courier New', 'Courier', monospace; + white-space: pre; +} + +code.sourceCode b { + font-weight: normal; +} + +code.sourceCode span.number { + color: #151515; +} + +code.sourceCode .fc { + background-color: #cfc; +} + +code.sourceCode .pc { + background-color: #ffc; +} + +code.sourceCode .nc { + background-color: #fcc; +} + +.percent, .absValue { + font-size: 90%; +} + +.percent .green, .absValue .green { + color: #32cc32; +} + +.percent .red, .absValue .red { + color: #f00; +} + +.percent .totalDiff { + color: #3f3f3f; +} diff --git a/htmlReport/css/idea.min.css b/htmlReport/css/idea.min.css new file mode 100644 index 0000000..a8d5292 --- /dev/null +++ b/htmlReport/css/idea.min.css @@ -0,0 +1,118 @@ +/* + * Copyright 2000-2021 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* +Intellij Idea-like styling (c) Vasily Polovnyov +*/ + +.hljs { + color: #000; + background: #fff; +} + +.hljs-subst, +.hljs-title { + font-weight: normal; + color: #000; +} + +.hljs-comment, +.hljs-quote { + color: #808080; + font-style: italic; +} + +.hljs-meta { + color: #808000; +} + +.hljs-tag { + background: #efefef; +} + +.hljs-section, +.hljs-name, +.hljs-literal, +.hljs-keyword, +.hljs-selector-tag, +.hljs-type, +.hljs-selector-id, +.hljs-selector-class { + font-weight: bold; + color: #000080; +} + +.hljs-attribute, +.hljs-number, +.hljs-regexp, +.hljs-link { + font-weight: bold; + color: #0000ff; +} + +.hljs-number, +.hljs-regexp, +.hljs-link { + font-weight: normal; +} + +.hljs-string { + color: #008000; + font-weight: bold; +} + +.hljs-symbol, +.hljs-bullet, +.hljs-formula { + color: #000; + background: #d0eded; + font-style: italic; +} + +.hljs-doctag { + text-decoration: underline; +} + +.hljs-variable, +.hljs-template-variable { + color: #660e7a; +} + +.hljs-addition { + background: #baeeba; +} + +.hljs-deletion { + background: #ffc8bd; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-ln-numbers { + display: block; + float: left; + width: 3em; + border-right: 1px solid #ccc; + font-style: normal; + text-align: right; + background-color: #eee; +} diff --git a/htmlReport/img/arrowDown.gif b/htmlReport/img/arrowDown.gif new file mode 100644 index 0000000000000000000000000000000000000000..a4ac9b4b0f5eee9fc82deb7f03d0cc7f197b01c7 GIT binary patch literal 89 zcmZ?wbhEHbv%yJ&P?))?G g5?!@7agD+*@rGjs@joUks8}}Ha%HfNHz$KN0Orjd82|tP literal 0 HcmV?d00001 diff --git a/htmlReport/img/arrowUp.gif b/htmlReport/img/arrowUp.gif new file mode 100644 index 0000000000000000000000000000000000000000..d488db0089f15409b83a6f39718384cac89ea3c9 GIT binary patch literal 91 zcmZ?wbhEHbv%nBa6?))=2 j#jeJ<$W6!S$=vG=3s*2Wu3C5I!M+a(XH6zEFjxZs9OxeQ literal 0 HcmV?d00001 diff --git a/htmlReport/index.html b/htmlReport/index.html new file mode 100644 index 0000000..9fa4185 --- /dev/null +++ b/htmlReport/index.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_BLOCK.html b/htmlReport/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..ff1891b --- /dev/null +++ b/htmlReport/index_SORT_BY_BLOCK.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_BLOCK_DESC.html b/htmlReport/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..2a214af --- /dev/null +++ b/htmlReport/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_CLASS.html b/htmlReport/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..bd408ce --- /dev/null +++ b/htmlReport/index_SORT_BY_CLASS.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_CLASS_DESC.html b/htmlReport/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..4042177 --- /dev/null +++ b/htmlReport/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_LINE.html b/htmlReport/index_SORT_BY_LINE.html new file mode 100644 index 0000000..2977eaf --- /dev/null +++ b/htmlReport/index_SORT_BY_LINE.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_LINE_DESC.html b/htmlReport/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..d965572 --- /dev/null +++ b/htmlReport/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_METHOD.html b/htmlReport/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..7e76ca4 --- /dev/null +++ b/htmlReport/index_SORT_BY_METHOD.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_METHOD_DESC.html b/htmlReport/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..04609f9 --- /dev/null +++ b/htmlReport/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+
+ + + + + + + diff --git a/htmlReport/index_SORT_BY_NAME_DESC.html b/htmlReport/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..f6fcd61 --- /dev/null +++ b/htmlReport/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,439 @@ + + + + + + + Coverage Report > Summary + + + + + + +
+ + +

Overall Coverage Summary

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
all classes + + 78.6% + + + (22/28) + + + + 81.2% + + + (121/149) + + + + 83.1% + + + (255/307) + +
+ +
+

Coverage Breakdown

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+
+ + + + + + + diff --git a/htmlReport/js/highlight.min.js b/htmlReport/js/highlight.min.js new file mode 100644 index 0000000..e887315 --- /dev/null +++ b/htmlReport/js/highlight.min.js @@ -0,0 +1,1388 @@ +/* + Highlight.js 10.7.2 (00233d63) + License: BSD-3-Clause + Copyright (c) 2006-2021, Ivan Sagalaev + + BSD 3-Clause License + + Copyright (c) 2006-2021, Ivan Sagalaev. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +var hljs=function(){"use strict";function e(t){ +return t instanceof Map?t.clear=t.delete=t.set=()=>{ +throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{var i=t[n] +;"object"!=typeof i||Object.isFrozen(i)||e(i)})),t}var t=e,n=e;t.default=n +;class i{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function s(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function a(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] +;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const r=e=>!!e.kind +;class l{constructor(e,t){ +this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ +this.buffer+=s(e)}openNode(e){if(!r(e))return;let t=e.kind +;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){ +r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}class o{constructor(){this.rootNode={ +children:[]},this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} +;this.add(t),this.stack.push(t)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ +return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), +t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +o._collapse(e)})))}}class c extends o{constructor(e){super(),this.options=e} +addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} +addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root +;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ +return new l(this,this.options).value()}finalize(){return!0}}function g(e){ +return e?"string"==typeof e?e:e.source:null} +const u=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,h="[a-zA-Z]\\w*",d="[a-zA-Z_]\\w*",f="\\b\\d+(\\.\\d+)?",p="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m="\\b(0b[01]+)",b={ +begin:"\\\\[\\s\\S]",relevance:0},E={className:"string",begin:"'",end:"'", +illegal:"\\n",contains:[b]},x={className:"string",begin:'"',end:'"', +illegal:"\\n",contains:[b]},v={ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},w=(e,t,n={})=>{const i=a({className:"comment",begin:e,end:t,contains:[]},n) +;return i.contains.push(v),i.contains.push({className:"doctag", +begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i +},y=w("//","$"),N=w("/\\*","\\*/"),R=w("#","$");var _=Object.freeze({ +__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:h,UNDERSCORE_IDENT_RE:d, +NUMBER_RE:f,C_NUMBER_RE:p,BINARY_NUMBER_RE:m, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const t=/^#![ ]*\// +;return e.binary&&(e.begin=((...e)=>e.map((e=>g(e))).join(""))(t,/.*\b/,e.binary,/\b.*/)), +a({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{ +0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:b,APOS_STRING_MODE:E, +QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:v,COMMENT:w,C_LINE_COMMENT_MODE:y, +C_BLOCK_COMMENT_MODE:N,HASH_COMMENT_MODE:R,NUMBER_MODE:{className:"number", +begin:f,relevance:0},C_NUMBER_MODE:{className:"number",begin:p,relevance:0}, +BINARY_NUMBER_MODE:{className:"number",begin:m,relevance:0},CSS_NUMBER_MODE:{ +className:"number", +begin:f+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", +relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp", +begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[b,{begin:/\[/,end:/\]/, +relevance:0,contains:[b]}]}]},TITLE_MODE:{className:"title",begin:h,relevance:0 +},UNDERSCORE_TITLE_MODE:{className:"title",begin:d,relevance:0},METHOD_GUARD:{ +begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ +t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function k(e,t){ +"."===e.input[e.index-1]&&t.ignoreMatch()}function M(e,t){ +t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=k,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function O(e,t){ +Array.isArray(e.illegal)&&(e.illegal=((...e)=>"("+e.map((e=>g(e))).join("|")+")")(...e.illegal)) +}function A(e,t){if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function L(e,t){ +void 0===e.relevance&&(e.relevance=1)} +const I=["of","and","for","in","not","or","if","then","parent","list","value"] +;function j(e,t,n="keyword"){const i={} +;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ +Object.assign(i,j(e[n],t,n))})),i;function s(e,n){ +t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") +;i[n[0]]=[e,B(n[0],n[1])]}))}}function B(e,t){ +return t?Number(t):(e=>I.includes(e.toLowerCase()))(e)?0:1} +function T(e,{plugins:t}){function n(t,n){ +return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{ +constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,t){ +t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), +this.matchAt+=(e=>RegExp(e.toString()+"|").exec("").length-1)(e)+1}compile(){ +0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(((e,t="|")=>{let n=0 +;return e.map((e=>{n+=1;const t=n;let i=g(e),s="";for(;i.length>0;){ +const e=u.exec(i);if(!e){s+=i;break} +s+=i.substring(0,e.index),i=i.substring(e.index+e[0].length), +"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0],"("===e[0]&&n++)}return s +})).map((e=>`(${e})`)).join(t)})(e),!0),this.lastIndex=0}exec(e){ +this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e) +;if(!t)return null +;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] +;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const t=new i +;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), +t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ +this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ +const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex +;let n=t.exec(e) +;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ +const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} +return n&&(this.regexIndex+=n.position+1, +this.regexIndex===this.count&&this.considerAll()),n}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=a(e.classNameAliases||{}),function t(i,r){const l=i +;if(i.isCompiled)return l +;[A].forEach((e=>e(i,r))),e.compilerExtensions.forEach((e=>e(i,r))), +i.__beforeBegin=null,[M,O,L].forEach((e=>e(i,r))),i.isCompiled=!0;let o=null +;if("object"==typeof i.keywords&&(o=i.keywords.$pattern, +delete i.keywords.$pattern), +i.keywords&&(i.keywords=j(i.keywords,e.case_insensitive)), +i.lexemes&&o)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ") +;return o=o||i.lexemes||/\w+/, +l.keywordPatternRe=n(o,!0),r&&(i.begin||(i.begin=/\B|\b/), +l.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin), +i.end||i.endsWithParent||(i.end=/\B|\b/), +i.end&&(l.endRe=n(i.end)),l.terminatorEnd=g(i.end)||"", +i.endsWithParent&&r.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+r.terminatorEnd)), +i.illegal&&(l.illegalRe=n(i.illegal)), +i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>a(e,{ +variants:null},t)))),e.cachedVariants?e.cachedVariants:S(e)?a(e,{ +starts:e.starts?a(e.starts):null +}):Object.isFrozen(e)?a(e):e))("self"===e?i:e)))),i.contains.forEach((e=>{t(e,l) +})),i.starts&&t(i.starts,r),l.matcher=(e=>{const t=new s +;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(l),l}(e)}function S(e){ +return!!e&&(e.endsWithParent||S(e.starts))}function P(e){const t={ +props:["language","code","autodetect"],data:()=>({detectedLanguage:"", +unknownLanguage:!1}),computed:{className(){ +return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){ +if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`), +this.unknownLanguage=!0,s(this.code);let t={} +;return this.autoDetect?(t=e.highlightAuto(this.code), +this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals), +this.detectedLanguage=this.language),t.value},autoDetect(){ +return!(this.language&&(e=this.autodetect,!e&&""!==e));var e}, +ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{ +class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{ +Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const D={ +"after:highlightElement":({el:e,result:t,text:n})=>{const i=H(e) +;if(!i.length)return;const a=document.createElement("div") +;a.innerHTML=t.value,t.value=((e,t,n)=>{let i=0,a="";const r=[];function l(){ +return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function c(e){ +a+=""}function g(e){("start"===e.event?o:c)(e.node)} +for(;e.length||t.length;){let t=l() +;if(a+=s(n.substring(i,t[0].offset)),i=t[0].offset,t===e){r.reverse().forEach(c) +;do{g(t.splice(0,1)[0]),t=l()}while(t===e&&t.length&&t[0].offset===i) +;r.reverse().forEach(o) +}else"start"===t[0].event?r.push(t[0].node):r.pop(),g(t.splice(0,1)[0])} +return a+s(n.substr(i))})(i,H(a),n)}};function C(e){ +return e.nodeName.toLowerCase()}function H(e){const t=[];return function e(n,i){ +for(let s=n.firstChild;s;s=s.nextSibling)3===s.nodeType?i+=s.nodeValue.length:1===s.nodeType&&(t.push({ +event:"start",offset:i,node:s}),i=e(s,i),C(s).match(/br|hr|img|input/)||t.push({ +event:"stop",offset:i,node:s}));return i}(e,0),t}const $={},U=e=>{ +console.error(e)},z=(e,...t)=>{console.log("WARN: "+e,...t)},K=(e,t)=>{ +$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$[`${e}/${t}`]=!0) +},G=s,V=a,W=Symbol("nomatch");return(e=>{ +const n=Object.create(null),s=Object.create(null),a=[];let r=!0 +;const l=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",g={ +disableAutodetect:!0,name:"Plain text",contains:[]};let u={ +noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +tabReplace:null,useBR:!1,languages:null,__emitter:c};function h(e){ +return u.noHighlightRe.test(e)}function d(e,t,n,i){let s="",a="" +;"object"==typeof t?(s=e, +n=t.ignoreIllegals,a=t.language,i=void 0):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."), +K("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +a=e,s=t);const r={code:s,language:a};M("before:highlight",r) +;const l=r.result?r.result:f(r.language,r.code,n,i) +;return l.code=r.code,M("after:highlight",l),l}function f(e,t,s,l){ +function c(e,t){const n=v.case_insensitive?t[0].toLowerCase():t[0] +;return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]} +function g(){null!=R.subLanguage?(()=>{if(""===M)return;let e=null +;if("string"==typeof R.subLanguage){ +if(!n[R.subLanguage])return void k.addText(M) +;e=f(R.subLanguage,M,!0,_[R.subLanguage]),_[R.subLanguage]=e.top +}else e=p(M,R.subLanguage.length?R.subLanguage:null) +;R.relevance>0&&(O+=e.relevance),k.addSublanguage(e.emitter,e.language) +})():(()=>{if(!R.keywords)return void k.addText(M);let e=0 +;R.keywordPatternRe.lastIndex=0;let t=R.keywordPatternRe.exec(M),n="";for(;t;){ +n+=M.substring(e,t.index);const i=c(R,t);if(i){const[e,s]=i +;if(k.addText(n),n="",O+=s,e.startsWith("_"))n+=t[0];else{ +const n=v.classNameAliases[e]||e;k.addKeyword(t[0],n)}}else n+=t[0] +;e=R.keywordPatternRe.lastIndex,t=R.keywordPatternRe.exec(M)} +n+=M.substr(e),k.addText(n)})(),M=""}function h(e){ +return e.className&&k.openNode(v.classNameAliases[e.className]||e.className), +R=Object.create(e,{parent:{value:R}}),R}function d(e,t,n){let s=((e,t)=>{ +const n=e&&e.exec(t);return n&&0===n.index})(e.endRe,n);if(s){if(e["on:end"]){ +const n=new i(e);e["on:end"](t,n),n.isMatchIgnored&&(s=!1)}if(s){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return d(e.parent,t,n)}function m(e){ +return 0===R.matcher.regexIndex?(M+=e[0],1):(I=!0,0)}function b(e){ +const n=e[0],i=t.substr(e.index),s=d(R,e,i);if(!s)return W;const a=R +;a.skip?M+=n:(a.returnEnd||a.excludeEnd||(M+=n),g(),a.excludeEnd&&(M=n));do{ +R.className&&k.closeNode(),R.skip||R.subLanguage||(O+=R.relevance),R=R.parent +}while(R!==s.parent) +;return s.starts&&(s.endSameAsBegin&&(s.starts.endRe=s.endRe), +h(s.starts)),a.returnEnd?0:n.length}let E={};function x(n,a){const l=a&&a[0] +;if(M+=n,null==l)return g(),0 +;if("begin"===E.type&&"end"===a.type&&E.index===a.index&&""===l){ +if(M+=t.slice(a.index,a.index+1),!r){const t=Error("0 width match regex") +;throw t.languageName=e,t.badRule=E.rule,t}return 1} +if(E=a,"begin"===a.type)return function(e){ +const t=e[0],n=e.rule,s=new i(n),a=[n.__beforeBegin,n["on:begin"]] +;for(const n of a)if(n&&(n(e,s),s.isMatchIgnored))return m(t) +;return n&&n.endSameAsBegin&&(n.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")), +n.skip?M+=t:(n.excludeBegin&&(M+=t), +g(),n.returnBegin||n.excludeBegin||(M=t)),h(n),n.returnBegin?0:t.length}(a) +;if("illegal"===a.type&&!s){ +const e=Error('Illegal lexeme "'+l+'" for mode "'+(R.className||"")+'"') +;throw e.mode=R,e}if("end"===a.type){const e=b(a);if(e!==W)return e} +if("illegal"===a.type&&""===l)return 1 +;if(L>1e5&&L>3*a.index)throw Error("potential infinite loop, way more iterations than matches") +;return M+=l,l.length}const v=N(e) +;if(!v)throw U(o.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const w=T(v,{plugins:a});let y="",R=l||w;const _={},k=new u.__emitter(u);(()=>{ +const e=[];for(let t=R;t!==v;t=t.parent)t.className&&e.unshift(t.className) +;e.forEach((e=>k.openNode(e)))})();let M="",O=0,A=0,L=0,I=!1;try{ +for(R.matcher.considerAll();;){ +L++,I?I=!1:R.matcher.considerAll(),R.matcher.lastIndex=A +;const e=R.matcher.exec(t);if(!e)break;const n=x(t.substring(A,e.index),e) +;A=e.index+n}return x(t.substr(A)),k.closeAllNodes(),k.finalize(),y=k.toHTML(),{ +relevance:Math.floor(O),value:y,language:e,illegal:!1,emitter:k,top:R}}catch(n){ +if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{ +msg:n.message,context:t.slice(A-100,A+100),mode:n.mode},sofar:y,relevance:0, +value:G(t),emitter:k};if(r)return{illegal:!1,relevance:0,value:G(t),emitter:k, +language:e,top:R,errorRaised:n};throw n}}function p(e,t){ +t=t||u.languages||Object.keys(n);const i=(e=>{const t={relevance:0, +emitter:new u.__emitter(u),value:G(e),illegal:!1,top:g} +;return t.emitter.addText(e),t})(e),s=t.filter(N).filter(k).map((t=>f(t,e,!1))) +;s.unshift(i);const a=s.sort(((e,t)=>{ +if(e.relevance!==t.relevance)return t.relevance-e.relevance +;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1 +;if(N(t.language).supersetOf===e.language)return-1}return 0})),[r,l]=a,o=r +;return o.second_best=l,o}const m={"before:highlightElement":({el:e})=>{ +u.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")) +},"after:highlightElement":({result:e})=>{ +u.useBR&&(e.value=e.value.replace(/\n/g,"
"))}},b=/^(<[^>]+>|\t)+/gm,E={ +"after:highlightElement":({result:e})=>{ +u.tabReplace&&(e.value=e.value.replace(b,(e=>e.replace(/\t/g,u.tabReplace))))}} +;function x(e){let t=null;const n=(e=>{let t=e.className+" " +;t+=e.parentNode?e.parentNode.className:"";const n=u.languageDetectRe.exec(t) +;if(n){const t=N(n[1]) +;return t||(z(o.replace("{}",n[1])),z("Falling back to no-highlight mode for this block.",e)), +t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>h(e)||N(e)))})(e) +;if(h(n))return;M("before:highlightElement",{el:e,language:n}),t=e +;const i=t.textContent,a=n?d(i,{language:n,ignoreIllegals:!0}):p(i) +;M("after:highlightElement",{el:e,result:a,text:i +}),e.innerHTML=a.value,((e,t,n)=>{const i=t?s[t]:n +;e.classList.add("hljs"),i&&e.classList.add(i)})(e,n,a.language),e.result={ +language:a.language,re:a.relevance,relavance:a.relevance +},a.second_best&&(e.second_best={language:a.second_best.language, +re:a.second_best.relevance,relavance:a.second_best.relevance})}const v=()=>{ +v.called||(v.called=!0, +K("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."), +document.querySelectorAll("pre code").forEach(x))};let w=!1;function y(){ +"loading"!==document.readyState?document.querySelectorAll("pre code").forEach(x):w=!0 +}function N(e){return e=(e||"").toLowerCase(),n[e]||n[s[e]]} +function R(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +s[e.toLowerCase()]=t}))}function k(e){const t=N(e) +;return t&&!t.disableAutodetect}function M(e,t){const n=e;a.forEach((e=>{ +e[n]&&e[n](t)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +w&&y()}),!1),Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:y, +fixMarkup:e=>{ +return K("10.2.0","fixMarkup will be removed entirely in v11.0"),K("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"), +t=e, +u.tabReplace||u.useBR?t.replace(l,(e=>"\n"===e?u.useBR?"
":e:u.tabReplace?e.replace(/\t/g,u.tabReplace):e)):t +;var t},highlightElement:x, +highlightBlock:e=>(K("10.7.0","highlightBlock will be removed entirely in v12.0"), +K("10.7.0","Please use highlightElement now."),x(e)),configure:e=>{ +e.useBR&&(K("10.3.0","'useBR' will be removed entirely in v11.0"), +K("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")), +u=V(u,e)},initHighlighting:v,initHighlightingOnLoad:()=>{ +K("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."), +w=!0},registerLanguage:(t,i)=>{let s=null;try{s=i(e)}catch(e){ +if(U("Language definition for '{}' could not be registered.".replace("{}",t)), +!r)throw e;U(e),s=g} +s.name||(s.name=t),n[t]=s,s.rawDefinition=i.bind(null,e),s.aliases&&R(s.aliases,{ +languageName:t})},unregisterLanguage:e=>{delete n[e] +;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, +listLanguages:()=>Object.keys(n),getLanguage:N,registerAliases:R, +requireLanguage:e=>{ +K("10.4.0","requireLanguage will be removed entirely in v11."), +K("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844") +;const t=N(e);if(t)return t +;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))}, +autoDetection:k,inherit:V,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ +e["before:highlightBlock"](Object.assign({block:t.el},t)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ +e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),a.push(e)}, +vuePlugin:P(e).VuePlugin}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0 +},e.versionString="10.7.2";for(const e in _)"object"==typeof _[e]&&t(_[e]) +;return Object.assign(e,_),e.addPlugin(m),e.addPlugin(D),e.addPlugin(E),e})({}) +}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); +hljs.registerLanguage("apache",(()=>{"use strict";return e=>{const n={ +className:"number",begin:/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/} +;return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0, +contains:[e.HASH_COMMENT_MODE,{className:"section",begin:/<\/?/,end:/>/, +contains:[n,{className:"number",begin:/:\d{1,5}/ +},e.inherit(e.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute", +begin:/\w+/,relevance:0,keywords:{ +nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername" +},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"}, +contains:[{className:"meta",begin:/\s\[/,end:/\]$/},{className:"variable", +begin:/[\$%]\{/,end:/\}/,contains:["self",{className:"number",begin:/[$%]\d+/}] +},n,{className:"number",begin:/\d+/},e.QUOTE_STRING_MODE]}}],illegal:/\S/}} +})()); +hljs.registerLanguage("bash",(()=>{"use strict";function e(...e){ +return e.map((e=>{return(s=e)?"string"==typeof s?s:s.source:null;var s +})).join("")}return s=>{const n={},t={begin:/\$\{/,end:/\}/,contains:["self",{ +begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{ +begin:e(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},t]});const a={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},i={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, +contains:[s.BACKSLASH_ESCAPE,n,a]};a.contains.push(c);const o={begin:/\$\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,n] +},r=s.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/, +keyword:"if then else elif fi for while in do done case esac function", +literal:"true false", +built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp" +},contains:[r,s.SHEBANG(),l,o,s.HASH_COMMENT_MODE,i,c,{className:"",begin:/\\"/ +},{className:"string",begin:/'/,end:/'/},n]}}})()); +hljs.registerLanguage("c",(()=>{"use strict";function e(e){ +return((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(",e,")?") +}return t=>{const n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),r="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+e(r)+"[a-zA-Z_]\\w*"+e("<[^<>]+>")+")",i={ +className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string", +variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n", +contains:[t.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},t.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},t.inherit(s,{className:"meta-string"}),{ +className:"meta-string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},l={ +className:"title",begin:e(r)+t.IDENT_RE,relevance:0 +},d=e(r)+t.IDENT_RE+"\\s*\\(",u={ +keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary", +literal:"true false nullptr NULL"},m=[c,i,n,t.C_BLOCK_COMMENT_MODE,o,s],p={ +variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{ +beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:m.concat([{ +begin:/\(/,end:/\)/,keywords:u,contains:m.concat(["self"]),relevance:0}]), +relevance:0},_={className:"function",begin:"("+a+"[\\*&\\s]+)+"+d, +returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/, +contains:[{begin:"decltype\\(auto\\)",keywords:u,relevance:0},{begin:d, +returnBegin:!0,contains:[l],relevance:0},{className:"params",begin:/\(/, +end:/\)/,keywords:u,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,s,o,i,{ +begin:/\(/,end:/\)/,keywords:u,relevance:0, +contains:["self",n,t.C_BLOCK_COMMENT_MODE,s,o,i]}] +},i,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u, +disableAutodetect:!0,illegal:"",keywords:u,contains:["self",i]},{begin:t.IDENT_RE+"::",keywords:u},{ +className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/, +contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{ +preprocessor:c,strings:s,keywords:u}}}})()); +hljs.registerLanguage("coffeescript",(()=>{"use strict" +;const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) +;return r=>{const t={ +keyword:e.concat(["then","unless","until","loop","by","when","and","or","is","isnt","not"]).filter((i=["var","const","let","function","static"], +e=>!i.includes(e))),literal:n.concat(["yes","no","on","off"]), +built_in:a.concat(["npm","print"])};var i;const s="[A-Za-z$_][0-9A-Za-z$_]*",o={ +className:"subst",begin:/#\{/,end:/\}/,keywords:t +},c=[r.BINARY_NUMBER_MODE,r.inherit(r.C_NUMBER_MODE,{starts:{end:"(\\s*/)?", +relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/, +contains:[r.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[r.BACKSLASH_ESCAPE] +},{begin:/"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,o]},{begin:/"/,end:/"/, +contains:[r.BACKSLASH_ESCAPE,o]}]},{className:"regexp",variants:[{begin:"///", +end:"///",contains:[o,r.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)", +relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+s +},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{ +begin:"```",end:"```"},{begin:"`",end:"`"}]}];o.contains=c +;const l=r.inherit(r.TITLE_MODE,{begin:s}),d="(\\(.*\\)\\s*)?\\B[-=]>",g={ +className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/, +end:/\)/,keywords:t,contains:["self"].concat(c)}]};return{name:"CoffeeScript", +aliases:["coffee","cson","iced"],keywords:t,illegal:/\/\*/, +contains:c.concat([r.COMMENT("###","###"),r.HASH_COMMENT_MODE,{ +className:"function",begin:"^\\s*"+s+"\\s*=\\s*"+d,end:"[-=]>",returnBegin:!0, +contains:[l,g]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function", +begin:d,end:"[-=]>",returnBegin:!0,contains:[g]}]},{className:"class", +beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{ +beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[l]},l] +},{begin:s+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}})()); +hljs.registerLanguage("cpp",(()=>{"use strict";function e(e){ +return t("(",e,")?")}function t(...e){return e.map((e=>{ +return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}return n=>{ +const r=n.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),a="[a-zA-Z_]\\w*::",i="(decltype\\(auto\\)|"+e(a)+"[a-zA-Z_]\\w*"+e("<[^<>]+>")+")",s={ +className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string", +variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n", +contains:[n.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},n.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},n.inherit(c,{className:"meta-string"}),{ +className:"meta-string",begin:/<.*?>/},r,n.C_BLOCK_COMMENT_MODE]},d={ +className:"title",begin:e(a)+n.IDENT_RE,relevance:0 +},u=e(a)+n.IDENT_RE+"\\s*\\(",m={ +keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq", +built_in:"_Bool _Complex _Imaginary", +_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"], +literal:"true false nullptr NULL"},p={className:"function.dispatch",relevance:0, +keywords:m, +begin:t(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,n.IDENT_RE,(_=/\s*\(/, +t("(?=",_,")")))};var _;const g=[p,l,s,r,n.C_BLOCK_COMMENT_MODE,o,c],b={ +variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{ +beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:g.concat([{ +begin:/\(/,end:/\)/,keywords:m,contains:g.concat(["self"]),relevance:0}]), +relevance:0},f={className:"function",begin:"("+i+"[\\*&\\s]+)+"+u, +returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/, +contains:[{begin:"decltype\\(auto\\)",keywords:m,relevance:0},{begin:u, +returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/, +endsWithParent:!0,contains:[c,o]},{className:"params",begin:/\(/,end:/\)/, +keywords:m,relevance:0,contains:[r,n.C_BLOCK_COMMENT_MODE,c,o,s,{begin:/\(/, +end:/\)/,keywords:m,relevance:0,contains:["self",r,n.C_BLOCK_COMMENT_MODE,c,o,s] +}]},s,r,n.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:m,illegal:"",keywords:m,contains:["self",s]},{begin:n.IDENT_RE+"::",keywords:m},{ +className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/, +contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{ +preprocessor:l,strings:c,keywords:m}}}})()); +hljs.registerLanguage("csharp",(()=>{"use strict";return e=>{const n={ +keyword:["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},a=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},t=e.inherit(s,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/, +keywords:n},l=e.inherit(r,{illegal:/\n/}),c={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,l]},o={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},d=e.inherit(o,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]}) +;r.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE], +l.contains=[d,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a] +},_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"meta-string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,E],relevance:0},{className:"params",begin:/\(/,end:/\)/, +excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,i,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}})()); +hljs.registerLanguage("css",(()=>{"use strict" +;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse() +;return n=>{const a=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, +HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, +ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, +illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} +}))(n),l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS", +case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"}, +classNameAliases:{keyframePosition:"selector-tag"}, +contains:[n.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ +},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 +},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 +},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ +begin:":("+i.join("|")+")"},{begin:"::("+o.join("|")+")"}]},{ +className:"attribute",begin:"\\b("+r.join("|")+")\\b"},{begin:":",end:"[;}]", +contains:[a.HEXCOLOR,a.IMPORTANT,n.CSS_NUMBER_MODE,...l,{ +begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" +},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] +},{className:"built_in",begin:/[\w-]+(?=\()/}]},{ +begin:(s=/@/,((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(?=",s,")")), +end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword", +begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0, +relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only", +attribute:t.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute" +},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag", +begin:"\\b("+e.join("|")+")\\b"}]};var s}})()); +hljs.registerLanguage("diff",(()=>{"use strict";return e=>({name:"Diff", +aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{ +begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{ +begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /, +end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/ +},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{ +begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{ +className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, +end:/$/}]})})()); +hljs.registerLanguage("go",(()=>{"use strict";return e=>{const n={ +keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune", +literal:"true false iota nil", +built_in:"append cap close complex copy imag len make new panic print println real recover delete" +};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{"use strict";function e(...e){ +return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n +})).join("")}return n=>{const a="HTTP/(2|1\\.[01])",s={className:"attribute", +begin:e("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{ +className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]} +},t=[s,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{ +name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})", +end:/$/,contains:[{className:"meta",begin:a},{className:"number", +begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:t}},{ +begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string", +begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{ +className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:t} +},n.inherit(s,{relevance:0})]}}})()); +hljs.registerLanguage("ini",(()=>{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function n(...n){ +return n.map((n=>e(n))).join("")}return s=>{const a={className:"number", +relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:s.NUMBER_RE}] +},i=s.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const t={ +className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/ +}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={ +className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:"'''", +end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"' +},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,a,"self"], +relevance:0 +},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map((n=>e(n))).join("|")+")" +;return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, +contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{ +begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr", +starts:{end:/$/,contains:[i,c,r,t,l,a]}}]}}})()); +hljs.registerLanguage("java",(()=>{"use strict" +;var e="\\.([0-9](_*[0-9])*)",n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={ +className:"number",variants:[{ +begin:`(\\b([0-9](_*[0-9])*)((${e})|\\.)?|(${e}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:`\\b([0-9](_*[0-9])*)((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${e})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ +begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};return e=>{ +var n="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s={ +className:"meta",begin:"@[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*", +contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const r=a;return{ +name:"Java",aliases:["jsp"],keywords:n,illegal:/<\/|#/, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, +relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ +begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ +className:"class",beginKeywords:"class interface enum",end:/[{;=]/, +excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/, +contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"new throw return else",relevance:0},{className:"class", +begin:"record\\s+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0, +end:/[{;=]/,keywords:n,contains:[{beginKeywords:"record"},{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/, +keywords:n,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"function", +begin:"([\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(<[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(\\s*,\\s*[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(", +returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/, +keywords:n,relevance:0, +contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},r,s]}}})()); +hljs.registerLanguage("javascript",(()=>{"use strict" +;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],s=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) +;function r(e){return t("(?=",e,")")}function t(...e){return e.map((e=>{ +return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return i=>{ +const c=e,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/, +isTrulyOpeningTag:(e,n)=>{const a=e[0].length+e.index,s=e.input[a] +;"<"!==s?">"===s&&(((e,{after:n})=>{const a="", +returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{ +begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0 +},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:f}]}] +},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{ +variants:[{begin:"<>",end:""},{begin:o.begin,"on:begin":o.isTrulyOpeningTag, +end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0, +contains:["self"]}]}],relevance:0},{className:"function", +beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:l, +contains:["self",i.inherit(i.TITLE_MODE,{begin:c}),p],illegal:/%/},{ +beginKeywords:"while if switch catch for"},{className:"function", +begin:i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,contains:[p,i.inherit(i.TITLE_MODE,{begin:c})]},{variants:[{ +begin:"\\."+c},{begin:"\\$"+c}],relevance:0},{className:"class", +beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{ +beginKeywords:"extends"},i.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/, +end:/[{;]/,excludeEnd:!0,contains:[i.inherit(i.TITLE_MODE,{begin:c}),"self",p] +},{begin:"(get|set)\\s+(?="+c+"\\()",end:/\{/,keywords:"get set", +contains:[i.inherit(i.TITLE_MODE,{begin:c}),{begin:/\(\)/},p]},{begin:/\$[(.]/}] +}}})()); +hljs.registerLanguage("json",(()=>{"use strict";return n=>{const e={ +literal:"true false null" +},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],a=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],l={ +end:",",endsWithParent:!0,excludeEnd:!0,contains:a,keywords:e},t={begin:/\{/, +end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/, +contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(l,{begin:/:/ +})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(l)], +illegal:"\\S"};return a.push(t,s),i.forEach((n=>{a.push(n)})),{name:"JSON", +contains:a,keywords:e,illegal:"\\S"}}})()); +hljs.registerLanguage("kotlin",(()=>{"use strict" +;var e="\\.([0-9](_*[0-9])*)",n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={ +className:"number",variants:[{ +begin:`(\\b([0-9](_*[0-9])*)((${e})|\\.)?|(${e}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:`\\b([0-9](_*[0-9])*)((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${e})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ +begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};return e=>{const n={ +keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", +built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", +literal:"true false null"},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" +},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},t={ +className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", +variants:[{begin:'"""',end:'"""(?=[^"])',contains:[t,s]},{begin:"'",end:"'", +illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, +contains:[e.BACKSLASH_ESCAPE,t,s]}]};s.contains.push(r);const l={ +className:"meta", +begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" +},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, +end:/\)/,contains:[e.inherit(r,{className:"meta-string"})]}] +},o=a,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),E={ +variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, +contains:[]}]},d=E;return d.variants[1].contains=[E],E.variants[1].contains=[d], +{name:"Kotlin",aliases:["kt","kts"],keywords:n, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,{className:"keyword", +begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", +begin:/@\w+/}]}},i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$", +returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, +keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, +endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, +endsWithParent:!0,contains:[E,e.C_LINE_COMMENT_MODE,b],relevance:0 +},e.C_LINE_COMMENT_MODE,b,l,c,r,e.C_NUMBER_MODE]},b]},{className:"class", +beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, +illegal:"extends implements",contains:[{ +beginKeywords:"public protected internal private constructor" +},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, +excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/, +excludeBegin:!0,returnEnd:!0},l,c]},r,{className:"meta",begin:"^#!/usr/bin/env", +end:"$",illegal:"\n"},o]}}})()); +hljs.registerLanguage("less",(()=>{"use strict" +;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],n=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),r=i.concat(o) +;return a=>{const s=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, +HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, +ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, +illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} +}))(a),l=r,d="([\\w-]+|@\\{[\\w-]+\\})",c=[],g=[],b=e=>({className:"string", +begin:"~?"+e+".*?"+e}),m=(e,t,i)=>({className:e,begin:t,relevance:i}),u={ +$pattern:/[a-z-]+/,keyword:"and or not only",attribute:t.join(" ")},p={ +begin:"\\(",end:"\\)",contains:g,keywords:u,relevance:0} +;g.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,b("'"),b('"'),a.CSS_NUMBER_MODE,{ +begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", +excludeEnd:!0} +},s.HEXCOLOR,p,m("variable","@@?[\\w-]+",10),m("variable","@\\{[\\w-]+\\}"),m("built_in","~?`[^`]*?`"),{ +className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 +},s.IMPORTANT);const f=g.concat({begin:/\{/,end:/\}/,contains:c}),h={ +beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not" +}].concat(g)},w={begin:d+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0, +contains:[{begin:/-(webkit|moz|ms|o)-/},{className:"attribute", +begin:"\\b("+n.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0, +illegal:"[<=$]",relevance:0,contains:g}}]},v={className:"keyword", +begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", +starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:g,relevance:0}},y={ +className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ +begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:f}},k={variants:[{ +begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:d,end:/\{/}],returnBegin:!0, +returnEnd:!0,illegal:"[<='$\"]",relevance:0, +contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,h,m("keyword","all\\b"),m("variable","@\\{[\\w-]+\\}"),{ +begin:"\\b("+e.join("|")+")\\b",className:"selector-tag" +},m("selector-tag",d+"%?",0),m("selector-id","#"+d),m("selector-class","\\."+d,0),m("selector-tag","&",0),s.ATTRIBUTE_SELECTOR_MODE,{ +className:"selector-pseudo",begin:":("+i.join("|")+")"},{ +className:"selector-pseudo",begin:"::("+o.join("|")+")"},{begin:"\\(",end:"\\)", +contains:f},{begin:"!important"}]},E={begin:`[\\w-]+:(:)?(${l.join("|")})`, +returnBegin:!0,contains:[k]} +;return c.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,v,y,E,w,k),{ +name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:c}}})()); +hljs.registerLanguage("lua",(()=>{"use strict";return e=>{ +const t="\\[=*\\[",a="\\]=*\\]",n={begin:t,end:a,contains:["self"] +},o=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",a,{contains:[n], +relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, +literal:"true false nil", +keyword:"and break do else elseif end for goto if in local not or repeat return then until while", +built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" +},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)", +contains:[e.inherit(e.TITLE_MODE,{ +begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", +begin:"\\(",endsWithParent:!0,contains:o}].concat(o) +},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", +begin:t,end:a,contains:[n],relevance:5}])}}})()); +hljs.registerLanguage("makefile",(()=>{"use strict";return e=>{const i={ +className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function n(e){return a("(?=",e,")")} +function a(...n){return n.map((n=>e(n))).join("")}function s(...n){ +return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ +const t=a(/[A-Z_]/,a("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),i={ +className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/, +contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] +},c=e.inherit(r,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{ +className:"meta-string"}),g=e.inherit(e.QUOTE_STRING_MODE,{ +className:"meta-string"}),m={endsWithParent:!0,illegal:/`]+/}]}] +}]};return{name:"HTML, XML", +aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], +case_insensitive:!0,contains:[{className:"meta",begin://, +relevance:10,contains:[r,g,l,c,{begin:/\[/,end:/\]/,contains:[{className:"meta", +begin://,contains:[r,c,g,l]}]}]},e.COMMENT(//,{ +relevance:10}),{begin://,relevance:10},i,{ +className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{ +end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{ +end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ +className:"tag",begin:/<>|<\/>/},{className:"tag", +begin:a(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name", +begin:t,relevance:0,starts:m}]},{className:"tag",begin:a(/<\//,n(a(t,/>/))), +contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0, +endsParent:!0}]}]}}})()); +hljs.registerLanguage("markdown",(()=>{"use strict";function n(...n){ +return n.map((n=>{return(e=n)?"string"==typeof e?e:e.source:null;var e +})).join("")}return e=>{const a={begin:/<\/?[A-Za-z_]/,end:">", +subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0 +},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, +relevance:2},{begin:n(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), +relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ +begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{ +className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, +returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", +end:"\\]",excludeBegin:!0,excludeEnd:!0}]},s={className:"strong",contains:[], +variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},c={ +className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ +begin:/_(?!_)/,end:/_/,relevance:0}]};s.contains.push(c),c.contains.push(s) +;let t=[a,i] +;return s.contains=s.contains.concat(t),c.contains=c.contains.concat(t), +t=t.concat(s,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ +className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:t},{ +begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", +contains:t}]}]},a,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", +end:"\\s+",excludeEnd:!0},s,c,{className:"quote",begin:"^>\\s+",contains:t, +end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ +begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ +begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", +contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ +begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ +className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ +className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})()); +hljs.registerLanguage("nginx",(()=>{"use strict";return e=>{const n={ +className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/\}/},{ +begin:/[$@]/+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,keywords:{ +$pattern:"[a-z/_]+", +literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll" +},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string", +contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/ +}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n] +},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^", +end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{ +begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number", +begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{ +className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{ +name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{ +begin:e.UNDERSCORE_IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\{/,contains:[{ +className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{ +begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|\\{",returnBegin:!0,contains:[{ +className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}], +illegal:"[^\\s\\}]"}}})()); +hljs.registerLanguage("objectivec",(()=>{"use strict";return e=>{ +const n=/[a-zA-Z@][a-zA-Z0-9_]*/,_={$pattern:n, +keyword:"@interface @class @protocol @implementation"};return{ +name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], +keywords:{$pattern:n, +keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN", +literal:"false true FALSE TRUE nil YES NO NULL", +built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once" +},illegal:"/,end:/$/, +illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +className:"class",begin:"("+_.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/, +excludeEnd:!0,keywords:_,contains:[e.UNDERSCORE_TITLE_MODE]},{ +begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}})()); +hljs.registerLanguage("perl",(()=>{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function n(...n){ +return n.map((n=>e(n))).join("")}function t(...n){ +return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ +const r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/, +keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" +},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/, +end:/\}/},o={variants:[{begin:/\$\d/},{ +begin:n(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") +},{begin:/[$%@][^\s\w{]/,relevance:0}] +},c=[e.BACKSLASH_ESCAPE,i,o],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],l=(e,t,s="\\1")=>{ +const i="\\1"===s?s:n(s,t) +;return n(n("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,s,r) +},d=(e,t,s)=>n(n("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,s,r),p=[o,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ +endsWithParent:!0}),a,{className:"string",contains:c,variants:[{ +begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", +end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ +begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", +relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", +contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ +begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", +begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", +relevance:0},{ +begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", +keywords:"split return print reverse grep",relevance:0, +contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ +begin:l("s|tr|y",t(...g))},{begin:l("s|tr|y","\\(","\\)")},{ +begin:l("s|tr|y","\\[","\\]")},{begin:l("s|tr|y","\\{","\\}")}],relevance:2},{ +className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ +begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t(...g),/\1/)},{ +begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ +begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", +end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ +begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", +subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] +}];return i.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:s, +contains:p}}})()); +hljs.registerLanguage("php",(()=>{"use strict";return e=>{const r={ +className:"variable", +begin:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?![A-Za-z0-9])(?![$])"},t={ +className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{ +begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/, +end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null +}),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null, +contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({ +begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, +contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string", +contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'" +}),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},s={className:"number",variants:[{ +begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{ +begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{ +begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?" +}],relevance:0},c={ +keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield", +literal:"false null true", +built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass" +};return{aliases:["php3","php4","php5","php6","php7","php8"], +case_insensitive:!0,keywords:c, +contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t] +}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}] +}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0, +keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{ +begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function", +relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0, +illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{ +begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0,keywords:c, +contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s]}]},{className:"class",variants:[{ +beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", +illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ +beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, +contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";", +contains:[e.UNDERSCORE_TITLE_MODE]},l,s]}}})()); +hljs.registerLanguage("php-template",(()=>{"use strict";return n=>({ +name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/, +subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"', +end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{ +illegal:null,className:null,contains:null,skip:!0 +}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null, +skip:!0})]}]})})()); +hljs.registerLanguage("plaintext",(()=>{"use strict";return t=>({ +name:"Plain text",aliases:["text","txt"],disableAutodetect:!0})})()); +hljs.registerLanguage("properties",(()=>{"use strict";return e=>{ +var n="[ \\t\\f]*",a=n+"[:=]"+n,t="("+a+"|[ \\t\\f]+)",r="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",s="([^\\\\:= \\t\\f\\n]|\\\\.)+",i={ +end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{ +begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties", +case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{ +returnBegin:!0,variants:[{begin:r+a,relevance:1},{begin:r+"[ \\t\\f]+", +relevance:0}],contains:[{className:"attr",begin:r,endsParent:!0,relevance:0}], +starts:i},{begin:s+t,returnBegin:!0,relevance:0,contains:[{className:"meta", +begin:s,endsParent:!0,relevance:0}],starts:i},{className:"attr",relevance:0, +begin:s+n+"$"}]}}})()); +hljs.registerLanguage("python",(()=>{"use strict";return e=>{const n={ +$pattern:/[A-Za-z]\w+|__\w+__/, +keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"], +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/, +end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},t={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},r="[0-9](_?[0-9])*",l=`(\\b(${r}))?\\.(${r})|\\b(${r})\\.`,b={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${r})|(${l}))[eE][+-]?(${r})[jJ]?\\b`},{begin:`(${l})[jJ]?`},{ +begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{ +begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{ +begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${r})[jJ]\\b`}]},o={ +className:"comment", +begin:(d=/# type:/,((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(?=",d,")")), +end:/$/,keywords:n,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/, +endsWithParent:!0}]},c={className:"params",variants:[{className:"", +begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0, +keywords:n,contains:["self",a,b,t,e.HASH_COMMENT_MODE]}]};var d +;return i.contains=[t,b,a],{name:"Python",aliases:["py","gyp","ipython"], +keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,b,{begin:/\bself\b/},{ +beginKeywords:"if",relevance:0},t,o,e.HASH_COMMENT_MODE,{variants:[{ +className:"function",beginKeywords:"def"},{className:"class", +beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/, +contains:[e.UNDERSCORE_TITLE_MODE,c,{begin:/->/,endsWithParent:!0,keywords:n}] +},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,c,t]}]}}})()); +hljs.registerLanguage("python-repl",(()=>{"use strict";return s=>({ +aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$", +subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{ +begin:/^\.\.\.(?=[ ]|$)/}]}]})})()); +hljs.registerLanguage("r",(()=>{"use strict";function e(...e){return e.map((e=>{ +return(a=e)?"string"==typeof a?a:a.source:null;var a})).join("")}return a=>{ +const n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/;return{name:"R", +illegal:/->/,keywords:{$pattern:n, +keyword:"function if in break next repeat else for while", +literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", +built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" +},compilerExtensions:[(a,n)=>{if(!a.beforeMatch)return +;if(a.starts)throw Error("beforeMatch cannot be used with starts") +;const i=Object.assign({},a);Object.keys(a).forEach((e=>{delete a[e] +})),a.begin=e(i.beforeMatch,e("(?=",i.begin,")")),a.starts={relevance:0, +contains:[Object.assign(i,{endsParent:!0})]},a.relevance=0,delete i.beforeMatch +}],contains:[a.COMMENT(/#'/,/$/,{contains:[{className:"doctag", +begin:"@examples",starts:{contains:[{begin:/\n/},{begin:/#'\s*(?=@[a-zA-Z]+)/, +endsParent:!0},{begin:/#'/,end:/$/,excludeBegin:!0}]}},{className:"doctag", +begin:"@param",end:/$/,contains:[{className:"variable",variants:[{begin:n},{ +begin:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{className:"doctag", +begin:/@[a-zA-Z]+/},{className:"meta-keyword",begin:/\\[a-zA-Z]+/}] +}),a.HASH_COMMENT_MODE,{className:"string",contains:[a.BACKSLASH_ESCAPE], +variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ +}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ +}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ +}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ +}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ +}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', +relevance:0},{begin:"'",end:"'",relevance:0}]},{className:"number",relevance:0, +beforeMatch:/([^a-zA-Z0-9._])/,variants:[{ +match:/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/},{ +match:/0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/},{ +match:/(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/}]},{begin:"%",end:"%"},{ +begin:e(/[a-zA-Z][a-zA-Z_0-9]*/,"\\s+<-\\s+")},{begin:"`",end:"`",contains:[{ +begin:/\\./}]}]}}})()); +hljs.registerLanguage("ruby",(()=>{"use strict";function e(...e){ +return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n +})).join("")}return n=>{ +const a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i={ +keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__", +built_in:"proc lambda",literal:"true false nil"},s={className:"doctag", +begin:"@[A-Za-z]+"},r={begin:"#<",end:">"},b=[n.COMMENT("#","$",{contains:[s] +}),n.COMMENT("^=begin","^=end",{contains:[s],relevance:10 +}),n.COMMENT("^__END__","\\n$")],c={className:"subst",begin:/#\{/,end:/\}/, +keywords:i},t={className:"string",contains:[n.BACKSLASH_ESCAPE,c],variants:[{ +begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/, +end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{ +begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/, +end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{ +begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{ +begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ +begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ +begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ +begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{ +begin:/<<[-~]?'?/},n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, +contains:[n.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",d={className:"number", +relevance:0,variants:[{ +begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ +begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" +},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ +begin:"\\b0(_?[0-7])+r?i?\\b"}]},l={className:"params",begin:"\\(",end:"\\)", +endsParent:!0,keywords:i},o=[t,{className:"class",beginKeywords:"class module", +end:"$|;",illegal:/=/,contains:[n.inherit(n.TITLE_MODE,{ +begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{ +begin:"("+n.IDENT_RE+"::)?"+n.IDENT_RE,relevance:0}]}].concat(b)},{ +className:"function",begin:e(/def\s+/,(_=a+"\\s*(\\(|;|$)",e("(?=",_,")"))), +relevance:0,keywords:"def",end:"$|;",contains:[n.inherit(n.TITLE_MODE,{begin:a +}),l].concat(b)},{begin:n.IDENT_RE+"::"},{className:"symbol", +begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", +begin:":(?!\\s)",contains:[t,{begin:a}],relevance:0},d,{className:"variable", +begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ +className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:i},{ +begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{ +className:"regexp",contains:[n.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{ +begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(", +end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}] +}].concat(r,b),relevance:0}].concat(r,b);var _;c.contains=o,l.contains=o +;const E=[{begin:/^\s*=>/,starts:{end:"$",contains:o}},{className:"meta", +begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", +starts:{end:"$",contains:o}}];return b.unshift(r),{name:"Ruby", +aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/, +contains:[n.SHEBANG({binary:"ruby"})].concat(E).concat(b).concat(o)}}})()); +hljs.registerLanguage("rust",(()=>{"use strict";return e=>{ +const n="([ui](8|16|32|64|128|size)|f(32|64))?",t="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!" +;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?", +keyword:"abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield", +literal:"true false Some None Ok Err",built_in:t},illegal:""}]}}})()); +hljs.registerLanguage("scss",(()=>{"use strict" +;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse() +;return a=>{const n=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, +HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, +ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, +illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} +}))(a),l=o,s=i,d="@[a-z-]+",c={className:"variable", +begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"};return{name:"SCSS",case_insensitive:!0, +illegal:"[=/|']",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{ +className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ +className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 +},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", +begin:"\\b("+e.join("|")+")\\b",relevance:0},{className:"selector-pseudo", +begin:":("+s.join("|")+")"},{className:"selector-pseudo", +begin:"::("+l.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[a.CSS_NUMBER_MODE] +},{className:"attribute",begin:"\\b("+r.join("|")+")\\b"},{ +begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" +},{begin:":",end:";", +contains:[c,n.HEXCOLOR,a.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,n.IMPORTANT] +},{begin:"@(page|font-face)",lexemes:d,keywords:"@page @font-face"},{begin:"@", +end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, +keyword:"and or not only",attribute:t.join(" ")},contains:[{begin:d, +className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" +},c,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,n.HEXCOLOR,a.CSS_NUMBER_MODE]}]}} +})()); +hljs.registerLanguage("shell",(()=>{"use strict";return s=>({ +name:"Shell Session",aliases:["console"],contains:[{className:"meta", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#]/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]})})()); +hljs.registerLanguage("sql",(()=>{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function r(...r){ +return r.map((r=>e(r))).join("")}function t(...r){ +return"("+r.map((r=>e(r))).join("|")+")"}return e=>{ +const n=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],o=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],c=s,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!s.includes(e))),u={ +begin:r(/\b/,t(...c),/\s*\(/),keywords:{built_in:c}};return{name:"SQL", +case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/, +keyword:((e,{exceptions:r,when:t}={})=>{const n=t +;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) +})(l,{when:e=>e.length<3}),literal:a,type:i, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:t(...o),keywords:{$pattern:/[\w\.]+/,keyword:l.concat(o), +literal:a,type:i}},{className:"type", +begin:t("double precision","large object","with timezone","without timezone") +},u,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ +begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ +begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator", +begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})()); +hljs.registerLanguage("swift",(()=>{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function n(e){return a("(?=",e,")")} +function a(...n){return n.map((n=>e(n))).join("")}function t(...n){ +return"("+n.map((n=>e(n))).join("|")+")"} +const i=e=>a(/\b/,e,/\w$/.test(e)?/\b/:/\B/),s=["Protocol","Type"].map(i),u=["init","self"].map(i),c=["Any","Self"],r=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],o=["false","nil","true"],l=["assignment","associativity","higherThan","left","lowerThan","none","right"],m=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],d=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],p=t(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),F=t(p,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=a(p,F,"*"),h=t(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),f=t(h,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),w=a(h,f,"*"),y=a(/[A-Z]/,f,"*"),g=["autoclosure",a(/convention\(/,t("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",a(/objc\(/,w,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],E=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] +;return e=>{const p={match:/\s+/,relevance:0},h=e.COMMENT("/\\*","\\*/",{ +contains:["self"]}),v=[e.C_LINE_COMMENT_MODE,h],N={className:"keyword", +begin:a(/\./,n(t(...s,...u))),end:t(...s,...u),excludeBegin:!0},A={ +match:a(/\./,t(...r)),relevance:0 +},C=r.filter((e=>"string"==typeof e)).concat(["_|0"]),_={variants:[{ +className:"keyword", +match:t(...r.filter((e=>"string"!=typeof e)).concat(c).map(i),...u)}]},D={ +$pattern:t(/\b\w+/,/#\w+/),keyword:C.concat(m),literal:o},B=[N,A,_],k=[{ +match:a(/\./,t(...d)),relevance:0},{className:"built_in", +match:a(/\b/,t(...d),/(?=\()/)}],M={match:/->/,relevance:0},S=[M,{ +className:"operator",relevance:0,variants:[{match:b},{match:`\\.(\\.|${F})+`}] +}],x="([0-9a-fA-F]_*)+",I={className:"number",relevance:0,variants:[{ +match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{ +match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(([0-9]_*)+))?\\b`},{ +match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(e="")=>({ +className:"subst",variants:[{match:a(/\\/,e,/[0\\tnr"']/)},{ +match:a(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),T=(e="")=>({className:"subst", +match:a(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(e="")=>({className:"subst", +label:"interpol",begin:a(/\\/,e,/\(/),end:/\)/}),P=(e="")=>({begin:a(e,/"""/), +end:a(/"""/,e),contains:[O(e),T(e),L(e)]}),$=(e="")=>({begin:a(e,/"/), +end:a(/"/,e),contains:[O(e),L(e)]}),K={className:"string", +variants:[P(),P("#"),P("##"),P("###"),$(),$("#"),$("##"),$("###")]},j={ +match:a(/`/,w,/`/)},z=[j,{className:"variable",match:/\$\d+/},{ +className:"variable",match:`\\$${f}+`}],q=[{match:/(@|#)available/, +className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:E, +contains:[...S,I,K]}]}},{className:"keyword",match:a(/@/,t(...g))},{ +className:"meta",match:a(/@/,w)}],U={match:n(/\b[A-Z]/),relevance:0,contains:[{ +className:"type", +match:a(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,f,"+") +},{className:"type",match:y,relevance:0},{match:/[?!]+/,relevance:0},{ +match:/\.\.\./,relevance:0},{match:a(/\s+&\s+/,n(y)),relevance:0}]},Z={ +begin://,keywords:D,contains:[...v,...B,...q,M,U]};U.contains.push(Z) +;const G={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:["self",{ +match:a(w,/\s*:/),keywords:"_|0",relevance:0 +},...v,...B,...k,...S,I,K,...z,...q,U]},H={beginKeywords:"func",contains:[{ +className:"title",match:t(j.match,w,b),endsParent:!0,relevance:0},p]},R={ +begin://,contains:[...v,U]},V={begin:/\(/,end:/\)/,keywords:D, +contains:[{begin:t(n(a(w,/\s*:/)),n(a(w,/\s+/,w,/\s*:/))),end:/:/,relevance:0, +contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:w}] +},...v,...B,...S,I,K,...q,U,G],endsParent:!0,illegal:/["']/},W={ +className:"function",match:n(/\bfunc\b/),contains:[H,R,V,p],illegal:[/\[/,/%/] +},X={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{ +keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[R,V,p], +illegal:/\[|%/},J={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{ +className:"title",match:b,endsParent:!0,relevance:0}]},Q={ +beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{ +className:"title",match:y,relevance:0},{begin:/{/,end:/}/,relevance:0, +endsParent:!0,keywords:[...l,...o],contains:[U]}]};for(const e of K.variants){ +const n=e.contains.find((e=>"interpol"===e.label));n.keywords=D +;const a=[...B,...k,...S,I,K,...z];n.contains=[...a,{begin:/\(/,end:/\)/, +contains:["self",...a]}]}return{name:"Swift",keywords:D,contains:[...v,W,X,{ +className:"class",beginKeywords:"struct protocol class extension enum", +end:"\\{",excludeEnd:!0,keywords:D,contains:[e.inherit(e.TITLE_MODE,{ +begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...B]},J,Q,{ +beginKeywords:"import",end:/$/,contains:[...v],relevance:0 +},...B,...k,...S,I,K,...z,...q,U,G]}}})()); +hljs.registerLanguage("typescript",(()=>{"use strict" +;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],s=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) +;function t(e){return r("(?=",e,")")}function r(...e){return e.map((e=>{ +return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return i=>{ +const c={$pattern:e, +keyword:n.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]), +literal:a, +built_in:s.concat(["any","void","number","boolean","string","object","never","enum"]) +},o={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},l=(e,n,a)=>{ +const s=e.contains.findIndex((e=>e.label===n)) +;if(-1===s)throw Error("can not find mode to replace");e.contains.splice(s,1,a) +},b=(i=>{const c=e,o={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const a=e[0].length+e.index,s=e.input[a];"<"!==s?">"===s&&(((e,{after:n})=>{ +const a="", +returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{ +begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0 +},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:f}]}] +},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{ +variants:[{begin:"<>",end:""},{begin:o.begin,"on:begin":o.isTrulyOpeningTag, +end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0, +contains:["self"]}]}],relevance:0},{className:"function", +beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:l, +contains:["self",i.inherit(i.TITLE_MODE,{begin:c}),A],illegal:/%/},{ +beginKeywords:"while if switch catch for"},{className:"function", +begin:i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,contains:[A,i.inherit(i.TITLE_MODE,{begin:c})]},{variants:[{ +begin:"\\."+c},{begin:"\\$"+c}],relevance:0},{className:"class", +beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{ +beginKeywords:"extends"},i.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/, +end:/[{;]/,excludeEnd:!0,contains:[i.inherit(i.TITLE_MODE,{begin:c}),"self",A] +},{begin:"(get|set)\\s+(?="+c+"\\()",end:/\{/,keywords:"get set", +contains:[i.inherit(i.TITLE_MODE,{begin:c}),{begin:/\(\)/},A]},{begin:/\$[(.]/}] +}})(i) +;return Object.assign(b.keywords,c),b.exports.PARAMS_CONTAINS.push(o),b.contains=b.contains.concat([o,{ +beginKeywords:"namespace",end:/\{/,excludeEnd:!0},{beginKeywords:"interface", +end:/\{/,excludeEnd:!0,keywords:"interface extends" +}]),l(b,"shebang",i.SHEBANG()),l(b,"use_strict",{className:"meta",relevance:10, +begin:/^\s*['"]use strict['"]/ +}),b.contains.find((e=>"function"===e.className)).relevance=0,Object.assign(b,{ +name:"TypeScript",aliases:["ts","tsx"]}),b}})()); +hljs.registerLanguage("vbnet",(()=>{"use strict";function e(e){ +return e?"string"==typeof e?e:e.source:null}function n(...n){ +return n.map((n=>e(n))).join("")}function t(...n){ +return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ +const a=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,o={ +className:"literal",variants:[{begin:n(/# */,t(i,a),/ *#/)},{ +begin:n(/# */,r,/ *#/)},{begin:n(/# */,s,/ *#/)},{ +begin:n(/# */,t(i,a),/ +/,t(s,r),/ *#/)}]},l=e.COMMENT(/'''/,/$/,{contains:[{ +className:"doctag",begin:/<\/?/,end:/>/}]}),c=e.COMMENT(null,/$/,{variants:[{ +begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET", +aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{ +keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", +built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", +type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", +literal:"true false nothing"}, +illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ +className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, +end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0, +variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ +},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ +begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ +className:"label",begin:/^\w+:/},l,c,{className:"meta", +begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, +end:/$/,keywords:{ +"meta-keyword":"const disable else elseif enable end externalsource if region then" +},contains:[c]}]}}})()); +hljs.registerLanguage("yaml",(()=>{"use strict";return e=>{ +var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={ +className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", +variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(s,{ +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={ +end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},t={begin:/\{/, +end:/\}/,contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]", +contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{ +begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ +begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", +relevance:10},{className:"string", +begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ +begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, +relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type", +begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a +},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", +begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", +relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ +className:"number", +begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" +},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},t,g,s],r=[...b] +;return r.pop(),r.push(i),l.contains=r,{name:"YAML",case_insensitive:!0, +aliases:["yml"],contains:b}}})()); \ No newline at end of file diff --git a/htmlReport/js/highlightjs-line-numbers.min.js b/htmlReport/js/highlightjs-line-numbers.min.js new file mode 100644 index 0000000..8548576 --- /dev/null +++ b/htmlReport/js/highlightjs-line-numbers.min.js @@ -0,0 +1,24 @@ +/* +The MIT License (MIT) + +Copyright (c) 2017 Yauheni Pakala + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ +!function(r,o){"use strict";var e,i="hljs-ln",l="hljs-ln-line",h="hljs-ln-code",s="hljs-ln-numbers",c="hljs-ln-n",m="data-line-number",a=/\r\n|\r|\n/g;function u(e){for(var n=e.toString(),t=e.anchorNode;"TD"!==t.nodeName;)t=t.parentNode;for(var r=e.focusNode;"TD"!==r.nodeName;)r=r.parentNode;var o=parseInt(t.dataset.lineNumber),a=parseInt(r.dataset.lineNumber);if(o==a)return n;var i,l=t.textContent,s=r.textContent;for(a
{6}',[l,s,c,m,h,o+n.startFrom,0{1}',[i,r])}return e}(e.innerHTML,o)}function v(e){var n=e.className;if(/hljs-/.test(n)){for(var t=g(e.innerHTML),r=0,o="";r{1}
\n',[n,0 + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_BLOCK.html b/htmlReport/ns-1/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..21e8b9b --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_BLOCK.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..7adfb64 --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_CLASS.html b/htmlReport/ns-1/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..c63d3e5 --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_CLASS.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..aeae973 --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_LINE.html b/htmlReport/ns-1/index_SORT_BY_LINE.html new file mode 100644 index 0000000..4072968 --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_LINE.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..76547f4 --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_METHOD.html b/htmlReport/ns-1/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..28a702f --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_METHOD.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..3442f2a --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..700bf7c --- /dev/null +++ b/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SempreAlertaApplication + + 100% + + + (1/1) + + + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-1/sources/source-1.html b/htmlReport/ns-1/sources/source-1.html new file mode 100644 index 0000000..89235aa --- /dev/null +++ b/htmlReport/ns-1/sources/source-1.html @@ -0,0 +1,127 @@ + + + + + + + + Coverage Report > SempreAlertaApplication + + + + + + +
+ + +

Coverage Summary for Class: SempreAlertaApplication (com.institutosemprealerta.semprealerta)

+ + + + + + + + + + + + + + + + + + + + + +
Class + Method, % + + Line, % +
SempreAlertaApplication + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
SempreAlertaApplication$$SpringCGLIB$$0
Total + + 50% + + + (1/2) + + + + 50% + + + (1/2) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta;
+ 
+ import org.springframework.boot.SpringApplication;
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ 
+ @SpringBootApplication
+ public class SempreAlertaApplication {
+ 
+     public static void main(String[] args) {
+         SpringApplication.run(SempreAlertaApplication.class, args);
+     }
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-10/index.html b/htmlReport/ns-10/index.html new file mode 100644 index 0000000..8198818 --- /dev/null +++ b/htmlReport/ns-10/index.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_BLOCK.html b/htmlReport/ns-10/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..c453132 --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_BLOCK.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..99aa58e --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_CLASS.html b/htmlReport/ns-10/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..e263dad --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_CLASS.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..4750905 --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_LINE.html b/htmlReport/ns-10/index_SORT_BY_LINE.html new file mode 100644 index 0000000..a9ae8b1 --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_LINE.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..3cb80ad --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_METHOD.html b/htmlReport/ns-10/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..b688e87 --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_METHOD.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..2200318 --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..1e6b8ba --- /dev/null +++ b/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-10/sources/source-1.html b/htmlReport/ns-10/sources/source-1.html new file mode 100644 index 0000000..16a9951 --- /dev/null +++ b/htmlReport/ns-10/sources/source-1.html @@ -0,0 +1,93 @@ + + + + + + + + Coverage Report > JpaUserRepository + + + + + + +
+ + +

Coverage Summary for Class: JpaUserRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

+ + + + + + + + + + + + + + + + + + +
Class
JpaUserRepository$MockitoMock$LZE1B28P
JpaUserRepository$MockitoMock$LZE1B28P$auxiliary$ci3DkrR6
JpaUserRepository$MockitoMock$LZE1B28P$auxiliary$MS6yQbDf
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.repositories;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import org.springframework.data.jpa.repository.JpaRepository;
+ import org.springframework.data.jpa.repository.Query;
+ import org.springframework.stereotype.Repository;
+ 
+ import java.util.Optional;
+ 
+ @Repository
+ public interface JpaUserRepository extends JpaRepository<User, Integer> {
+     @Query("SELECT u FROM User u WHERE u.contact.email = ?1")
+     Optional<User> findByEmail(String email);
+ 
+     Optional<User> findByRegistration(String registration);
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-10/sources/source-2.html b/htmlReport/ns-10/sources/source-2.html new file mode 100644 index 0000000..4706d09 --- /dev/null +++ b/htmlReport/ns-10/sources/source-2.html @@ -0,0 +1,89 @@ + + + + + + + + Coverage Report > JpaPostRepository + + + + + + +
+ + +

Coverage Summary for Class: JpaPostRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

+ + + + + + + + + + + + + + + + + + +
Class
JpaPostRepository$MockitoMock$97KgGPUb
JpaPostRepository$MockitoMock$97KgGPUb$auxiliary$85LpAoIc
JpaPostRepository$MockitoMock$97KgGPUb$auxiliary$Vm7GFIkF
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.repositories;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
+ import org.springframework.data.jpa.repository.JpaRepository;
+ import org.springframework.stereotype.Repository;
+ 
+ import java.util.Optional;
+ 
+ @Repository
+ public interface JpaPostRepository extends JpaRepository<PostEntity, Long>{
+     Optional<PostEntity> findBySlug(String slug);
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-10/sources/source-3.html b/htmlReport/ns-10/sources/source-3.html new file mode 100644 index 0000000..d8573f9 --- /dev/null +++ b/htmlReport/ns-10/sources/source-3.html @@ -0,0 +1,86 @@ + + + + + + + + Coverage Report > JpaFileRepository + + + + + + +
+ + +

Coverage Summary for Class: JpaFileRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

+ + + + + + + + + + + + + + + + + + +
Class
JpaFileRepository$MockitoMock$aN8pxh2a
JpaFileRepository$MockitoMock$aN8pxh2a$auxiliary$b55TKeQJ
JpaFileRepository$MockitoMock$aN8pxh2a$auxiliary$KGoKCtcZ
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.repositories;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity;
+ import org.springframework.data.jpa.repository.JpaRepository;
+ import org.springframework.stereotype.Repository;
+ 
+ @Repository
+ public interface JpaFileRepository extends JpaRepository<FileEntity, Long> {
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-2/index.html b/htmlReport/ns-2/index.html new file mode 100644 index 0000000..6ff3cfe --- /dev/null +++ b/htmlReport/ns-2/index.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_BLOCK.html b/htmlReport/ns-2/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..6c86ecf --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_BLOCK.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..83ce012 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_CLASS.html b/htmlReport/ns-2/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..6891eb3 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_CLASS.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..70aba21 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_LINE.html b/htmlReport/ns-2/index_SORT_BY_LINE.html new file mode 100644 index 0000000..37e4949 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_LINE.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..d9b09d0 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_METHOD.html b/htmlReport/ns-2/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..bfe4f88 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_METHOD.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..d6f6d90 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..9829650 --- /dev/null +++ b/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.application.service.impl + + 100% + + + (3/3) + + + + 95.7% + + + (22/23) + + + + 83.1% + + + (54/65) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-2/sources/source-1.html b/htmlReport/ns-2/sources/source-1.html new file mode 100644 index 0000000..e4f5381 --- /dev/null +++ b/htmlReport/ns-2/sources/source-1.html @@ -0,0 +1,166 @@ + + + + + + + + Coverage Report > PostServiceImpl + + + + + + +
+ + +

Coverage Summary for Class: PostServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
PostServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (8/8) + + + + 100% + + + (14/14) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service.impl;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.PostService;
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository;
+ import org.springframework.data.domain.Page;
+ import org.springframework.stereotype.Service;
+ import org.springframework.data.domain.Pageable;
+ 
+ import java.util.List;
+ 
+ @Service
+ public class PostServiceImpl implements PostService {
+     private final PostRepository postRepository;
+     private final SlugGenerator slugGenerator;
+ 
+     public PostServiceImpl(PostRepository postRepository, SlugGenerator slugGenerator) {
+         this.postRepository = postRepository;
+         this.slugGenerator = slugGenerator;
+     }
+ 
+     @Override
+     public String save(Post post) {
+         String slug = this.generateSlug(post.getTitle());
+         post.setSlug(slug);
+ 
+         return postRepository.save(post);
+     }
+ 
+     @Override
+     public void delete(Long id) {
+         postRepository.delete(id);
+     }
+ 
+     @Override
+     public void update(Long id, Post post) {
+         String slug = this.generateSlug(post.getTitle());
+         post.setSlug(slug);
+         postRepository.update(id, post);
+     }
+ 
+     @Override
+     public Page<Post> listAll(Pageable pageable) {
+         return postRepository.listAll(pageable);
+     }
+ 
+ 
+     @Override
+     public Post findBySlug(String slug) {
+         return postRepository.findBySlug(slug);
+     }
+ 
+     @Override
+     public Post findById(Long id) {
+         return postRepository.findById(id);
+     }
+ 
+     private String generateSlug(String title) {
+         return  slugGenerator.generate(title);
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-2/sources/source-2.html b/htmlReport/ns-2/sources/source-2.html new file mode 100644 index 0000000..73dac7a --- /dev/null +++ b/htmlReport/ns-2/sources/source-2.html @@ -0,0 +1,216 @@ + + + + + + + + Coverage Report > StorageServiceImpl + + + + + + +
+ + +

Coverage Summary for Class: StorageServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
StorageServiceImpl + + 100% + + + (1/1) + + + + 87.5% + + + (7/8) + + + + 72.5% + + + (29/40) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service.impl;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.StorageService;
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties;
+ import lombok.extern.log4j.Log4j2;
+ import org.springframework.core.io.Resource;
+ import org.springframework.core.io.UrlResource;
+ import org.springframework.stereotype.Service;
+ import org.springframework.util.FileSystemUtils;
+ import org.springframework.util.StringUtils;
+ import org.springframework.web.multipart.MultipartFile;
+ 
+ import java.io.IOException;
+ import java.net.MalformedURLException;
+ import java.net.URI;
+ import java.nio.file.Files;
+ import java.nio.file.Path;
+ import java.nio.file.Paths;
+ import java.util.List;
+ 
+ @Service
+ public class StorageServiceImpl implements StorageService {
+     private final Path fileStorageLocation;
+     private final FileRepository fileRepository;
+ 
+     public StorageServiceImpl(FileStorageProperties fileStorageProperties, FileRepository fileRepository) {
+         this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
+                 .toAbsolutePath().normalize();
+         this.fileRepository = fileRepository;
+     }
+ 
+     @Override
+     public void init() {
+         try {
+             Files.createDirectories(fileStorageLocation);
+         } catch (IOException e) {
+             throw new RuntimeException("Could not create the directory where the uploaded files will be stored.", e);
+         }
+     }
+ 
+     @Override
+     public String store(MultipartFile file, String fileType) {
+         if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) {
+             throw new RuntimeException("File name is empty");
+         }
+         String fileName = StringUtils.cleanPath(file.getOriginalFilename());
+ 
+         try {
+             Path targetLocation = fileStorageLocation.resolve(fileName);
+             init();
+ 
+             file.transferTo(targetLocation.toFile());
+ 
+             String fileDownloadUri = "/api/v1/files/download/" + fileName;
+ 
+             File fileData = File.builder()
+                     .fileName(fileName)
+                     .fileType(fileType)
+                     .fileDownloadUri(fileDownloadUri)
+                     .build();
+ 
+             this.fileRepository.save(fileData);
+         } catch (IOException e) {
+             throw new RuntimeException("Could not store file " + fileName + ". Please try again!", e);
+         }
+         return fileName;
+     }
+ 
+     @Override
+     public List<FileResponse> loadAll() {
+ 
+         return this.fileRepository.listAll();
+     }
+ 
+     @Override
+     public Path load(String filename) {
+         Path file = fileStorageLocation.resolve(filename).normalize();
+         if (!Files.exists(file)) {
+             throw new RuntimeException("File not found " + filename);
+         }
+         return file;
+     }
+ 
+     @Override
+     public Resource loadAsResource(String filename) {
+         URI fileUri = load(filename).toUri();
+         try {
+             return new UrlResource(fileUri);
+         } catch (MalformedURLException e) {
+             throw new RuntimeException(e);
+         }
+     }
+ 
+     @Override
+     public void delete(String filename) {
+         Path file = load(filename);
+ 
+         try {
+             Files.deleteIfExists(file);
+         } catch (IOException e) {
+             throw new RuntimeException(e);
+         }
+     }
+ 
+     @Override
+     public void deleteAll() {
+         FileSystemUtils.deleteRecursively(fileStorageLocation.toFile());
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-2/sources/source-3.html b/htmlReport/ns-2/sources/source-3.html new file mode 100644 index 0000000..8e24b6a --- /dev/null +++ b/htmlReport/ns-2/sources/source-3.html @@ -0,0 +1,153 @@ + + + + + + + + Coverage Report > UserServiceImpl + + + + + + +
+ + +

Coverage Summary for Class: UserServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
UserServiceImpl + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (11/11) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service.impl;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.UserService;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository;
+ import org.springframework.stereotype.Service;
+ 
+ @Service
+ public class UserServiceImpl implements UserService {
+ 
+     private final UserRepository userRepository;
+ 
+     public UserServiceImpl(UserRepository userRepository) {
+         this.userRepository = userRepository;
+     }
+ 
+     @Override
+     public void save(User user) {
+         this.userRepository.save(user);
+     }
+ 
+     @Override
+     public void update(int id, User user) {
+         this.userRepository.update(id, user);
+     }
+ 
+     @Override
+     public void delete(int id) {
+         this.userRepository.delete(id);
+     }
+ 
+     @Override
+     public User findByRegistration(String registration) {
+         return this.userRepository.findByRegistration(registration)
+                 .orElseThrow(() -> new RuntimeException("User not found"));
+     }
+ 
+     @Override
+     public User findByEmail(String email) {
+         return this.userRepository.findByEmail(email)
+                 .orElseThrow(() -> new RuntimeException("User not found"));
+     }
+ 
+     @Override
+     public User findById(int id) {
+         return this.userRepository.findById(id)
+                 .orElseThrow(() -> new RuntimeException("User not found"));
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-3/index.html b/htmlReport/ns-3/index.html new file mode 100644 index 0000000..d646df7 --- /dev/null +++ b/htmlReport/ns-3/index.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_BLOCK.html b/htmlReport/ns-3/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..2e1502d --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_BLOCK.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..bd9d754 --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_CLASS.html b/htmlReport/ns-3/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..4f59fa5 --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_CLASS.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..2c812fa --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_LINE.html b/htmlReport/ns-3/index_SORT_BY_LINE.html new file mode 100644 index 0000000..538088c --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_LINE.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..09008ae --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_METHOD.html b/htmlReport/ns-3/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..f3eaa12 --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_METHOD.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..d34fa95 --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..1b08a3d --- /dev/null +++ b/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.model + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.model + + 100% + + + (4/4) + + + + 73.7% + + + (14/19) + + + + 81.5% + + + (22/27) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
File + + 100% + + + (2/2) + + + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-3/sources/source-1.html b/htmlReport/ns-3/sources/source-1.html new file mode 100644 index 0000000..73791d8 --- /dev/null +++ b/htmlReport/ns-3/sources/source-1.html @@ -0,0 +1,163 @@ + + + + + + + + Coverage Report > File + + + + + + +
+ + +

Coverage Summary for Class: File (com.institutosemprealerta.semprealerta.domain.model)

+ + + + + + + + + + + + + + + + + + + + + + + +
Class + Method, % + + Line, % +
File + + 57.1% + + + (4/7) + + + + 57.1% + + + (4/7) + +
File$FileBuilder + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
Total + + 62.5% + + + (5/8) + + + + 62.5% + + + (5/8) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.model;
+ 
+ import lombok.Builder;
+ @Builder
+ public class File {
+         private String fileName;
+         private String fileDownloadUri;
+         private String fileType;
+ 
+         public String getFileName() {
+                 return fileName;
+         }
+ 
+         public void setFileName(String fileName) {
+                 this.fileName = fileName;
+         }
+ 
+         public String getFileDownloadUri() {
+                 return fileDownloadUri;
+         }
+ 
+         public void setFileDownloadUri(String fileDownloadUri) {
+                 this.fileDownloadUri = fileDownloadUri;
+         }
+ 
+         public String getFileType() {
+                 return fileType;
+         }
+ 
+         public void setFileType(String fileType) {
+                 this.fileType = fileType;
+         }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-3/sources/source-2.html b/htmlReport/ns-3/sources/source-2.html new file mode 100644 index 0000000..dd7a396 --- /dev/null +++ b/htmlReport/ns-3/sources/source-2.html @@ -0,0 +1,135 @@ + + + + + + + + Coverage Report > Post + + + + + + +
+ + +

Coverage Summary for Class: Post (com.institutosemprealerta.semprealerta.domain.model)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
Post + + 100% + + + (1/1) + + + + 77.8% + + + (7/9) + + + + 86.7% + + + (13/15) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.model;
+ 
+ import lombok.Getter;
+ import lombok.Setter;
+ 
+ import java.time.LocalDateTime;
+ 
+ @Getter
+ @Setter
+ public class Post {
+ 
+     private Long id;
+     private String title;
+     private String slug;
+ 
+     private String content;
+     private String banner;
+     private LocalDateTime createdAt;
+ 
+     public Post(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) {
+         this.id = id;
+         this.title = title;
+         this.slug = slug;
+         this.content = content;
+         this.banner = banner;
+         this.createdAt = createdAt;
+     }
+ 
+     public Post() {
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-3/sources/source-3.html b/htmlReport/ns-3/sources/source-3.html new file mode 100644 index 0000000..0f71f19 --- /dev/null +++ b/htmlReport/ns-3/sources/source-3.html @@ -0,0 +1,162 @@ + + + + + + + + Coverage Report > UserDTO + + + + + + +
+ + +

Coverage Summary for Class: UserDTO (com.institutosemprealerta.semprealerta.domain.model)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
UserDTO + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (4/4) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.model;
+ 
+ 
+ import com.fasterxml.jackson.annotation.JsonFormat;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles;
+ import com.institutosemprealerta.semprealerta.utils.DateManipulation;
+ import jakarta.validation.constraints.*;
+ 
+ import java.time.LocalDate;
+ import java.time.format.DateTimeFormatter;
+ 
+ public record UserDTO(
+         @NotBlank
+         String name,
+         @Email
+         String email,
+         @NotBlank
+         String password,
+         @NotBlank
+         String phone,
+         String gender,
+         @PastOrPresent
+         LocalDate birthDate,
+         @NotNull
+         UserRoles roles,
+         String street,
+         String number,
+         String city,
+         String zipCode
+ 
+ ) {
+     public User toDomain() {
+         //LocalDate birth = DateManipulation.stringToLocalDate(birthDate);
+         Contact contact = new Contact(
+                 email,
+                 phone
+         );
+ 
+         Address address = new Address(
+                 street,
+                 number,
+                 city,
+                 zipCode
+         );
+         return new User(
+                 name,
+                 password,
+                 gender,
+                 birthDate,
+                 roles,
+                 contact,
+                 address
+         );
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-4/index.html b/htmlReport/ns-4/index.html new file mode 100644 index 0000000..0973b9c --- /dev/null +++ b/htmlReport/ns-4/index.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_BLOCK.html b/htmlReport/ns-4/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..9911c02 --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_BLOCK.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..2eabd6a --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_CLASS.html b/htmlReport/ns-4/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..a650627 --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_CLASS.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..0639744 --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_LINE.html b/htmlReport/ns-4/index_SORT_BY_LINE.html new file mode 100644 index 0000000..b2e3cd8 --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_LINE.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..289c8db --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_METHOD.html b/htmlReport/ns-4/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..59637a5 --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_METHOD.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..2932aff --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..a2110bb --- /dev/null +++ b/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.in.impl + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-4/sources/source-1.html b/htmlReport/ns-4/sources/source-1.html new file mode 100644 index 0000000..c12514f --- /dev/null +++ b/htmlReport/ns-4/sources/source-1.html @@ -0,0 +1,123 @@ + + + + + + + + Coverage Report > SlugifySlugGenerator + + + + + + +
+ + +

Coverage Summary for Class: SlugifySlugGenerator (com.institutosemprealerta.semprealerta.domain.ports.in.impl)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
SlugifySlugGenerator + + 0% + + + (0/1) + + + + 0% + + + (0/2) + + + + 0% + + + (0/3) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.in.impl;
+ 
+ import com.github.slugify.Slugify;
+ import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
+ import org.springframework.stereotype.Component;
+ 
+ @Component
+ public class SlugifySlugGenerator implements SlugGenerator {
+     private final Slugify slug;
+ 
+     public SlugifySlugGenerator() {
+         this.slug = Slugify.builder().build();
+     }
+ 
+     @Override
+     public String generate(String input) {
+         return slug.slugify(input);
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-5/index.html b/htmlReport/ns-5/index.html new file mode 100644 index 0000000..2248da2 --- /dev/null +++ b/htmlReport/ns-5/index.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_BLOCK.html b/htmlReport/ns-5/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..bc876d7 --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_BLOCK.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..09cb4fb --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_CLASS.html b/htmlReport/ns-5/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..86e057b --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_CLASS.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..6f51ba6 --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_LINE.html b/htmlReport/ns-5/index_SORT_BY_LINE.html new file mode 100644 index 0000000..ef65e0e --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_LINE.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..62a444c --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_METHOD.html b/htmlReport/ns-5/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..faffd3f --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_METHOD.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..e3731e6 --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..20b001e --- /dev/null +++ b/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.domain.ports.out.responses + + 66.7% + + + (2/3) + + + + 75% + + + (3/4) + + + + 90.9% + + + (10/11) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-5/sources/source-1.html b/htmlReport/ns-5/sources/source-1.html new file mode 100644 index 0000000..70d4ac8 --- /dev/null +++ b/htmlReport/ns-5/sources/source-1.html @@ -0,0 +1,116 @@ + + + + + + + + Coverage Report > FileResponse + + + + + + +
+ + +

Coverage Summary for Class: FileResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
FileResponse + + 100% + + + (1/1) + + + + 100% + + + (1/1) + + + + 100% + + + (1/1) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
+ 
+ import java.time.LocalDateTime;
+ 
+ public record FileResponse(
+         long id,
+         String fileName,
+         String fileDownloadUri,
+         String fileType,
+         LocalDateTime uploadDate
+ ) {
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-5/sources/source-2.html b/htmlReport/ns-5/sources/source-2.html new file mode 100644 index 0000000..51e4375 --- /dev/null +++ b/htmlReport/ns-5/sources/source-2.html @@ -0,0 +1,110 @@ + + + + + + + + Coverage Report > PostResponse + + + + + + +
+ + +

Coverage Summary for Class: PostResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
PostResponse + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
+ 
+ public record PostResponse(
+ 
+ ) {
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-5/sources/source-3.html b/htmlReport/ns-5/sources/source-3.html new file mode 100644 index 0000000..3147317 --- /dev/null +++ b/htmlReport/ns-5/sources/source-3.html @@ -0,0 +1,138 @@ + + + + + + + + Coverage Report > UserResponse + + + + + + +
+ + +

Coverage Summary for Class: UserResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
UserResponse + + 100% + + + (1/1) + + + + 100% + + + (2/2) + + + + 100% + + + (9/9) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles;
+ 
+ import java.time.LocalDate;
+ 
+ public record UserResponse(
+          String registration,
+          String name,
+ 
+          String gender,
+          LocalDate birthDate,
+ 
+          UserRoles roles,
+ 
+          Contact contact,
+          Address address
+ ) {
+ 
+     public static UserResponse toResponse(User user) {
+         return new UserResponse(
+                 user.getRegistration(),
+                 user.getName(),
+                 user.getGender(),
+                 user.getBirthDate(),
+                 user.getRoles(),
+                 user.getContact(),
+                 user.getAddress()
+         );
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-6/index.html b/htmlReport/ns-6/index.html new file mode 100644 index 0000000..f044f1a --- /dev/null +++ b/htmlReport/ns-6/index.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_BLOCK.html b/htmlReport/ns-6/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..239a566 --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_BLOCK.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..e42a8ab --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_CLASS.html b/htmlReport/ns-6/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..fc4e348 --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_CLASS.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..17e9cbb --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_LINE.html b/htmlReport/ns-6/index_SORT_BY_LINE.html new file mode 100644 index 0000000..def4dad --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_LINE.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..6e4399a --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_METHOD.html b/htmlReport/ns-6/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..2a2135f --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_METHOD.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..a0a72ad --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..8f1007b --- /dev/null +++ b/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.adpters + + 100% + + + (3/3) + + + + 100% + + + (18/18) + + + + 100% + + + (41/41) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-6/sources/source-1.html b/htmlReport/ns-6/sources/source-1.html new file mode 100644 index 0000000..f5adfba --- /dev/null +++ b/htmlReport/ns-6/sources/source-1.html @@ -0,0 +1,142 @@ + + + + + + + + Coverage Report > JpaFileRepositoryAdapter + + + + + + +
+ + +

Coverage Summary for Class: JpaFileRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
JpaFileRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (4/4) + + + + 100% + + + (8/8) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.adpters;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity;
+ import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaFileRepository;
+ import org.springframework.stereotype.Component;
+ 
+ import java.util.List;
+ 
+ @Component
+ public class JpaFileRepositoryAdapter implements FileRepository {
+ 
+     private final JpaFileRepository fileRepository;
+ 
+     public JpaFileRepositoryAdapter(JpaFileRepository fileRepository) {
+         this.fileRepository = fileRepository;
+     }
+ 
+     @Override
+     public void save(File file) {
+         FileEntity fileEntity = FileEntity.fromDomainToModel(file);
+         fileRepository.save(fileEntity);
+     }
+ 
+     @Override
+     public void delete(Long id) {
+         fileRepository.deleteById(id);
+     }
+ 
+     @Override
+     public List<FileResponse> listAll() {
+         return fileRepository.findAll().stream()
+                 .map(FileEntity::toResponse)
+                 .toList();
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-6/sources/source-2.html b/htmlReport/ns-6/sources/source-2.html new file mode 100644 index 0000000..51314a4 --- /dev/null +++ b/htmlReport/ns-6/sources/source-2.html @@ -0,0 +1,165 @@ + + + + + + + + Coverage Report > JpaPostRepositoryAdapter + + + + + + +
+ + +

Coverage Summary for Class: JpaPostRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
JpaPostRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (19/19) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.adpters;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
+ import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository;
+ import org.springframework.data.domain.Page;
+ import org.springframework.data.domain.Pageable;
+ import org.springframework.stereotype.Component;
+ 
+ import java.util.List;
+ 
+ @Component
+ public class JpaPostRepositoryAdapter implements PostRepository {
+     private final JpaPostRepository jpaPostRepository;
+ 
+     public JpaPostRepositoryAdapter(JpaPostRepository jpaPostRepository) {
+         this.jpaPostRepository = jpaPostRepository;
+     }
+ 
+     @Override
+     public String save(Post post) {
+         PostEntity postToSave = PostEntity.fromModel(post);
+         PostEntity postSaved = jpaPostRepository.save(postToSave);
+         return postSaved.getSlug();
+     }
+ 
+     @Override
+     public void delete(Long id) {
+         this.findById(id);
+         jpaPostRepository.deleteById(id);
+     }
+ 
+     @Override
+     public void update(Long id, Post post) {
+         this.findById(id);
+         PostEntity postToUpdate = PostEntity.fromModel(post);
+         postToUpdate.setId(id);
+         jpaPostRepository.save(postToUpdate);
+     }
+ 
+     @Override
+     public Page<Post> listAll(Pageable pageable) {
+         return jpaPostRepository.findAll(pageable)
+                 .map(postEntity -> PostEntity.toModel(postEntity));
+     }
+ 
+     @Override
+     public Post findBySlug(String slug) {
+         return jpaPostRepository.findBySlug(slug)
+                 .map(postEntity -> PostEntity.toModel(postEntity))
+                 .orElseThrow(() -> new RuntimeException("Post not found"));
+     }
+ 
+     @Override
+     public Post findById(Long id) {
+         return jpaPostRepository.findById(id)
+                 .map(postEntity -> PostEntity.toModel(postEntity))
+                 .orElseThrow(() -> new RuntimeException("Post not found"));
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-6/sources/source-3.html b/htmlReport/ns-6/sources/source-3.html new file mode 100644 index 0000000..8430b57 --- /dev/null +++ b/htmlReport/ns-6/sources/source-3.html @@ -0,0 +1,163 @@ + + + + + + + + Coverage Report > JpaUserRepositoryAdapter + + + + + + +
+ + +

Coverage Summary for Class: JpaUserRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
JpaUserRepositoryAdapter + + 100% + + + (1/1) + + + + 100% + + + (7/7) + + + + 100% + + + (14/14) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.adpters;
+ 
+ import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository;
+ import org.springframework.stereotype.Component;
+ 
+ import java.util.Optional;
+ 
+ @Component
+ public class JpaUserRepositoryAdapter implements UserRepository {
+ 
+     private final JpaUserRepository userRepository;
+ 
+     public JpaUserRepositoryAdapter(JpaUserRepository jpaUserRepository) {
+         this.userRepository = jpaUserRepository;
+     }
+ 
+     @Override
+     public void save(User user) {
+         this.userRepository.save(user);
+     }
+ 
+     @Override
+     public Optional<User> findById(int id) {
+         return this.userRepository.findById(id);
+     }
+ 
+     @Override
+     public void update(int id, User user) {
+         User userToUpdate = this.userRepository.findById(id)
+                 .orElseThrow(() -> new RuntimeException("User not found"));
+ 
+         user.setId(userToUpdate.getId());
+         user.setRegistration(userToUpdate.getRegistration());
+ 
+         this.userRepository.save(user);
+     }
+ 
+     @Override
+     public void delete(int id) {
+         User userToDelete = this.userRepository.findById(id)
+                 .orElseThrow(() -> new RuntimeException("User not found"));
+ 
+         this.userRepository.delete(userToDelete);
+     }
+ 
+     @Override
+     public Optional<User> findByRegistration(String registration) {
+         return this.userRepository.findByRegistration(registration);
+     }
+ 
+     @Override
+     public Optional<User> findByEmail(String email) {
+         return this.userRepository.findByEmail(email);
+     }
+ 
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-7/index.html b/htmlReport/ns-7/index.html new file mode 100644 index 0000000..1f07ebd --- /dev/null +++ b/htmlReport/ns-7/index.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_BLOCK.html b/htmlReport/ns-7/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..e957d44 --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_BLOCK.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..3544e22 --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_CLASS.html b/htmlReport/ns-7/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..d6e3a8b --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_CLASS.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..c83d6eb --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_LINE.html b/htmlReport/ns-7/index_SORT_BY_LINE.html new file mode 100644 index 0000000..c33a74e --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_LINE.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..847eb4f --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_METHOD.html b/htmlReport/ns-7/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..0188531 --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_METHOD.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..756e799 --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..4a81a69 --- /dev/null +++ b/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.config + + 0% + + + (0/2) + + + + 0% + + + (0/6) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-7/sources/source-1.html b/htmlReport/ns-7/sources/source-1.html new file mode 100644 index 0000000..714fa33 --- /dev/null +++ b/htmlReport/ns-7/sources/source-1.html @@ -0,0 +1,127 @@ + + + + + + + + Coverage Report > ApplicationConfig + + + + + + +
+ + +

Coverage Summary for Class: ApplicationConfig (com.institutosemprealerta.semprealerta.infrastructure.config)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
ApplicationConfig + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.config;
+ 
+ import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
+ import com.institutosemprealerta.semprealerta.domain.ports.in.impl.SlugifySlugGenerator;
+ import org.springframework.context.annotation.Bean;
+ import org.springframework.context.annotation.Configuration;
+ import org.springframework.data.domain.PageRequest;
+ import org.springframework.data.domain.Pageable;
+ import org.springframework.data.domain.Sort;
+ 
+ @Configuration
+ public class ApplicationConfig {
+ 
+     @Bean
+     public SlugGenerator slugGenerator() {
+         return new SlugifySlugGenerator();
+     }
+ 
+     @Bean
+     public Pageable defaultPageable() {
+         return PageRequest.of(0, 10, Sort.by("createdAt").descending());
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-7/sources/source-2.html b/htmlReport/ns-7/sources/source-2.html new file mode 100644 index 0000000..00e4800 --- /dev/null +++ b/htmlReport/ns-7/sources/source-2.html @@ -0,0 +1,122 @@ + + + + + + + + Coverage Report > FileStorageProperties + + + + + + +
+ + +

Coverage Summary for Class: FileStorageProperties (com.institutosemprealerta.semprealerta.infrastructure.config)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
FileStorageProperties + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/3) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.config;
+ 
+ import org.springframework.boot.context.properties.ConfigurationProperties;
+ import org.springframework.context.annotation.Configuration;
+ 
+ @Configuration
+ @ConfigurationProperties(prefix = "file")
+ public class FileStorageProperties {
+     private String uploadDir;
+ 
+     public String getUploadDir() {
+         return uploadDir;
+     }
+ 
+     public void setUploadDir(String uploadDir) {
+         this.uploadDir = uploadDir;
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-8/index.html b/htmlReport/ns-8/index.html new file mode 100644 index 0000000..121240f --- /dev/null +++ b/htmlReport/ns-8/index.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_BLOCK.html b/htmlReport/ns-8/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..5df34b7 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_BLOCK.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..d1266a5 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_CLASS.html b/htmlReport/ns-8/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..25826ed --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_CLASS.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..2bcb232 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_LINE.html b/htmlReport/ns-8/index_SORT_BY_LINE.html new file mode 100644 index 0000000..2dfa457 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_LINE.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..3d6ff3c --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_METHOD.html b/htmlReport/ns-8/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..7c28d61 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_METHOD.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..f02afc5 --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..1d626ad --- /dev/null +++ b/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,197 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.controllers + + 100% + + + (3/3) + + + + 93.8% + + + (15/16) + + + + 88.1% + + + (37/42) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-8/sources/source-1.html b/htmlReport/ns-8/sources/source-1.html new file mode 100644 index 0000000..c237aed --- /dev/null +++ b/htmlReport/ns-8/sources/source-1.html @@ -0,0 +1,175 @@ + + + + + + + + Coverage Report > FilesStorageController + + + + + + +
+ + +

Coverage Summary for Class: FilesStorageController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
FilesStorageController + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 75% + + + (15/20) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.controllers;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.StorageService;
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ import jakarta.servlet.http.HttpServletRequest;
+ import org.springframework.core.io.Resource;
+ import org.springframework.http.HttpHeaders;
+ import org.springframework.http.MediaType;
+ import org.springframework.http.ResponseEntity;
+ import org.springframework.stereotype.Controller;
+ import org.springframework.web.bind.annotation.*;
+ import org.springframework.web.multipart.MultipartFile;
+ import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+ 
+ import java.io.IOException;
+ import java.util.List;
+ 
+ @Controller
+ @RequestMapping("/api/v1/files")
+ public class FilesStorageController {
+     private StorageService storageService;
+ 
+     public FilesStorageController(StorageService storageService) {
+         this.storageService = storageService;
+     }
+ 
+     @PostMapping("/upload")
+     public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("file_type") String fileType) {
+ 
+         String fileName = storageService.store(file, fileType);
+ 
+         String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath()
+                 .path("/api/v1/files/download/")
+                 .path(fileName)
+                 .toUriString();
+ 
+         return ResponseEntity.ok("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri);
+     }
+ 
+     @GetMapping("/download/{fileName:.+}")
+     @ResponseBody
+     public ResponseEntity<Resource> downloadFile(
+             @PathVariable String fileName,
+             HttpServletRequest request
+     ) {
+ 
+         try {
+             Resource resource = storageService.loadAsResource(fileName);
+             String contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());
+ 
+             if (contentType == null) {
+                 contentType = MediaType.APPLICATION_OCTET_STREAM.getType();
+             }
+ 
+             return ResponseEntity.ok()
+                     .contentType(MediaType.parseMediaType(contentType))
+                     .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
+                     .body(resource);
+         } catch (IOException e) {
+             throw new RuntimeException(e);
+         }
+     }
+ 
+     @GetMapping("/list")
+     public ResponseEntity<List<FileResponse>> listFiles() throws IOException {
+         List<FileResponse> fileNames = storageService.loadAll();
+ 
+         return ResponseEntity.ok(fileNames);
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-8/sources/source-2.html b/htmlReport/ns-8/sources/source-2.html new file mode 100644 index 0000000..043acfb --- /dev/null +++ b/htmlReport/ns-8/sources/source-2.html @@ -0,0 +1,153 @@ + + + + + + + + Coverage Report > PostController + + + + + + +
+ + +

Coverage Summary for Class: PostController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
PostController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (10/10) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.controllers;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.PostService;
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import org.springframework.data.domain.Page;
+ import org.springframework.data.domain.Pageable;
+ import org.springframework.http.ResponseEntity;
+ import org.springframework.web.bind.annotation.*;
+ 
+ import java.net.URI;
+ import java.util.List;
+ 
+ @RestController
+ @RequestMapping("api/v1/posts")
+ public class PostController {
+     private final PostService postService;
+ 
+     public PostController(PostService postService) {
+         this.postService = postService;
+     }
+ 
+     @GetMapping
+     public ResponseEntity<Page<Post>> getAllPosts(Pageable pageable) {
+         return ResponseEntity.ok(postService.listAll(pageable));
+     }
+ 
+     @PostMapping
+     public ResponseEntity<?> createPost(@RequestBody Post post) {
+         String slug = postService.save(post);
+         return ResponseEntity.created(URI.create("/api/v1/posts/" + slug)).build();
+     }
+ 
+     @GetMapping("/{slug}")
+     public ResponseEntity<Post> getPostBySlug(@PathVariable String slug) {
+         return ResponseEntity.ok(postService.findBySlug(slug));
+     }
+ 
+     @PutMapping("/{id}")
+     public ResponseEntity<?> updatePost(@PathVariable Long id, @RequestBody Post post) {
+         postService.update(id, post);
+         return ResponseEntity.noContent().build();
+     }
+ 
+     @DeleteMapping("/{id}")
+     public ResponseEntity<?> deletePost(@PathVariable Long id) {
+         postService.delete(id);
+         return ResponseEntity.noContent().build();
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-8/sources/source-3.html b/htmlReport/ns-8/sources/source-3.html new file mode 100644 index 0000000..02176c9 --- /dev/null +++ b/htmlReport/ns-8/sources/source-3.html @@ -0,0 +1,156 @@ + + + + + + + + Coverage Report > UserController + + + + + + +
+ + +

Coverage Summary for Class: UserController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
UserController + + 100% + + + (1/1) + + + + 100% + + + (6/6) + + + + 100% + + + (12/12) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.controllers;
+ 
+ import com.institutosemprealerta.semprealerta.application.service.UserService;
+ import com.institutosemprealerta.semprealerta.domain.model.UserDTO;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ import jakarta.validation.Valid;
+ import org.apache.catalina.connector.Response;
+ import org.springframework.http.HttpStatus;
+ import org.springframework.http.ResponseEntity;
+ import org.springframework.web.bind.annotation.*;
+ 
+ @RestController
+ @RequestMapping("api/v1/user")
+ public class UserController {
+ 
+     private final UserService userService;
+ 
+     public UserController(UserService userService) {
+         this.userService = userService;
+     }
+ 
+     @PostMapping
+     public ResponseEntity<?> createUser(@Valid @RequestBody UserDTO user) {
+         userService.save(user.toDomain());
+         return ResponseEntity.status(HttpStatus.CREATED).build();
+     }
+ 
+     @GetMapping("/{id}")
+     public ResponseEntity<UserResponse> findById(@PathVariable int id) {
+         User userFound = userService.findById(id);
+         return ResponseEntity.ok().body(UserResponse.toResponse(userFound));
+     }
+ 
+     @GetMapping("/registration/{reg}")
+     public ResponseEntity<UserResponse> findByRegistration(@PathVariable String reg) {
+         User userFound = userService.findByRegistration(reg);
+         return ResponseEntity.ok().body(UserResponse.toResponse(userFound));
+     }
+ 
+     @PutMapping("/{id}")
+     public ResponseEntity<?> updateUser(@PathVariable int id, @RequestBody UserDTO user) {
+         userService.update(id, user.toDomain());
+         return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
+     }
+ 
+     @DeleteMapping("/{id}")
+     public ResponseEntity<?> deleteUser(@PathVariable int id) {
+         userService.delete(id);
+         return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-9/index.html b/htmlReport/ns-9/index.html new file mode 100644 index 0000000..b48830c --- /dev/null +++ b/htmlReport/ns-9/index.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_BLOCK.html b/htmlReport/ns-9/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..e90e497 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_BLOCK.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..a015536 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_CLASS.html b/htmlReport/ns-9/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..3138eea --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_CLASS.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..76fb487 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_LINE.html b/htmlReport/ns-9/index_SORT_BY_LINE.html new file mode 100644 index 0000000..72acbd4 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_LINE.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..9c4e609 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_METHOD.html b/htmlReport/ns-9/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..c8ad9fb --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_METHOD.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..a43d322 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..831f696 --- /dev/null +++ b/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.file + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
FileEntity + + 100% + + + (1/1) + + + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-9/sources/source-1.html b/htmlReport/ns-9/sources/source-1.html new file mode 100644 index 0000000..e669e42 --- /dev/null +++ b/htmlReport/ns-9/sources/source-1.html @@ -0,0 +1,171 @@ + + + + + + + + Coverage Report > FileEntity + + + + + + +
+ + +

Coverage Summary for Class: FileEntity (com.institutosemprealerta.semprealerta.infrastructure.entity.file)

+ + + + + + + + + + + + + + + + + + + + + + + + +
Class + Method, % + + Line, % +
FileEntity + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
FileEntity$HibernateInstantiator$lot7KrLx
FileEntity$HibernateProxy$uNG3sB2a
Total + + 100% + + + (10/10) + + + + 100% + + + (21/21) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.file;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ import jakarta.persistence.*;
+ import lombok.Getter;
+ import lombok.Setter;
+ import org.hibernate.annotations.CreationTimestamp;
+ 
+ import java.time.LocalDateTime;
+ 
+ @Entity
+ @Table(name = "files")
+ @Getter
+ @Setter
+ public class FileEntity {
+     @Id
+     @GeneratedValue(strategy = GenerationType.IDENTITY)
+     private Long id;
+ 
+     private String fileName;
+     private String fileDownloadUri;
+     private String fileType;
+ 
+     @CreationTimestamp
+     private LocalDateTime uploadDate;
+ 
+     public FileEntity(String fileName, String fileDownloadUri, String fileType) {
+         this.fileName = fileName;
+         this.fileDownloadUri = fileDownloadUri;
+         this.fileType = fileType;
+     }
+ 
+     public FileEntity() {
+     }
+ 
+     public static FileEntity fromDomainToModel(File file) {
+         return new FileEntity(
+                 file.getFileName(),
+                 file.getFileDownloadUri(),
+                 file.getFileType()
+         );
+     }
+ 
+     public static FileResponse toResponse(FileEntity fileEntity) {
+         return new FileResponse(
+                 fileEntity.getId(),
+                 fileEntity.getFileName(),
+                 fileEntity.getFileDownloadUri(),
+                 fileEntity.getFileType(),
+                 fileEntity.getUploadDate()
+         );
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-a/index.html b/htmlReport/ns-a/index.html new file mode 100644 index 0000000..b2d036b --- /dev/null +++ b/htmlReport/ns-a/index.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_BLOCK.html b/htmlReport/ns-a/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..cd06a3f --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_BLOCK.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..569c651 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_CLASS.html b/htmlReport/ns-a/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..b46de25 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_CLASS.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..3baa618 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_LINE.html b/htmlReport/ns-a/index_SORT_BY_LINE.html new file mode 100644 index 0000000..b7101ca --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_LINE.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..45a6955 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_METHOD.html b/htmlReport/ns-a/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..30f29e3 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_METHOD.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..0d997f4 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..7655798 --- /dev/null +++ b/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,143 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.post + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
PostEntity + + 100% + + + (1/1) + + + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-a/sources/source-1.html b/htmlReport/ns-a/sources/source-1.html new file mode 100644 index 0000000..a90952b --- /dev/null +++ b/htmlReport/ns-a/sources/source-1.html @@ -0,0 +1,184 @@ + + + + + + + + Coverage Report > PostEntity + + + + + + +
+ + +

Coverage Summary for Class: PostEntity (com.institutosemprealerta.semprealerta.infrastructure.entity.post)

+ + + + + + + + + + + + + + + + + + + + + + + + +
Class + Method, % + + Line, % +
PostEntity + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
PostEntity$HibernateInstantiator$VnkNxDIT
PostEntity$HibernateProxy$0FgOcQ4W
Total + + 92.3% + + + (12/13) + + + + 96.6% + + + (28/29) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.post;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import jakarta.persistence.*;
+ import lombok.Getter;
+ import lombok.Setter;
+ import org.hibernate.annotations.CreationTimestamp;
+ 
+ import java.time.LocalDateTime;
+ 
+ @Setter
+ @Getter
+ @Entity
+ @Table(name = "post")
+ public class PostEntity {
+     @Id
+     @GeneratedValue(strategy = GenerationType.IDENTITY)
+     private Long id;
+     @Column(nullable = false)
+     private String title;
+     @Column(nullable = false)
+     private String slug;
+     @Column(columnDefinition = "TEXT")
+     private String content;
+     private String banner;
+     @CreationTimestamp
+     @Column(nullable = false, updatable = false)
+     private LocalDateTime createdAt;
+ 
+     public PostEntity() {
+     }
+ 
+     public PostEntity(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) {
+         this.id = id;
+         this.title = title;
+         this.slug = slug;
+         this.content = content;
+         this.banner = banner;
+         this.createdAt = createdAt;
+     }
+ 
+     public PostEntity(String title, String slug, String content, String banner) {
+         this.title = title;
+         this.slug = slug;
+         this.content = content;
+         this.banner = banner;
+     }
+ 
+     public static PostEntity fromModel(Post post) {
+         PostEntity postEntity = new PostEntity();
+         postEntity.setId(post.getId());
+         postEntity.setTitle(post.getTitle());
+         postEntity.setSlug(post.getSlug());
+         postEntity.setContent(post.getContent());
+         postEntity.setBanner(post.getBanner());
+         return postEntity;
+     }
+ 
+     public static Post toModel(PostEntity postEntity) {
+         return new Post(postEntity.getId(), postEntity.getTitle(), postEntity.getSlug(), postEntity.getContent(), postEntity.getBanner(), postEntity.getCreatedAt());
+     }
+ 
+     public Post toModel() {
+         return new Post(this.getId(), this.getTitle(), this.getSlug(), this.getContent(), this.getBanner(), this.getCreatedAt());
+     }
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-b/index.html b/htmlReport/ns-b/index.html new file mode 100644 index 0000000..207fabe --- /dev/null +++ b/htmlReport/ns-b/index.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_BLOCK.html b/htmlReport/ns-b/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..8e2692c --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_BLOCK.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..c23f9a1 --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_CLASS.html b/htmlReport/ns-b/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..49e64b6 --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_CLASS.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..42dce9a --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_LINE.html b/htmlReport/ns-b/index_SORT_BY_LINE.html new file mode 100644 index 0000000..41c1ba4 --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_LINE.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..dc2d558 --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_METHOD.html b/htmlReport/ns-b/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..bf7470d --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_METHOD.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..7d548d1 --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..1781deb --- /dev/null +++ b/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,224 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.infrastructure.entity.user + + 100% + + + (4/4) + + + + 81.2% + + + (26/32) + + + + 75.9% + + + (41/54) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
User + + 100% + + + (1/1) + + + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-b/sources/source-1.html b/htmlReport/ns-b/sources/source-1.html new file mode 100644 index 0000000..0612810 --- /dev/null +++ b/htmlReport/ns-b/sources/source-1.html @@ -0,0 +1,123 @@ + + + + + + + + Coverage Report > Address + + + + + + +
+ + +

Coverage Summary for Class: Address (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
Address + + 100% + + + (1/1) + + + + 71.4% + + + (5/7) + + + + 71.4% + + + (5/7) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
+ 
+ import jakarta.persistence.Embeddable;
+ import lombok.AllArgsConstructor;
+ import lombok.Getter;
+ import lombok.NoArgsConstructor;
+ import lombok.Setter;
+ 
+ @Getter
+ @Setter
+ @AllArgsConstructor
+ @NoArgsConstructor
+ @Embeddable
+ public class Address {
+     private String street;
+     private String number;
+     private String city;
+     private String zipCode;
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-b/sources/source-2.html b/htmlReport/ns-b/sources/source-2.html new file mode 100644 index 0000000..7d12b57 --- /dev/null +++ b/htmlReport/ns-b/sources/source-2.html @@ -0,0 +1,121 @@ + + + + + + + + Coverage Report > Contact + + + + + + +
+ + +

Coverage Summary for Class: Contact (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
Contact + + 100% + + + (1/1) + + + + 80% + + + (4/5) + + + + 80% + + + (4/5) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
+ 
+ import jakarta.persistence.Embeddable;
+ import lombok.AllArgsConstructor;
+ import lombok.Getter;
+ import lombok.NoArgsConstructor;
+ import lombok.Setter;
+ 
+ @Getter
+ @Setter
+ @NoArgsConstructor
+ @AllArgsConstructor
+ @Embeddable
+ public class Contact {
+     private String email;
+     private String phone;
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-b/sources/source-3.html b/htmlReport/ns-b/sources/source-3.html new file mode 100644 index 0000000..7e5226a --- /dev/null +++ b/htmlReport/ns-b/sources/source-3.html @@ -0,0 +1,205 @@ + + + + + + + + Coverage Report > User + + + + + + +
+ + +

Coverage Summary for Class: User (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

+ + + + + + + + + + + + + + + + + + + + + + + + +
Class + Method, % + + Line, % +
User + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
User$HibernateInstantiator$AfjpK58m
User$HibernateProxy$TymOTvJg
Total + + 87.5% + + + (14/16) + + + + 75% + + + (27/36) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
+ 
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.UserDTO;
+ import com.institutosemprealerta.semprealerta.utils.DateManipulation;
+ import jakarta.persistence.*;
+ import lombok.Getter;
+ import lombok.Setter;
+ import org.hibernate.annotations.CreationTimestamp;
+ 
+ import java.time.LocalDate;
+ import java.time.LocalDateTime;
+ import java.util.Random;
+ 
+ 
+ @Entity
+ @Table(name = "users")
+ @Getter
+ @Setter
+ public class User {
+     @Id
+     @GeneratedValue(strategy = GenerationType.IDENTITY)
+     private Long id;
+     @Column(unique = true)
+     private String registration;
+     private String name;
+     private String password;
+     private String gender;
+     private LocalDate birthDate;
+ 
+     private UserRoles roles;
+     @Embedded
+     private Contact contact;
+ 
+     @Embedded
+     private Address address;
+ 
+     @CreationTimestamp
+     @Column(name = "created_at", updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
+     private LocalDateTime createdAt;
+ 
+     public User() {
+     }
+ 
+ 
+     public User(String name, String password, String gender, LocalDate birthDate, UserRoles roles, Contact contact, Address address) {
+         this.name = name;
+         this.password = password;
+         this.gender = gender;
+         this.birthDate = birthDate;
+         this.roles = roles;
+         this.contact = contact;
+         this.address = address;
+     }
+ 
+ 
+ 
+     @PrePersist
+     public void generateRegistration() {
+         String prefix = this.name.substring(0, 3).toLowerCase() + "-";
+         this.registration = generateRegistration(prefix);
+     }
+ 
+     private String  generateRegistration(String prefix) {
+         StringBuilder registration = new StringBuilder(prefix);
+         Random random = new Random();
+ 
+         for (int i = 0; i < 8; i++) {
+             int digit = random.nextInt(10);
+             registration.append(digit);
+         }
+ 
+         return registration.toString();
+     }
+ 
+     public User fromModelToDomain(UserDTO dto) {
+         //LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate());
+         return new User(
+                 dto.name(),
+                 dto.password(),
+                 dto.gender(),
+                 dto.birthDate(),
+                 dto.roles(),
+                 new Contact(dto.email(), dto.phone()),
+                 new Address(dto.street(), dto.number(), dto.city(), dto.zipCode())
+         );
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-b/sources/source-4.html b/htmlReport/ns-b/sources/source-4.html new file mode 100644 index 0000000..019711d --- /dev/null +++ b/htmlReport/ns-b/sources/source-4.html @@ -0,0 +1,120 @@ + + + + + + + + Coverage Report > UserRoles + + + + + + +
+ + +

Coverage Summary for Class: UserRoles (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
UserRoles + + 100% + + + (1/1) + + + + 75% + + + (3/4) + + + + 83.3% + + + (5/6) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
+ 
+ public enum UserRoles {
+     ADMIN("ADMIN"),
+     USER("USER");
+ 
+     private final String role;
+ 
+     UserRoles(String role) {
+         this.role = role;
+     }
+ 
+     public String getRole() {
+         return role;
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-c/index.html b/htmlReport/ns-c/index.html new file mode 100644 index 0000000..5a2affe --- /dev/null +++ b/htmlReport/ns-c/index.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_BLOCK.html b/htmlReport/ns-c/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..073d7c8 --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_BLOCK.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..11f4dad --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_CLASS.html b/htmlReport/ns-c/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..09f3646 --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_CLASS.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..7742b16 --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_LINE.html b/htmlReport/ns-c/index_SORT_BY_LINE.html new file mode 100644 index 0000000..62a445e --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_LINE.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..4a95dbe --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_METHOD.html b/htmlReport/ns-c/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..c77ccd6 --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_METHOD.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..2f37242 --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..e76174f --- /dev/null +++ b/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,170 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.utils + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

+ + + + + + + + + + + + + +
Package + Class, % + + Method, % + + Line, % +
com.institutosemprealerta.semprealerta.utils + + 0% + + + (0/2) + + + + 0% + + + (0/4) + + + + 0% + + + (0/6) + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
+Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+ + + + + + diff --git a/htmlReport/ns-c/sources/source-1.html b/htmlReport/ns-c/sources/source-1.html new file mode 100644 index 0000000..6665931 --- /dev/null +++ b/htmlReport/ns-c/sources/source-1.html @@ -0,0 +1,120 @@ + + + + + + + + Coverage Report > DateManipulation + + + + + + +
+ + +

Coverage Summary for Class: DateManipulation (com.institutosemprealerta.semprealerta.utils)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
DateManipulation + + 0% + + + (0/1) + + + + 0% + + + (0/3) + + + + 0% + + + (0/5) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.utils;
+ 
+ import java.time.LocalDate;
+ import java.time.format.DateTimeFormatter;
+ 
+ public abstract class DateManipulation {
+     public static LocalDate stringToLocalDate(String date) {
+         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+         return LocalDate.parse(date, formatter);
+     }
+ 
+     public static String localDateToString(LocalDate date) {
+         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+         return date.format(formatter);
+     }
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-c/sources/source-2.html b/htmlReport/ns-c/sources/source-2.html new file mode 100644 index 0000000..4ea579b --- /dev/null +++ b/htmlReport/ns-c/sources/source-2.html @@ -0,0 +1,114 @@ + + + + + + + + Coverage Report > HashGeneration + + + + + + +
+ + +

Coverage Summary for Class: HashGeneration (com.institutosemprealerta.semprealerta.utils)

+ + + + + + + + + + + + + + + +
Class + Class, % + + Method, % + + Line, % +
HashGeneration + + 0% + + + (0/1) + + + + 0% + + + (0/1) + + + + 0% + + + (0/1) + +
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.utils;
+ 
+ import java.util.HashSet;
+ import java.util.Random;
+ import java.util.Set;
+ 
+ public abstract class HashGeneration {
+ 
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-d/index.html b/htmlReport/ns-d/index.html new file mode 100644 index 0000000..335a1b6 --- /dev/null +++ b/htmlReport/ns-d/index.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_BLOCK.html b/htmlReport/ns-d/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..e85a315 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_BLOCK.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..ce7843a --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_CLASS.html b/htmlReport/ns-d/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..3f1c513 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_CLASS.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..aab93bc --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_LINE.html b/htmlReport/ns-d/index_SORT_BY_LINE.html new file mode 100644 index 0000000..281486d --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_LINE.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..a769347 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_METHOD.html b/htmlReport/ns-d/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..20adf31 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_METHOD.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..773f659 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..eee8037 --- /dev/null +++ b/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.in
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-d/sources/source-1.html b/htmlReport/ns-d/sources/source-1.html new file mode 100644 index 0000000..6dc1235 --- /dev/null +++ b/htmlReport/ns-d/sources/source-1.html @@ -0,0 +1,82 @@ + + + + + + + + Coverage Report > SlugGenerator + + + + + + +
+ + +

Coverage Summary for Class: SlugGenerator (com.institutosemprealerta.semprealerta.domain.ports.in)

+ + + + + + + + + + + + + + + + + + +
Class
SlugGenerator$MockitoMock$Uh0DcWOO
SlugGenerator$MockitoMock$Uh0DcWOO$auxiliary$iHPGM3rW
SlugGenerator$MockitoMock$Uh0DcWOO$auxiliary$ZOm3ibOz
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.in;
+ 
+ public interface SlugGenerator {
+     String generate(String input);
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-e/index.html b/htmlReport/ns-e/index.html new file mode 100644 index 0000000..6cf07b1 --- /dev/null +++ b/htmlReport/ns-e/index.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_BLOCK.html b/htmlReport/ns-e/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..80e68e6 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_BLOCK.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..ad703de --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_CLASS.html b/htmlReport/ns-e/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..678175f --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_CLASS.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..fc31bc4 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_LINE.html b/htmlReport/ns-e/index_SORT_BY_LINE.html new file mode 100644 index 0000000..6e26099 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_LINE.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..7eea42d --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_METHOD.html b/htmlReport/ns-e/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..d100bc9 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_METHOD.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..e036a96 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..5694cd6 --- /dev/null +++ b/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.domain.ports.out
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-e/sources/source-1.html b/htmlReport/ns-e/sources/source-1.html new file mode 100644 index 0000000..dabac30 --- /dev/null +++ b/htmlReport/ns-e/sources/source-1.html @@ -0,0 +1,92 @@ + + + + + + + + Coverage Report > UserRepository + + + + + + +
+ + +

Coverage Summary for Class: UserRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

+ + + + + + + + + + + + + + + + + + +
Class
UserRepository$MockitoMock$43J0nWYK
UserRepository$MockitoMock$43J0nWYK$auxiliary$xupH4qnj
UserRepository$MockitoMock$43J0nWYK$auxiliary$y2F2NXYv
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ 
+ import java.util.Optional;
+ 
+ public interface UserRepository {
+     void save(User user);
+     Optional<User> findById(int id);
+     void update(int id, User user);
+     void delete(int id);
+     Optional<User> findByRegistration(String registration);
+     Optional<User> findByEmail(String email);
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-e/sources/source-2.html b/htmlReport/ns-e/sources/source-2.html new file mode 100644 index 0000000..a2b448b --- /dev/null +++ b/htmlReport/ns-e/sources/source-2.html @@ -0,0 +1,99 @@ + + + + + + + + Coverage Report > PostRepository + + + + + + +
+ + +

Coverage Summary for Class: PostRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

+ + + + + + + + + + + + + + + + + + +
Class
PostRepository$MockitoMock$FXmIOh2S
PostRepository$MockitoMock$FXmIOh2S$auxiliary$XCsBBgYQ
PostRepository$MockitoMock$FXmIOh2S$auxiliary$yhxdjeMl
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
+ import org.springframework.data.domain.Page;
+ import org.springframework.data.domain.Pageable;
+ 
+ import java.util.List;
+ 
+ public interface PostRepository {
+     String save(Post post);
+ 
+     void delete(Long id);
+ 
+     void update(Long id, Post post);
+ 
+     Page<Post> listAll(Pageable pageable);
+ 
+     Post findBySlug(String slug);
+     Post findById(Long id);
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-e/sources/source-3.html b/htmlReport/ns-e/sources/source-3.html new file mode 100644 index 0000000..f33a3e7 --- /dev/null +++ b/htmlReport/ns-e/sources/source-3.html @@ -0,0 +1,90 @@ + + + + + + + + Coverage Report > FileRepository + + + + + + +
+ + +

Coverage Summary for Class: FileRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

+ + + + + + + + + + + + + + + + + + +
Class
FileRepository$MockitoMock$bdzjIbdl
FileRepository$MockitoMock$bdzjIbdl$auxiliary$dGUXK8ZU
FileRepository$MockitoMock$bdzjIbdl$auxiliary$jV8676Io
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.domain.ports.out;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ 
+ import java.util.List;
+ 
+ public interface FileRepository {
+     void save(File file);
+     void delete(Long id);
+     List<FileResponse> listAll();
+ 
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-f/index.html b/htmlReport/ns-f/index.html new file mode 100644 index 0000000..2b3720d --- /dev/null +++ b/htmlReport/ns-f/index.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_BLOCK.html b/htmlReport/ns-f/index_SORT_BY_BLOCK.html new file mode 100644 index 0000000..4f4d47d --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_BLOCK.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html new file mode 100644 index 0000000..4ecd10a --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_CLASS.html b/htmlReport/ns-f/index_SORT_BY_CLASS.html new file mode 100644 index 0000000..28d33a7 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_CLASS.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html new file mode 100644 index 0000000..4b7c1bf --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_LINE.html b/htmlReport/ns-f/index_SORT_BY_LINE.html new file mode 100644 index 0000000..7288496 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_LINE.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html new file mode 100644 index 0000000..54ebba5 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_METHOD.html b/htmlReport/ns-f/index_SORT_BY_METHOD.html new file mode 100644 index 0000000..6a202e2 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_METHOD.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html new file mode 100644 index 0000000..5d635c8 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html new file mode 100644 index 0000000..9d3dd77 --- /dev/null +++ b/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html @@ -0,0 +1,68 @@ + + + + + + Coverage Report > com.institutosemprealerta.semprealerta.application.service + + + + + + +
+ + + +

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

+ + + + + + + +
Package
com.institutosemprealerta.semprealerta.application.service
+ +
+
+ + + + + +
+Class
+ +
+ + + + + + diff --git a/htmlReport/ns-f/sources/source-1.html b/htmlReport/ns-f/sources/source-1.html new file mode 100644 index 0000000..d84db5d --- /dev/null +++ b/htmlReport/ns-f/sources/source-1.html @@ -0,0 +1,95 @@ + + + + + + + + Coverage Report > PostService + + + + + + +
+ + +

Coverage Summary for Class: PostService (com.institutosemprealerta.semprealerta.application.service)

+ + + + + + + + + + + + + + + + + + +
Class
PostService$MockitoMock$MVEKQJkO
PostService$MockitoMock$MVEKQJkO$auxiliary$4qSCe2Cl
PostService$MockitoMock$MVEKQJkO$auxiliary$I1PVc0FV
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.Post;
+ import org.springframework.data.domain.Page;
+ import org.springframework.data.domain.Pageable;
+ 
+ 
+ import java.util.List;
+ 
+ public interface PostService {
+     String save(Post post);
+     void delete(Long id);
+     void update(Long id, Post post);
+     Page<Post> listAll(Pageable pageable);
+ 
+     Post findBySlug(String slug);
+     Post findById(Long id);
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-f/sources/source-2.html b/htmlReport/ns-f/sources/source-2.html new file mode 100644 index 0000000..198374c --- /dev/null +++ b/htmlReport/ns-f/sources/source-2.html @@ -0,0 +1,97 @@ + + + + + + + + Coverage Report > StorageService + + + + + + +
+ + +

Coverage Summary for Class: StorageService (com.institutosemprealerta.semprealerta.application.service)

+ + + + + + + + + + + + + + + + + + +
Class
StorageService$MockitoMock$ok3gzlRG
StorageService$MockitoMock$ok3gzlRG$auxiliary$CDsNzSU1
StorageService$MockitoMock$ok3gzlRG$auxiliary$JZInhQqD
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service;
+ 
+ import com.institutosemprealerta.semprealerta.domain.model.File;
+ import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
+ import org.springframework.core.io.Resource;
+ import org.springframework.web.multipart.MultipartFile;
+ 
+ import java.nio.file.Path;
+ import java.util.List;
+ import java.util.stream.Stream;
+ 
+ public interface StorageService {
+     void init();
+     String store(MultipartFile file, String fileType);
+     List<FileResponse> loadAll();
+     Path load(String filename);
+     Resource loadAsResource(String filename);
+     void delete(String filename);
+     void deleteAll();
+ }
+
+
+
+ + + + + + diff --git a/htmlReport/ns-f/sources/source-3.html b/htmlReport/ns-f/sources/source-3.html new file mode 100644 index 0000000..39ad11f --- /dev/null +++ b/htmlReport/ns-f/sources/source-3.html @@ -0,0 +1,89 @@ + + + + + + + + Coverage Report > UserService + + + + + + +
+ + +

Coverage Summary for Class: UserService (com.institutosemprealerta.semprealerta.application.service)

+ + + + + + + + + + + + + + + + + + +
Class
UserService$MockitoMock$iVZX1TuB
UserService$MockitoMock$iVZX1TuB$auxiliary$DLBgNvSR
UserService$MockitoMock$iVZX1TuB$auxiliary$GNdSaOGg
Total
+ +
+
+ + +
+ package com.institutosemprealerta.semprealerta.application.service;
+ 
+ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
+ 
+ public interface UserService {
+     void save(User user);
+     void update(int id, User user);
+     void delete(int id);
+     User findByRegistration(String registration);
+     User findByEmail(String email);
+     User findById(int id);
+ }
+
+
+
+ + + + + + diff --git a/src/test/java/com/institutosemprealerta/semprealerta/SempreAlertaApplicationTests.java b/src/test/java/com/institutosemprealerta/semprealerta/SempreAlertaApplicationTests.java index aab2b73..aa4386b 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/SempreAlertaApplicationTests.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/SempreAlertaApplicationTests.java @@ -1,9 +1,11 @@ package com.institutosemprealerta.semprealerta; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.boot.test.context.SpringBootTest; -@SpringBootTest +@ExtendWith(MockitoExtension.class) class SempreAlertaApplicationTests { @Test diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java new file mode 100644 index 0000000..2622579 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java @@ -0,0 +1,109 @@ +package com.institutosemprealerta.semprealerta.infrastructure.controllers; + +import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks.PostMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import java.util.List; +import java.util.Objects; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Given a PostController") +class PostControllerTest { + + @InjectMocks + private PostController postController; + + @Mock + private PostService postService; + + private final Post postMock = PostMocks.returnValidPostModel(); + + @BeforeEach + void setUp() { + List posts = List.of(postMock); + + Pageable pageable = PageRequest.of(0, 10); + Page postPage = new PageImpl<>(posts, pageable, posts.size()); + + when(postService.listAll(pageable)).thenReturn(postPage); + when(postService.save(postMock)).thenReturn(postMock.getSlug()); + when(postService.findBySlug(postMock.getSlug())).thenReturn(postMock); + doNothing().when(postService).update(postMock.getId(), postMock); + doNothing().when(postService).delete(postMock.getId()); + } + + @AfterEach + void tearDown() { + reset(postService); + } + + @Test + @DisplayName("When getAllPosts, then return a pageable list of posts") + void should_GetAllPosts_Successfully() { + PageRequest pageable = PageRequest.of(0, 10); + ResponseEntity> postPage = postController.getAllPosts(pageable); + + assertNotNull(postPage); + assertEquals(HttpStatus.OK, postPage.getStatusCode()); + assertEquals(1, Objects.requireNonNull(postPage.getBody()).getTotalElements()); + assertEquals(postMock, postPage.getBody().getContent().get(0)); + } + + @Test + @DisplayName("When createPost, then return a URI") + void should_CreatePost_Successfully() { + ResponseEntity response = postController.createPost(postMock); + + assertNotNull(response); + assertEquals(HttpStatus.CREATED, response.getStatusCode()); + assertEquals("/api/v1/posts/" + postMock.getSlug(), response.getHeaders().getLocation().getPath()); + } + + @Test + @DisplayName("When getPostBySlug, then return a post") + void should_GetPostBySlug_Successfully() { + ResponseEntity response = postController.getPostBySlug(postMock.getSlug()); + + assertNotNull(response); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals(postMock, response.getBody()); + } + + @Test + @DisplayName("When updatePost, then return no content") + void should_UpdatePost_Successfully() { + ResponseEntity response = postController.updatePost(postMock.getId(), postMock); + + assertNotNull(response); + assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); + verify(postService, times(1)).update(postMock.getId(), postMock); + } + + @Test + @DisplayName("When deletePost, then return no content") + void should_DeletePost_Successfully() { + ResponseEntity response = postController.deletePost(postMock.getId()); + + assertNotNull(response); + assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); + verify(postService, times(1)).delete(postMock.getId()); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java index acfb6b2..83cd1bb 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/post/mocks/PostMocks.java @@ -12,7 +12,7 @@ public class PostMocks { private static final Long id = faker.number().randomNumber(); private static final String title = faker.lorem().sentence(); - private static final String slug = faker.lorem().sentence(); + private static final String slug = faker.internet().slug(); private static final String content = faker.lorem().paragraph(); private static final String banner = faker.internet().image(); private static final LocalDateTime createdAt = LocalDateTime.now(); From 63333e08e98b07c5420e3f8d65f3010aea275a71 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 10:58:36 -0300 Subject: [PATCH 42/65] fix: container image tags Signed-off-by: MatheusVict --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index 39e4d42..91204cd 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,10 @@ lombok + + matheusvict/${project.artifactId}:${project.version} + + IF_NOT_PRESENT From 210a45fd0ac5679a7d56d8a2500a98e4255caacf Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 11:16:37 -0300 Subject: [PATCH 43/65] feat: user exceptions Signed-off-by: MatheusVict --- htmlReport/css/coverage.css | 154 -- htmlReport/css/idea.min.css | 118 -- htmlReport/img/arrowDown.gif | Bin 89 -> 0 bytes htmlReport/img/arrowUp.gif | Bin 91 -> 0 bytes htmlReport/index.html | 439 ------ htmlReport/index_SORT_BY_BLOCK.html | 439 ------ htmlReport/index_SORT_BY_BLOCK_DESC.html | 439 ------ htmlReport/index_SORT_BY_CLASS.html | 439 ------ htmlReport/index_SORT_BY_CLASS_DESC.html | 439 ------ htmlReport/index_SORT_BY_LINE.html | 439 ------ htmlReport/index_SORT_BY_LINE_DESC.html | 439 ------ htmlReport/index_SORT_BY_METHOD.html | 439 ------ htmlReport/index_SORT_BY_METHOD_DESC.html | 439 ------ htmlReport/index_SORT_BY_NAME_DESC.html | 439 ------ htmlReport/js/highlight.min.js | 1388 ----------------- htmlReport/js/highlightjs-line-numbers.min.js | 24 - htmlReport/ns-1/index.html | 143 -- htmlReport/ns-1/index_SORT_BY_BLOCK.html | 143 -- htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html | 143 -- htmlReport/ns-1/index_SORT_BY_CLASS.html | 143 -- htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html | 143 -- htmlReport/ns-1/index_SORT_BY_LINE.html | 143 -- htmlReport/ns-1/index_SORT_BY_LINE_DESC.html | 143 -- htmlReport/ns-1/index_SORT_BY_METHOD.html | 143 -- .../ns-1/index_SORT_BY_METHOD_DESC.html | 143 -- htmlReport/ns-1/index_SORT_BY_NAME_DESC.html | 143 -- htmlReport/ns-1/sources/source-1.html | 127 -- htmlReport/ns-10/index.html | 68 - htmlReport/ns-10/index_SORT_BY_BLOCK.html | 68 - .../ns-10/index_SORT_BY_BLOCK_DESC.html | 68 - htmlReport/ns-10/index_SORT_BY_CLASS.html | 68 - .../ns-10/index_SORT_BY_CLASS_DESC.html | 68 - htmlReport/ns-10/index_SORT_BY_LINE.html | 68 - htmlReport/ns-10/index_SORT_BY_LINE_DESC.html | 68 - htmlReport/ns-10/index_SORT_BY_METHOD.html | 68 - .../ns-10/index_SORT_BY_METHOD_DESC.html | 68 - htmlReport/ns-10/index_SORT_BY_NAME_DESC.html | 68 - htmlReport/ns-10/sources/source-1.html | 93 -- htmlReport/ns-10/sources/source-2.html | 89 -- htmlReport/ns-10/sources/source-3.html | 86 - htmlReport/ns-2/index.html | 197 --- htmlReport/ns-2/index_SORT_BY_BLOCK.html | 197 --- htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html | 197 --- htmlReport/ns-2/index_SORT_BY_CLASS.html | 197 --- htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html | 197 --- htmlReport/ns-2/index_SORT_BY_LINE.html | 197 --- htmlReport/ns-2/index_SORT_BY_LINE_DESC.html | 197 --- htmlReport/ns-2/index_SORT_BY_METHOD.html | 197 --- .../ns-2/index_SORT_BY_METHOD_DESC.html | 197 --- htmlReport/ns-2/index_SORT_BY_NAME_DESC.html | 197 --- htmlReport/ns-2/sources/source-1.html | 166 -- htmlReport/ns-2/sources/source-2.html | 216 --- htmlReport/ns-2/sources/source-3.html | 153 -- htmlReport/ns-3/index.html | 197 --- htmlReport/ns-3/index_SORT_BY_BLOCK.html | 197 --- htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html | 197 --- htmlReport/ns-3/index_SORT_BY_CLASS.html | 197 --- htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html | 197 --- htmlReport/ns-3/index_SORT_BY_LINE.html | 197 --- htmlReport/ns-3/index_SORT_BY_LINE_DESC.html | 197 --- htmlReport/ns-3/index_SORT_BY_METHOD.html | 197 --- .../ns-3/index_SORT_BY_METHOD_DESC.html | 197 --- htmlReport/ns-3/index_SORT_BY_NAME_DESC.html | 197 --- htmlReport/ns-3/sources/source-1.html | 163 -- htmlReport/ns-3/sources/source-2.html | 135 -- htmlReport/ns-3/sources/source-3.html | 162 -- htmlReport/ns-4/index.html | 143 -- htmlReport/ns-4/index_SORT_BY_BLOCK.html | 143 -- htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html | 143 -- htmlReport/ns-4/index_SORT_BY_CLASS.html | 143 -- htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html | 143 -- htmlReport/ns-4/index_SORT_BY_LINE.html | 143 -- htmlReport/ns-4/index_SORT_BY_LINE_DESC.html | 143 -- htmlReport/ns-4/index_SORT_BY_METHOD.html | 143 -- .../ns-4/index_SORT_BY_METHOD_DESC.html | 143 -- htmlReport/ns-4/index_SORT_BY_NAME_DESC.html | 143 -- htmlReport/ns-4/sources/source-1.html | 123 -- htmlReport/ns-5/index.html | 197 --- htmlReport/ns-5/index_SORT_BY_BLOCK.html | 197 --- htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html | 197 --- htmlReport/ns-5/index_SORT_BY_CLASS.html | 197 --- htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html | 197 --- htmlReport/ns-5/index_SORT_BY_LINE.html | 197 --- htmlReport/ns-5/index_SORT_BY_LINE_DESC.html | 197 --- htmlReport/ns-5/index_SORT_BY_METHOD.html | 197 --- .../ns-5/index_SORT_BY_METHOD_DESC.html | 197 --- htmlReport/ns-5/index_SORT_BY_NAME_DESC.html | 197 --- htmlReport/ns-5/sources/source-1.html | 116 -- htmlReport/ns-5/sources/source-2.html | 110 -- htmlReport/ns-5/sources/source-3.html | 138 -- htmlReport/ns-6/index.html | 197 --- htmlReport/ns-6/index_SORT_BY_BLOCK.html | 197 --- htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html | 197 --- htmlReport/ns-6/index_SORT_BY_CLASS.html | 197 --- htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html | 197 --- htmlReport/ns-6/index_SORT_BY_LINE.html | 197 --- htmlReport/ns-6/index_SORT_BY_LINE_DESC.html | 197 --- htmlReport/ns-6/index_SORT_BY_METHOD.html | 197 --- .../ns-6/index_SORT_BY_METHOD_DESC.html | 197 --- htmlReport/ns-6/index_SORT_BY_NAME_DESC.html | 197 --- htmlReport/ns-6/sources/source-1.html | 142 -- htmlReport/ns-6/sources/source-2.html | 165 -- htmlReport/ns-6/sources/source-3.html | 163 -- htmlReport/ns-7/index.html | 170 -- htmlReport/ns-7/index_SORT_BY_BLOCK.html | 170 -- htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html | 170 -- htmlReport/ns-7/index_SORT_BY_CLASS.html | 170 -- htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html | 170 -- htmlReport/ns-7/index_SORT_BY_LINE.html | 170 -- htmlReport/ns-7/index_SORT_BY_LINE_DESC.html | 170 -- htmlReport/ns-7/index_SORT_BY_METHOD.html | 170 -- .../ns-7/index_SORT_BY_METHOD_DESC.html | 170 -- htmlReport/ns-7/index_SORT_BY_NAME_DESC.html | 170 -- htmlReport/ns-7/sources/source-1.html | 127 -- htmlReport/ns-7/sources/source-2.html | 122 -- htmlReport/ns-8/index.html | 197 --- htmlReport/ns-8/index_SORT_BY_BLOCK.html | 197 --- htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html | 197 --- htmlReport/ns-8/index_SORT_BY_CLASS.html | 197 --- htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html | 197 --- htmlReport/ns-8/index_SORT_BY_LINE.html | 197 --- htmlReport/ns-8/index_SORT_BY_LINE_DESC.html | 197 --- htmlReport/ns-8/index_SORT_BY_METHOD.html | 197 --- .../ns-8/index_SORT_BY_METHOD_DESC.html | 197 --- htmlReport/ns-8/index_SORT_BY_NAME_DESC.html | 197 --- htmlReport/ns-8/sources/source-1.html | 175 --- htmlReport/ns-8/sources/source-2.html | 153 -- htmlReport/ns-8/sources/source-3.html | 156 -- htmlReport/ns-9/index.html | 143 -- htmlReport/ns-9/index_SORT_BY_BLOCK.html | 143 -- htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html | 143 -- htmlReport/ns-9/index_SORT_BY_CLASS.html | 143 -- htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html | 143 -- htmlReport/ns-9/index_SORT_BY_LINE.html | 143 -- htmlReport/ns-9/index_SORT_BY_LINE_DESC.html | 143 -- htmlReport/ns-9/index_SORT_BY_METHOD.html | 143 -- .../ns-9/index_SORT_BY_METHOD_DESC.html | 143 -- htmlReport/ns-9/index_SORT_BY_NAME_DESC.html | 143 -- htmlReport/ns-9/sources/source-1.html | 171 -- htmlReport/ns-a/index.html | 143 -- htmlReport/ns-a/index_SORT_BY_BLOCK.html | 143 -- htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html | 143 -- htmlReport/ns-a/index_SORT_BY_CLASS.html | 143 -- htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html | 143 -- htmlReport/ns-a/index_SORT_BY_LINE.html | 143 -- htmlReport/ns-a/index_SORT_BY_LINE_DESC.html | 143 -- htmlReport/ns-a/index_SORT_BY_METHOD.html | 143 -- .../ns-a/index_SORT_BY_METHOD_DESC.html | 143 -- htmlReport/ns-a/index_SORT_BY_NAME_DESC.html | 143 -- htmlReport/ns-a/sources/source-1.html | 184 --- htmlReport/ns-b/index.html | 224 --- htmlReport/ns-b/index_SORT_BY_BLOCK.html | 224 --- htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html | 224 --- htmlReport/ns-b/index_SORT_BY_CLASS.html | 224 --- htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html | 224 --- htmlReport/ns-b/index_SORT_BY_LINE.html | 224 --- htmlReport/ns-b/index_SORT_BY_LINE_DESC.html | 224 --- htmlReport/ns-b/index_SORT_BY_METHOD.html | 224 --- .../ns-b/index_SORT_BY_METHOD_DESC.html | 224 --- htmlReport/ns-b/index_SORT_BY_NAME_DESC.html | 224 --- htmlReport/ns-b/sources/source-1.html | 123 -- htmlReport/ns-b/sources/source-2.html | 121 -- htmlReport/ns-b/sources/source-3.html | 205 --- htmlReport/ns-b/sources/source-4.html | 120 -- htmlReport/ns-c/index.html | 170 -- htmlReport/ns-c/index_SORT_BY_BLOCK.html | 170 -- htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html | 170 -- htmlReport/ns-c/index_SORT_BY_CLASS.html | 170 -- htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html | 170 -- htmlReport/ns-c/index_SORT_BY_LINE.html | 170 -- htmlReport/ns-c/index_SORT_BY_LINE_DESC.html | 170 -- htmlReport/ns-c/index_SORT_BY_METHOD.html | 170 -- .../ns-c/index_SORT_BY_METHOD_DESC.html | 170 -- htmlReport/ns-c/index_SORT_BY_NAME_DESC.html | 170 -- htmlReport/ns-c/sources/source-1.html | 120 -- htmlReport/ns-c/sources/source-2.html | 114 -- htmlReport/ns-d/index.html | 68 - htmlReport/ns-d/index_SORT_BY_BLOCK.html | 68 - htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html | 68 - htmlReport/ns-d/index_SORT_BY_CLASS.html | 68 - htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html | 68 - htmlReport/ns-d/index_SORT_BY_LINE.html | 68 - htmlReport/ns-d/index_SORT_BY_LINE_DESC.html | 68 - htmlReport/ns-d/index_SORT_BY_METHOD.html | 68 - .../ns-d/index_SORT_BY_METHOD_DESC.html | 68 - htmlReport/ns-d/index_SORT_BY_NAME_DESC.html | 68 - htmlReport/ns-d/sources/source-1.html | 82 - htmlReport/ns-e/index.html | 68 - htmlReport/ns-e/index_SORT_BY_BLOCK.html | 68 - htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html | 68 - htmlReport/ns-e/index_SORT_BY_CLASS.html | 68 - htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html | 68 - htmlReport/ns-e/index_SORT_BY_LINE.html | 68 - htmlReport/ns-e/index_SORT_BY_LINE_DESC.html | 68 - htmlReport/ns-e/index_SORT_BY_METHOD.html | 68 - .../ns-e/index_SORT_BY_METHOD_DESC.html | 68 - htmlReport/ns-e/index_SORT_BY_NAME_DESC.html | 68 - htmlReport/ns-e/sources/source-1.html | 92 -- htmlReport/ns-e/sources/source-2.html | 99 -- htmlReport/ns-e/sources/source-3.html | 90 -- htmlReport/ns-f/index.html | 68 - htmlReport/ns-f/index_SORT_BY_BLOCK.html | 68 - htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html | 68 - htmlReport/ns-f/index_SORT_BY_CLASS.html | 68 - htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html | 68 - htmlReport/ns-f/index_SORT_BY_LINE.html | 68 - htmlReport/ns-f/index_SORT_BY_LINE_DESC.html | 68 - htmlReport/ns-f/index_SORT_BY_METHOD.html | 68 - .../ns-f/index_SORT_BY_METHOD_DESC.html | 68 - htmlReport/ns-f/index_SORT_BY_NAME_DESC.html | 68 - htmlReport/ns-f/sources/source-1.html | 95 -- htmlReport/ns-f/sources/source-2.html | 97 -- htmlReport/ns-f/sources/source-3.html | 89 -- .../service/impl/UserServiceImpl.java | 5 +- .../user/EmailAlreadyExistsException.java | 7 + .../user/UserNotFoundException.java | 7 + .../adpters/JpaUserRepositoryAdapter.java | 3 +- 217 files changed, 19 insertions(+), 34889 deletions(-) delete mode 100644 htmlReport/css/coverage.css delete mode 100644 htmlReport/css/idea.min.css delete mode 100644 htmlReport/img/arrowDown.gif delete mode 100644 htmlReport/img/arrowUp.gif delete mode 100644 htmlReport/index.html delete mode 100644 htmlReport/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/index_SORT_BY_LINE.html delete mode 100644 htmlReport/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/js/highlight.min.js delete mode 100644 htmlReport/js/highlightjs-line-numbers.min.js delete mode 100644 htmlReport/ns-1/index.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-1/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-1/sources/source-1.html delete mode 100644 htmlReport/ns-10/index.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-10/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-10/sources/source-1.html delete mode 100644 htmlReport/ns-10/sources/source-2.html delete mode 100644 htmlReport/ns-10/sources/source-3.html delete mode 100644 htmlReport/ns-2/index.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-2/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-2/sources/source-1.html delete mode 100644 htmlReport/ns-2/sources/source-2.html delete mode 100644 htmlReport/ns-2/sources/source-3.html delete mode 100644 htmlReport/ns-3/index.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-3/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-3/sources/source-1.html delete mode 100644 htmlReport/ns-3/sources/source-2.html delete mode 100644 htmlReport/ns-3/sources/source-3.html delete mode 100644 htmlReport/ns-4/index.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-4/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-4/sources/source-1.html delete mode 100644 htmlReport/ns-5/index.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-5/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-5/sources/source-1.html delete mode 100644 htmlReport/ns-5/sources/source-2.html delete mode 100644 htmlReport/ns-5/sources/source-3.html delete mode 100644 htmlReport/ns-6/index.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-6/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-6/sources/source-1.html delete mode 100644 htmlReport/ns-6/sources/source-2.html delete mode 100644 htmlReport/ns-6/sources/source-3.html delete mode 100644 htmlReport/ns-7/index.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-7/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-7/sources/source-1.html delete mode 100644 htmlReport/ns-7/sources/source-2.html delete mode 100644 htmlReport/ns-8/index.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-8/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-8/sources/source-1.html delete mode 100644 htmlReport/ns-8/sources/source-2.html delete mode 100644 htmlReport/ns-8/sources/source-3.html delete mode 100644 htmlReport/ns-9/index.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-9/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-9/sources/source-1.html delete mode 100644 htmlReport/ns-a/index.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-a/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-a/sources/source-1.html delete mode 100644 htmlReport/ns-b/index.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-b/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-b/sources/source-1.html delete mode 100644 htmlReport/ns-b/sources/source-2.html delete mode 100644 htmlReport/ns-b/sources/source-3.html delete mode 100644 htmlReport/ns-b/sources/source-4.html delete mode 100644 htmlReport/ns-c/index.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-c/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-c/sources/source-1.html delete mode 100644 htmlReport/ns-c/sources/source-2.html delete mode 100644 htmlReport/ns-d/index.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-d/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-d/sources/source-1.html delete mode 100644 htmlReport/ns-e/index.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-e/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-e/sources/source-1.html delete mode 100644 htmlReport/ns-e/sources/source-2.html delete mode 100644 htmlReport/ns-e/sources/source-3.html delete mode 100644 htmlReport/ns-f/index.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_BLOCK.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_CLASS.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_LINE.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_LINE_DESC.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_METHOD.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html delete mode 100644 htmlReport/ns-f/index_SORT_BY_NAME_DESC.html delete mode 100644 htmlReport/ns-f/sources/source-1.html delete mode 100644 htmlReport/ns-f/sources/source-2.html delete mode 100644 htmlReport/ns-f/sources/source-3.html create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/EmailAlreadyExistsException.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/UserNotFoundException.java diff --git a/htmlReport/css/coverage.css b/htmlReport/css/coverage.css deleted file mode 100644 index cef7765..0000000 --- a/htmlReport/css/coverage.css +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2000-2021 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -* { - margin: 0; - padding: 0; -} - -body { - background-color: #fff; - font-family: helvetica neue, tahoma, arial, sans-serif; - font-size: 82%; - color: #151515; -} - -h1 { - margin: 0.5em 0; - color: #010101; - font-weight: normal; - font-size: 18px; -} - -h2 { - margin: 0.5em 0; - color: #010101; - font-weight: normal; - font-size: 16px; -} - -a { - color: #1564C2; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -span.separator { - color: #9BA9BA; - padding-left: 5px; - padding-right: 5px; -} - -div.content { - width: 99%; -} - -table.coverageStats { - width: 100%; - border-collapse: collapse; -} - -table.overallStats { - width: 20%; -} - -table.coverageStats td, table.coverageStats th { - padding: 4px 2px; - border-bottom: 1px solid #ccc; -} - -table.coverageStats th { - background-color: #959BA4; - border: none; - font-weight: bold; - text-align: left; - color: #FFF; -} - -table.coverageStats th.coverageStat { - width: 15%; -} - -table.coverageStats th a { - color: #FFF; -} - -table.coverageStats th a:hover { - text-decoration: none; -} - -table.coverageStats th.sortedDesc a { - background: url(../img/arrowDown.gif) no-repeat 100% 2px; - padding-right: 20px; -} - -table.coverageStats th.sortedAsc a { - background: url(../img/arrowUp.gif) no-repeat 100% 2px; - padding-right: 20px; -} - -div.footer { - margin: 2em .5em; - font-size: 85%; - text-align: left; - line-height: 140%; -} - -code.sourceCode { - width: 100%; - border: 1px solid #ccc; - font: normal 12px 'Menlo', 'Bitstream Vera Sans Mono', 'Courier New', 'Courier', monospace; - white-space: pre; -} - -code.sourceCode b { - font-weight: normal; -} - -code.sourceCode span.number { - color: #151515; -} - -code.sourceCode .fc { - background-color: #cfc; -} - -code.sourceCode .pc { - background-color: #ffc; -} - -code.sourceCode .nc { - background-color: #fcc; -} - -.percent, .absValue { - font-size: 90%; -} - -.percent .green, .absValue .green { - color: #32cc32; -} - -.percent .red, .absValue .red { - color: #f00; -} - -.percent .totalDiff { - color: #3f3f3f; -} diff --git a/htmlReport/css/idea.min.css b/htmlReport/css/idea.min.css deleted file mode 100644 index a8d5292..0000000 --- a/htmlReport/css/idea.min.css +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2000-2021 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* -Intellij Idea-like styling (c) Vasily Polovnyov -*/ - -.hljs { - color: #000; - background: #fff; -} - -.hljs-subst, -.hljs-title { - font-weight: normal; - color: #000; -} - -.hljs-comment, -.hljs-quote { - color: #808080; - font-style: italic; -} - -.hljs-meta { - color: #808000; -} - -.hljs-tag { - background: #efefef; -} - -.hljs-section, -.hljs-name, -.hljs-literal, -.hljs-keyword, -.hljs-selector-tag, -.hljs-type, -.hljs-selector-id, -.hljs-selector-class { - font-weight: bold; - color: #000080; -} - -.hljs-attribute, -.hljs-number, -.hljs-regexp, -.hljs-link { - font-weight: bold; - color: #0000ff; -} - -.hljs-number, -.hljs-regexp, -.hljs-link { - font-weight: normal; -} - -.hljs-string { - color: #008000; - font-weight: bold; -} - -.hljs-symbol, -.hljs-bullet, -.hljs-formula { - color: #000; - background: #d0eded; - font-style: italic; -} - -.hljs-doctag { - text-decoration: underline; -} - -.hljs-variable, -.hljs-template-variable { - color: #660e7a; -} - -.hljs-addition { - background: #baeeba; -} - -.hljs-deletion { - background: #ffc8bd; -} - -.hljs-emphasis { - font-style: italic; -} - -.hljs-strong { - font-weight: bold; -} - -.hljs-ln-numbers { - display: block; - float: left; - width: 3em; - border-right: 1px solid #ccc; - font-style: normal; - text-align: right; - background-color: #eee; -} diff --git a/htmlReport/img/arrowDown.gif b/htmlReport/img/arrowDown.gif deleted file mode 100644 index a4ac9b4b0f5eee9fc82deb7f03d0cc7f197b01c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmZ?wbhEHbv%yJ&P?))?G g5?!@7agD+*@rGjs@joUks8}}Ha%HfNHz$KN0Orjd82|tP diff --git a/htmlReport/img/arrowUp.gif b/htmlReport/img/arrowUp.gif deleted file mode 100644 index d488db0089f15409b83a6f39718384cac89ea3c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 91 zcmZ?wbhEHbv%nBa6?))=2 j#jeJ<$W6!S$=vG=3s*2Wu3C5I!M+a(XH6zEFjxZs9OxeQ diff --git a/htmlReport/index.html b/htmlReport/index.html deleted file mode 100644 index 9fa4185..0000000 --- a/htmlReport/index.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_BLOCK.html b/htmlReport/index_SORT_BY_BLOCK.html deleted file mode 100644 index ff1891b..0000000 --- a/htmlReport/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_BLOCK_DESC.html b/htmlReport/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 2a214af..0000000 --- a/htmlReport/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_CLASS.html b/htmlReport/index_SORT_BY_CLASS.html deleted file mode 100644 index bd408ce..0000000 --- a/htmlReport/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_CLASS_DESC.html b/htmlReport/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 4042177..0000000 --- a/htmlReport/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_LINE.html b/htmlReport/index_SORT_BY_LINE.html deleted file mode 100644 index 2977eaf..0000000 --- a/htmlReport/index_SORT_BY_LINE.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_LINE_DESC.html b/htmlReport/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index d965572..0000000 --- a/htmlReport/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_METHOD.html b/htmlReport/index_SORT_BY_METHOD.html deleted file mode 100644 index 7e76ca4..0000000 --- a/htmlReport/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_METHOD_DESC.html b/htmlReport/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 04609f9..0000000 --- a/htmlReport/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
-
- - - - - - - diff --git a/htmlReport/index_SORT_BY_NAME_DESC.html b/htmlReport/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index f6fcd61..0000000 --- a/htmlReport/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - - Coverage Report > Summary - - - - - - -
- - -

Overall Coverage Summary

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
all classes - - 78.6% - - - (22/28) - - - - 81.2% - - - (121/149) - - - - 83.1% - - - (255/307) - -
- -
-

Coverage Breakdown

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
-
- - - - - - - diff --git a/htmlReport/js/highlight.min.js b/htmlReport/js/highlight.min.js deleted file mode 100644 index e887315..0000000 --- a/htmlReport/js/highlight.min.js +++ /dev/null @@ -1,1388 +0,0 @@ -/* - Highlight.js 10.7.2 (00233d63) - License: BSD-3-Clause - Copyright (c) 2006-2021, Ivan Sagalaev - - BSD 3-Clause License - - Copyright (c) 2006-2021, Ivan Sagalaev. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -var hljs=function(){"use strict";function e(t){ -return t instanceof Map?t.clear=t.delete=t.set=()=>{ -throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{ -throw Error("set is read-only") -}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{var i=t[n] -;"object"!=typeof i||Object.isFrozen(i)||e(i)})),t}var t=e,n=e;t.default=n -;class i{constructor(e){ -void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} -ignoreMatch(){this.isMatchIgnored=!0}}function s(e){ -return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") -}function a(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] -;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const r=e=>!!e.kind -;class l{constructor(e,t){ -this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ -this.buffer+=s(e)}openNode(e){if(!r(e))return;let t=e.kind -;e.sublanguage||(t=`${this.classPrefix}${t}`),this.span(t)}closeNode(e){ -r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ -this.buffer+=``}}class o{constructor(){this.rootNode={ -children:[]},this.stack=[this.rootNode]}get top(){ -return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ -this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} -;this.add(t),this.stack.push(t)}closeNode(){ -if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ -for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} -walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ -return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), -t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ -"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ -o._collapse(e)})))}}class c extends o{constructor(e){super(),this.options=e} -addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} -addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root -;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ -return new l(this,this.options).value()}finalize(){return!0}}function g(e){ -return e?"string"==typeof e?e:e.source:null} -const u=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,h="[a-zA-Z]\\w*",d="[a-zA-Z_]\\w*",f="\\b\\d+(\\.\\d+)?",p="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",m="\\b(0b[01]+)",b={ -begin:"\\\\[\\s\\S]",relevance:0},E={className:"string",begin:"'",end:"'", -illegal:"\\n",contains:[b]},x={className:"string",begin:'"',end:'"', -illegal:"\\n",contains:[b]},v={ -begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ -},w=(e,t,n={})=>{const i=a({className:"comment",begin:e,end:t,contains:[]},n) -;return i.contains.push(v),i.contains.push({className:"doctag", -begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),i -},y=w("//","$"),N=w("/\\*","\\*/"),R=w("#","$");var _=Object.freeze({ -__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:h,UNDERSCORE_IDENT_RE:d, -NUMBER_RE:f,C_NUMBER_RE:p,BINARY_NUMBER_RE:m, -RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", -SHEBANG:(e={})=>{const t=/^#![ ]*\// -;return e.binary&&(e.begin=((...e)=>e.map((e=>g(e))).join(""))(t,/.*\b/,e.binary,/\b.*/)), -a({className:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{ -0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:b,APOS_STRING_MODE:E, -QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:v,COMMENT:w,C_LINE_COMMENT_MODE:y, -C_BLOCK_COMMENT_MODE:N,HASH_COMMENT_MODE:R,NUMBER_MODE:{className:"number", -begin:f,relevance:0},C_NUMBER_MODE:{className:"number",begin:p,relevance:0}, -BINARY_NUMBER_MODE:{className:"number",begin:m,relevance:0},CSS_NUMBER_MODE:{ -className:"number", -begin:f+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", -relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp", -begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[b,{begin:/\[/,end:/\]/, -relevance:0,contains:[b]}]}]},TITLE_MODE:{className:"title",begin:h,relevance:0 -},UNDERSCORE_TITLE_MODE:{className:"title",begin:d,relevance:0},METHOD_GUARD:{ -begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ -"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ -t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function k(e,t){ -"."===e.input[e.index-1]&&t.ignoreMatch()}function M(e,t){ -t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", -e.__beforeBegin=k,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, -void 0===e.relevance&&(e.relevance=0))}function O(e,t){ -Array.isArray(e.illegal)&&(e.illegal=((...e)=>"("+e.map((e=>g(e))).join("|")+")")(...e.illegal)) -}function A(e,t){if(e.match){ -if(e.begin||e.end)throw Error("begin & end are not supported with match") -;e.begin=e.match,delete e.match}}function L(e,t){ -void 0===e.relevance&&(e.relevance=1)} -const I=["of","and","for","in","not","or","if","then","parent","list","value"] -;function j(e,t,n="keyword"){const i={} -;return"string"==typeof e?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach((n=>{ -Object.assign(i,j(e[n],t,n))})),i;function s(e,n){ -t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") -;i[n[0]]=[e,B(n[0],n[1])]}))}}function B(e,t){ -return t?Number(t):(e=>I.includes(e.toLowerCase()))(e)?0:1} -function T(e,{plugins:t}){function n(t,n){ -return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))}class i{ -constructor(){ -this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} -addRule(e,t){ -t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), -this.matchAt+=(e=>RegExp(e.toString()+"|").exec("").length-1)(e)+1}compile(){ -0===this.regexes.length&&(this.exec=()=>null) -;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(((e,t="|")=>{let n=0 -;return e.map((e=>{n+=1;const t=n;let i=g(e),s="";for(;i.length>0;){ -const e=u.exec(i);if(!e){s+=i;break} -s+=i.substring(0,e.index),i=i.substring(e.index+e[0].length), -"\\"===e[0][0]&&e[1]?s+="\\"+(Number(e[1])+t):(s+=e[0],"("===e[0]&&n++)}return s -})).map((e=>`(${e})`)).join(t)})(e),!0),this.lastIndex=0}exec(e){ -this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e) -;if(!t)return null -;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] -;return t.splice(0,n),Object.assign(t,i)}}class s{constructor(){ -this.rules=[],this.multiRegexes=[], -this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ -if(this.multiRegexes[e])return this.multiRegexes[e];const t=new i -;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), -t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ -return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ -this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ -const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex -;let n=t.exec(e) -;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ -const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} -return n&&(this.regexIndex+=n.position+1, -this.regexIndex===this.count&&this.considerAll()),n}} -if(e.compilerExtensions||(e.compilerExtensions=[]), -e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") -;return e.classNameAliases=a(e.classNameAliases||{}),function t(i,r){const l=i -;if(i.isCompiled)return l -;[A].forEach((e=>e(i,r))),e.compilerExtensions.forEach((e=>e(i,r))), -i.__beforeBegin=null,[M,O,L].forEach((e=>e(i,r))),i.isCompiled=!0;let o=null -;if("object"==typeof i.keywords&&(o=i.keywords.$pattern, -delete i.keywords.$pattern), -i.keywords&&(i.keywords=j(i.keywords,e.case_insensitive)), -i.lexemes&&o)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ") -;return o=o||i.lexemes||/\w+/, -l.keywordPatternRe=n(o,!0),r&&(i.begin||(i.begin=/\B|\b/), -l.beginRe=n(i.begin),i.endSameAsBegin&&(i.end=i.begin), -i.end||i.endsWithParent||(i.end=/\B|\b/), -i.end&&(l.endRe=n(i.end)),l.terminatorEnd=g(i.end)||"", -i.endsWithParent&&r.terminatorEnd&&(l.terminatorEnd+=(i.end?"|":"")+r.terminatorEnd)), -i.illegal&&(l.illegalRe=n(i.illegal)), -i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>a(e,{ -variants:null},t)))),e.cachedVariants?e.cachedVariants:S(e)?a(e,{ -starts:e.starts?a(e.starts):null -}):Object.isFrozen(e)?a(e):e))("self"===e?i:e)))),i.contains.forEach((e=>{t(e,l) -})),i.starts&&t(i.starts,r),l.matcher=(e=>{const t=new s -;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" -}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" -}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(l),l}(e)}function S(e){ -return!!e&&(e.endsWithParent||S(e.starts))}function P(e){const t={ -props:["language","code","autodetect"],data:()=>({detectedLanguage:"", -unknownLanguage:!1}),computed:{className(){ -return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){ -if(!this.autoDetect&&!e.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`), -this.unknownLanguage=!0,s(this.code);let t={} -;return this.autoDetect?(t=e.highlightAuto(this.code), -this.detectedLanguage=t.language):(t=e.highlight(this.language,this.code,this.ignoreIllegals), -this.detectedLanguage=this.language),t.value},autoDetect(){ -return!(this.language&&(e=this.autodetect,!e&&""!==e));var e}, -ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{ -class:this.className,domProps:{innerHTML:this.highlighted}})])}};return{ -Component:t,VuePlugin:{install(e){e.component("highlightjs",t)}}}}const D={ -"after:highlightElement":({el:e,result:t,text:n})=>{const i=H(e) -;if(!i.length)return;const a=document.createElement("div") -;a.innerHTML=t.value,t.value=((e,t,n)=>{let i=0,a="";const r=[];function l(){ -return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function c(e){ -a+=""}function g(e){("start"===e.event?o:c)(e.node)} -for(;e.length||t.length;){let t=l() -;if(a+=s(n.substring(i,t[0].offset)),i=t[0].offset,t===e){r.reverse().forEach(c) -;do{g(t.splice(0,1)[0]),t=l()}while(t===e&&t.length&&t[0].offset===i) -;r.reverse().forEach(o) -}else"start"===t[0].event?r.push(t[0].node):r.pop(),g(t.splice(0,1)[0])} -return a+s(n.substr(i))})(i,H(a),n)}};function C(e){ -return e.nodeName.toLowerCase()}function H(e){const t=[];return function e(n,i){ -for(let s=n.firstChild;s;s=s.nextSibling)3===s.nodeType?i+=s.nodeValue.length:1===s.nodeType&&(t.push({ -event:"start",offset:i,node:s}),i=e(s,i),C(s).match(/br|hr|img|input/)||t.push({ -event:"stop",offset:i,node:s}));return i}(e,0),t}const $={},U=e=>{ -console.error(e)},z=(e,...t)=>{console.log("WARN: "+e,...t)},K=(e,t)=>{ -$[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),$[`${e}/${t}`]=!0) -},G=s,V=a,W=Symbol("nomatch");return(e=>{ -const n=Object.create(null),s=Object.create(null),a=[];let r=!0 -;const l=/(^(<[^>]+>|\t|)+|\n)/gm,o="Could not find the language '{}', did you forget to load/include a language module?",g={ -disableAutodetect:!0,name:"Plain text",contains:[]};let u={ -noHighlightRe:/^(no-?highlight)$/i, -languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", -tabReplace:null,useBR:!1,languages:null,__emitter:c};function h(e){ -return u.noHighlightRe.test(e)}function d(e,t,n,i){let s="",a="" -;"object"==typeof t?(s=e, -n=t.ignoreIllegals,a=t.language,i=void 0):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."), -K("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), -a=e,s=t);const r={code:s,language:a};M("before:highlight",r) -;const l=r.result?r.result:f(r.language,r.code,n,i) -;return l.code=r.code,M("after:highlight",l),l}function f(e,t,s,l){ -function c(e,t){const n=v.case_insensitive?t[0].toLowerCase():t[0] -;return Object.prototype.hasOwnProperty.call(e.keywords,n)&&e.keywords[n]} -function g(){null!=R.subLanguage?(()=>{if(""===M)return;let e=null -;if("string"==typeof R.subLanguage){ -if(!n[R.subLanguage])return void k.addText(M) -;e=f(R.subLanguage,M,!0,_[R.subLanguage]),_[R.subLanguage]=e.top -}else e=p(M,R.subLanguage.length?R.subLanguage:null) -;R.relevance>0&&(O+=e.relevance),k.addSublanguage(e.emitter,e.language) -})():(()=>{if(!R.keywords)return void k.addText(M);let e=0 -;R.keywordPatternRe.lastIndex=0;let t=R.keywordPatternRe.exec(M),n="";for(;t;){ -n+=M.substring(e,t.index);const i=c(R,t);if(i){const[e,s]=i -;if(k.addText(n),n="",O+=s,e.startsWith("_"))n+=t[0];else{ -const n=v.classNameAliases[e]||e;k.addKeyword(t[0],n)}}else n+=t[0] -;e=R.keywordPatternRe.lastIndex,t=R.keywordPatternRe.exec(M)} -n+=M.substr(e),k.addText(n)})(),M=""}function h(e){ -return e.className&&k.openNode(v.classNameAliases[e.className]||e.className), -R=Object.create(e,{parent:{value:R}}),R}function d(e,t,n){let s=((e,t)=>{ -const n=e&&e.exec(t);return n&&0===n.index})(e.endRe,n);if(s){if(e["on:end"]){ -const n=new i(e);e["on:end"](t,n),n.isMatchIgnored&&(s=!1)}if(s){ -for(;e.endsParent&&e.parent;)e=e.parent;return e}} -if(e.endsWithParent)return d(e.parent,t,n)}function m(e){ -return 0===R.matcher.regexIndex?(M+=e[0],1):(I=!0,0)}function b(e){ -const n=e[0],i=t.substr(e.index),s=d(R,e,i);if(!s)return W;const a=R -;a.skip?M+=n:(a.returnEnd||a.excludeEnd||(M+=n),g(),a.excludeEnd&&(M=n));do{ -R.className&&k.closeNode(),R.skip||R.subLanguage||(O+=R.relevance),R=R.parent -}while(R!==s.parent) -;return s.starts&&(s.endSameAsBegin&&(s.starts.endRe=s.endRe), -h(s.starts)),a.returnEnd?0:n.length}let E={};function x(n,a){const l=a&&a[0] -;if(M+=n,null==l)return g(),0 -;if("begin"===E.type&&"end"===a.type&&E.index===a.index&&""===l){ -if(M+=t.slice(a.index,a.index+1),!r){const t=Error("0 width match regex") -;throw t.languageName=e,t.badRule=E.rule,t}return 1} -if(E=a,"begin"===a.type)return function(e){ -const t=e[0],n=e.rule,s=new i(n),a=[n.__beforeBegin,n["on:begin"]] -;for(const n of a)if(n&&(n(e,s),s.isMatchIgnored))return m(t) -;return n&&n.endSameAsBegin&&(n.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")), -n.skip?M+=t:(n.excludeBegin&&(M+=t), -g(),n.returnBegin||n.excludeBegin||(M=t)),h(n),n.returnBegin?0:t.length}(a) -;if("illegal"===a.type&&!s){ -const e=Error('Illegal lexeme "'+l+'" for mode "'+(R.className||"")+'"') -;throw e.mode=R,e}if("end"===a.type){const e=b(a);if(e!==W)return e} -if("illegal"===a.type&&""===l)return 1 -;if(L>1e5&&L>3*a.index)throw Error("potential infinite loop, way more iterations than matches") -;return M+=l,l.length}const v=N(e) -;if(!v)throw U(o.replace("{}",e)),Error('Unknown language: "'+e+'"') -;const w=T(v,{plugins:a});let y="",R=l||w;const _={},k=new u.__emitter(u);(()=>{ -const e=[];for(let t=R;t!==v;t=t.parent)t.className&&e.unshift(t.className) -;e.forEach((e=>k.openNode(e)))})();let M="",O=0,A=0,L=0,I=!1;try{ -for(R.matcher.considerAll();;){ -L++,I?I=!1:R.matcher.considerAll(),R.matcher.lastIndex=A -;const e=R.matcher.exec(t);if(!e)break;const n=x(t.substring(A,e.index),e) -;A=e.index+n}return x(t.substr(A)),k.closeAllNodes(),k.finalize(),y=k.toHTML(),{ -relevance:Math.floor(O),value:y,language:e,illegal:!1,emitter:k,top:R}}catch(n){ -if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{ -msg:n.message,context:t.slice(A-100,A+100),mode:n.mode},sofar:y,relevance:0, -value:G(t),emitter:k};if(r)return{illegal:!1,relevance:0,value:G(t),emitter:k, -language:e,top:R,errorRaised:n};throw n}}function p(e,t){ -t=t||u.languages||Object.keys(n);const i=(e=>{const t={relevance:0, -emitter:new u.__emitter(u),value:G(e),illegal:!1,top:g} -;return t.emitter.addText(e),t})(e),s=t.filter(N).filter(k).map((t=>f(t,e,!1))) -;s.unshift(i);const a=s.sort(((e,t)=>{ -if(e.relevance!==t.relevance)return t.relevance-e.relevance -;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1 -;if(N(t.language).supersetOf===e.language)return-1}return 0})),[r,l]=a,o=r -;return o.second_best=l,o}const m={"before:highlightElement":({el:e})=>{ -u.useBR&&(e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")) -},"after:highlightElement":({result:e})=>{ -u.useBR&&(e.value=e.value.replace(/\n/g,"
"))}},b=/^(<[^>]+>|\t)+/gm,E={ -"after:highlightElement":({result:e})=>{ -u.tabReplace&&(e.value=e.value.replace(b,(e=>e.replace(/\t/g,u.tabReplace))))}} -;function x(e){let t=null;const n=(e=>{let t=e.className+" " -;t+=e.parentNode?e.parentNode.className:"";const n=u.languageDetectRe.exec(t) -;if(n){const t=N(n[1]) -;return t||(z(o.replace("{}",n[1])),z("Falling back to no-highlight mode for this block.",e)), -t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>h(e)||N(e)))})(e) -;if(h(n))return;M("before:highlightElement",{el:e,language:n}),t=e -;const i=t.textContent,a=n?d(i,{language:n,ignoreIllegals:!0}):p(i) -;M("after:highlightElement",{el:e,result:a,text:i -}),e.innerHTML=a.value,((e,t,n)=>{const i=t?s[t]:n -;e.classList.add("hljs"),i&&e.classList.add(i)})(e,n,a.language),e.result={ -language:a.language,re:a.relevance,relavance:a.relevance -},a.second_best&&(e.second_best={language:a.second_best.language, -re:a.second_best.relevance,relavance:a.second_best.relevance})}const v=()=>{ -v.called||(v.called=!0, -K("10.6.0","initHighlighting() is deprecated. Use highlightAll() instead."), -document.querySelectorAll("pre code").forEach(x))};let w=!1;function y(){ -"loading"!==document.readyState?document.querySelectorAll("pre code").forEach(x):w=!0 -}function N(e){return e=(e||"").toLowerCase(),n[e]||n[s[e]]} -function R(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ -s[e.toLowerCase()]=t}))}function k(e){const t=N(e) -;return t&&!t.disableAutodetect}function M(e,t){const n=e;a.forEach((e=>{ -e[n]&&e[n](t)}))} -"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ -w&&y()}),!1),Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:y, -fixMarkup:e=>{ -return K("10.2.0","fixMarkup will be removed entirely in v11.0"),K("10.2.0","Please see https://github.com/highlightjs/highlight.js/issues/2534"), -t=e, -u.tabReplace||u.useBR?t.replace(l,(e=>"\n"===e?u.useBR?"
":e:u.tabReplace?e.replace(/\t/g,u.tabReplace):e)):t -;var t},highlightElement:x, -highlightBlock:e=>(K("10.7.0","highlightBlock will be removed entirely in v12.0"), -K("10.7.0","Please use highlightElement now."),x(e)),configure:e=>{ -e.useBR&&(K("10.3.0","'useBR' will be removed entirely in v11.0"), -K("10.3.0","Please see https://github.com/highlightjs/highlight.js/issues/2559")), -u=V(u,e)},initHighlighting:v,initHighlightingOnLoad:()=>{ -K("10.6.0","initHighlightingOnLoad() is deprecated. Use highlightAll() instead."), -w=!0},registerLanguage:(t,i)=>{let s=null;try{s=i(e)}catch(e){ -if(U("Language definition for '{}' could not be registered.".replace("{}",t)), -!r)throw e;U(e),s=g} -s.name||(s.name=t),n[t]=s,s.rawDefinition=i.bind(null,e),s.aliases&&R(s.aliases,{ -languageName:t})},unregisterLanguage:e=>{delete n[e] -;for(const t of Object.keys(s))s[t]===e&&delete s[t]}, -listLanguages:()=>Object.keys(n),getLanguage:N,registerAliases:R, -requireLanguage:e=>{ -K("10.4.0","requireLanguage will be removed entirely in v11."), -K("10.4.0","Please see https://github.com/highlightjs/highlight.js/pull/2844") -;const t=N(e);if(t)return t -;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))}, -autoDetection:k,inherit:V,addPlugin:e=>{(e=>{ -e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ -e["before:highlightBlock"](Object.assign({block:t.el},t)) -}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ -e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),a.push(e)}, -vuePlugin:P(e).VuePlugin}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0 -},e.versionString="10.7.2";for(const e in _)"object"==typeof _[e]&&t(_[e]) -;return Object.assign(e,_),e.addPlugin(m),e.addPlugin(D),e.addPlugin(E),e})({}) -}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); -hljs.registerLanguage("apache",(()=>{"use strict";return e=>{const n={ -className:"number",begin:/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/} -;return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0, -contains:[e.HASH_COMMENT_MODE,{className:"section",begin:/<\/?/,end:/>/, -contains:[n,{className:"number",begin:/:\d{1,5}/ -},e.inherit(e.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute", -begin:/\w+/,relevance:0,keywords:{ -nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername" -},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"}, -contains:[{className:"meta",begin:/\s\[/,end:/\]$/},{className:"variable", -begin:/[\$%]\{/,end:/\}/,contains:["self",{className:"number",begin:/[$%]\d+/}] -},n,{className:"number",begin:/\d+/},e.QUOTE_STRING_MODE]}}],illegal:/\S/}} -})()); -hljs.registerLanguage("bash",(()=>{"use strict";function e(...e){ -return e.map((e=>{return(s=e)?"string"==typeof s?s:s.source:null;var s -})).join("")}return s=>{const n={},t={begin:/\$\{/,end:/\}/,contains:["self",{ -begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{ -begin:e(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},t]});const a={ -className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},i={ -begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/, -end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, -contains:[s.BACKSLASH_ESCAPE,n,a]};a.contains.push(c);const o={begin:/\$\(\(/, -end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,n] -},r=s.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 -}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, -contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ -name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z._-]+\b/, -keyword:"if then else elif fi for while in do done case esac function", -literal:"true false", -built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp" -},contains:[r,s.SHEBANG(),l,o,s.HASH_COMMENT_MODE,i,c,{className:"",begin:/\\"/ -},{className:"string",begin:/'/,end:/'/},n]}}})()); -hljs.registerLanguage("c",(()=>{"use strict";function e(e){ -return((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(",e,")?") -}return t=>{const n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}] -}),r="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+e(r)+"[a-zA-Z_]\\w*"+e("<[^<>]+>")+")",i={ -className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string", -variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n", -contains:[t.BACKSLASH_ESCAPE]},{ -begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", -end:"'",illegal:"."},t.END_SAME_AS_BEGIN({ -begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ -className:"number",variants:[{begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" -},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ -"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" -},contains:[{begin:/\\\n/,relevance:0},t.inherit(s,{className:"meta-string"}),{ -className:"meta-string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},l={ -className:"title",begin:e(r)+t.IDENT_RE,relevance:0 -},d=e(r)+t.IDENT_RE+"\\s*\\(",u={ -keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq", -built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary", -literal:"true false nullptr NULL"},m=[c,i,n,t.C_BLOCK_COMMENT_MODE,o,s],p={ -variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{ -beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:m.concat([{ -begin:/\(/,end:/\)/,keywords:u,contains:m.concat(["self"]),relevance:0}]), -relevance:0},_={className:"function",begin:"("+a+"[\\*&\\s]+)+"+d, -returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/, -contains:[{begin:"decltype\\(auto\\)",keywords:u,relevance:0},{begin:d, -returnBegin:!0,contains:[l],relevance:0},{className:"params",begin:/\(/, -end:/\)/,keywords:u,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,s,o,i,{ -begin:/\(/,end:/\)/,keywords:u,relevance:0, -contains:["self",n,t.C_BLOCK_COMMENT_MODE,s,o,i]}] -},i,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u, -disableAutodetect:!0,illegal:"",keywords:u,contains:["self",i]},{begin:t.IDENT_RE+"::",keywords:u},{ -className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/, -contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{ -preprocessor:c,strings:s,keywords:u}}}})()); -hljs.registerLanguage("coffeescript",(()=>{"use strict" -;const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) -;return r=>{const t={ -keyword:e.concat(["then","unless","until","loop","by","when","and","or","is","isnt","not"]).filter((i=["var","const","let","function","static"], -e=>!i.includes(e))),literal:n.concat(["yes","no","on","off"]), -built_in:a.concat(["npm","print"])};var i;const s="[A-Za-z$_][0-9A-Za-z$_]*",o={ -className:"subst",begin:/#\{/,end:/\}/,keywords:t -},c=[r.BINARY_NUMBER_MODE,r.inherit(r.C_NUMBER_MODE,{starts:{end:"(\\s*/)?", -relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/, -contains:[r.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[r.BACKSLASH_ESCAPE] -},{begin:/"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,o]},{begin:/"/,end:/"/, -contains:[r.BACKSLASH_ESCAPE,o]}]},{className:"regexp",variants:[{begin:"///", -end:"///",contains:[o,r.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)", -relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+s -},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{ -begin:"```",end:"```"},{begin:"`",end:"`"}]}];o.contains=c -;const l=r.inherit(r.TITLE_MODE,{begin:s}),d="(\\(.*\\)\\s*)?\\B[-=]>",g={ -className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/, -end:/\)/,keywords:t,contains:["self"].concat(c)}]};return{name:"CoffeeScript", -aliases:["coffee","cson","iced"],keywords:t,illegal:/\/\*/, -contains:c.concat([r.COMMENT("###","###"),r.HASH_COMMENT_MODE,{ -className:"function",begin:"^\\s*"+s+"\\s*=\\s*"+d,end:"[-=]>",returnBegin:!0, -contains:[l,g]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function", -begin:d,end:"[-=]>",returnBegin:!0,contains:[g]}]},{className:"class", -beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{ -beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[l]},l] -},{begin:s+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}})()); -hljs.registerLanguage("cpp",(()=>{"use strict";function e(e){ -return t("(",e,")?")}function t(...e){return e.map((e=>{ -return(t=e)?"string"==typeof t?t:t.source:null;var t})).join("")}return n=>{ -const r=n.COMMENT("//","$",{contains:[{begin:/\\\n/}] -}),a="[a-zA-Z_]\\w*::",i="(decltype\\(auto\\)|"+e(a)+"[a-zA-Z_]\\w*"+e("<[^<>]+>")+")",s={ -className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string", -variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n", -contains:[n.BACKSLASH_ESCAPE]},{ -begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", -end:"'",illegal:"."},n.END_SAME_AS_BEGIN({ -begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ -className:"number",variants:[{begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" -},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ -"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" -},contains:[{begin:/\\\n/,relevance:0},n.inherit(c,{className:"meta-string"}),{ -className:"meta-string",begin:/<.*?>/},r,n.C_BLOCK_COMMENT_MODE]},d={ -className:"title",begin:e(a)+n.IDENT_RE,relevance:0 -},u=e(a)+n.IDENT_RE+"\\s*\\(",m={ -keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq", -built_in:"_Bool _Complex _Imaginary", -_relevance_hints:["asin","atan2","atan","calloc","ceil","cosh","cos","exit","exp","fabs","floor","fmod","fprintf","fputs","free","frexp","auto_ptr","deque","list","queue","stack","vector","map","set","pair","bitset","multiset","multimap","unordered_set","fscanf","future","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","tolower","toupper","labs","ldexp","log10","log","malloc","realloc","memchr","memcmp","memcpy","memset","modf","pow","printf","putchar","puts","scanf","sinh","sin","snprintf","sprintf","sqrt","sscanf","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","tanh","tan","unordered_map","unordered_multiset","unordered_multimap","priority_queue","make_pair","array","shared_ptr","abort","terminate","abs","acos","vfprintf","vprintf","vsprintf","endl","initializer_list","unique_ptr","complex","imaginary","std","string","wstring","cin","cout","cerr","clog","stdin","stdout","stderr","stringstream","istringstream","ostringstream"], -literal:"true false nullptr NULL"},p={className:"function.dispatch",relevance:0, -keywords:m, -begin:t(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,n.IDENT_RE,(_=/\s*\(/, -t("(?=",_,")")))};var _;const g=[p,l,s,r,n.C_BLOCK_COMMENT_MODE,o,c],b={ -variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{ -beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:g.concat([{ -begin:/\(/,end:/\)/,keywords:m,contains:g.concat(["self"]),relevance:0}]), -relevance:0},f={className:"function",begin:"("+i+"[\\*&\\s]+)+"+u, -returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/, -contains:[{begin:"decltype\\(auto\\)",keywords:m,relevance:0},{begin:u, -returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/, -endsWithParent:!0,contains:[c,o]},{className:"params",begin:/\(/,end:/\)/, -keywords:m,relevance:0,contains:[r,n.C_BLOCK_COMMENT_MODE,c,o,s,{begin:/\(/, -end:/\)/,keywords:m,relevance:0,contains:["self",r,n.C_BLOCK_COMMENT_MODE,c,o,s] -}]},s,r,n.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", -aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:m,illegal:"",keywords:m,contains:["self",s]},{begin:n.IDENT_RE+"::",keywords:m},{ -className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/, -contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{ -preprocessor:l,strings:c,keywords:m}}}})()); -hljs.registerLanguage("csharp",(()=>{"use strict";return e=>{const n={ -keyword:["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), -built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], -literal:["default","false","null","true"]},a=e.inherit(e.TITLE_MODE,{ -begin:"[a-zA-Z](\\.?\\w)*"}),i={className:"number",variants:[{ -begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] -},t=e.inherit(s,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/, -keywords:n},l=e.inherit(r,{illegal:/\n/}),c={className:"string",begin:/\$"/, -end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ -},e.BACKSLASH_ESCAPE,l]},o={className:"string",begin:/\$@"/,end:'"',contains:[{ -begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},d=e.inherit(o,{illegal:/\n/, -contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]}) -;r.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.C_BLOCK_COMMENT_MODE], -l.contains=[d,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,e.inherit(e.C_BLOCK_COMMENT_MODE,{ -illegal:/\n/})];const g={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},a] -},_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={ -begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], -keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, -contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ -begin:"\x3c!--|--\x3e"},{begin:""}]}] -}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", -end:"$",keywords:{ -"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum" -}},g,i,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, -illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" -},a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", -relevance:0,end:/[{;=]/,illegal:/[^\s:]/, -contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ -beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, -contains:[a,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", -begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ -className:"meta-string",begin:/"/,end:/"/}]},{ -beginKeywords:"new return throw await else",relevance:0},{className:"function", -begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, -end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ -beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", -relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, -contains:[e.TITLE_MODE,E],relevance:0},{className:"params",begin:/\(/,end:/\)/, -excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, -contains:[g,i,e.C_BLOCK_COMMENT_MODE] -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}})()); -hljs.registerLanguage("css",(()=>{"use strict" -;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse() -;return n=>{const a=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, -HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, -ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, -illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} -}))(n),l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS", -case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"}, -classNameAliases:{keyframePosition:"selector-tag"}, -contains:[n.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ -},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 -},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 -},a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ -begin:":("+i.join("|")+")"},{begin:"::("+o.join("|")+")"}]},{ -className:"attribute",begin:"\\b("+r.join("|")+")\\b"},{begin:":",end:"[;}]", -contains:[a.HEXCOLOR,a.IMPORTANT,n.CSS_NUMBER_MODE,...l,{ -begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" -},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] -},{className:"built_in",begin:/[\w-]+(?=\()/}]},{ -begin:(s=/@/,((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(?=",s,")")), -end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword", -begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0, -relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only", -attribute:t.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute" -},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag", -begin:"\\b("+e.join("|")+")\\b"}]};var s}})()); -hljs.registerLanguage("diff",(()=>{"use strict";return e=>({name:"Diff", -aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{ -begin:/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{ -begin:/^--- +\d+,\d+ +----$/}]},{className:"comment",variants:[{begin:/Index: /, -end:/$/},{begin:/^index/,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^-{3}/,end:/$/ -},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/},{ -begin:/^diff --git/,end:/$/}]},{className:"addition",begin:/^\+/,end:/$/},{ -className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, -end:/$/}]})})()); -hljs.registerLanguage("go",(()=>{"use strict";return e=>{const n={ -keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune", -literal:"true false iota nil", -built_in:"append cap close complex copy imag len make new panic print println real recover delete" -};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{"use strict";function e(...e){ -return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n -})).join("")}return n=>{const a="HTTP/(2|1\\.[01])",s={className:"attribute", -begin:e("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{ -className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]} -},t=[s,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{ -name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})", -end:/$/,contains:[{className:"meta",begin:a},{className:"number", -begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:t}},{ -begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string", -begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{ -className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:t} -},n.inherit(s,{relevance:0})]}}})()); -hljs.registerLanguage("ini",(()=>{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function n(...n){ -return n.map((n=>e(n))).join("")}return s=>{const a={className:"number", -relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:s.NUMBER_RE}] -},i=s.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const t={ -className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/ -}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={ -className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:"'''", -end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"' -},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,a,"self"], -relevance:0 -},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map((n=>e(n))).join("|")+")" -;return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, -contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{ -begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr", -starts:{end:/$/,contains:[i,c,r,t,l,a]}}]}}})()); -hljs.registerLanguage("java",(()=>{"use strict" -;var e="\\.([0-9](_*[0-9])*)",n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={ -className:"number",variants:[{ -begin:`(\\b([0-9](_*[0-9])*)((${e})|\\.)?|(${e}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:`\\b([0-9](_*[0-9])*)((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ -begin:`(${e})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ -begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{ -begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], -relevance:0};return e=>{ -var n="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s={ -className:"meta",begin:"@[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*", -contains:[{begin:/\(/,end:/\)/,contains:["self"]}]};const r=a;return{ -name:"Java",aliases:["jsp"],keywords:n,illegal:/<\/|#/, -contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, -relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ -begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ -className:"class",beginKeywords:"class interface enum",end:/[{;=]/, -excludeEnd:!0,relevance:1,keywords:"class interface enum",illegal:/[:"\[\]]/, -contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ -beginKeywords:"new throw return else",relevance:0},{className:"class", -begin:"record\\s+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,excludeEnd:!0, -end:/[{;=]/,keywords:n,contains:[{beginKeywords:"record"},{ -begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, -contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/, -keywords:n,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE] -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"function", -begin:"([\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(<[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(\\s*,\\s*[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(", -returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:n,contains:[{ -begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, -contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/, -keywords:n,relevance:0, -contains:[s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE] -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},r,s]}}})()); -hljs.registerLanguage("javascript",(()=>{"use strict" -;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],s=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) -;function r(e){return t("(?=",e,")")}function t(...e){return e.map((e=>{ -return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return i=>{ -const c=e,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/, -isTrulyOpeningTag:(e,n)=>{const a=e[0].length+e.index,s=e.input[a] -;"<"!==s?">"===s&&(((e,{after:n})=>{const a="", -returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{ -begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0 -},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:f}]}] -},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{ -variants:[{begin:"<>",end:""},{begin:o.begin,"on:begin":o.isTrulyOpeningTag, -end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0, -contains:["self"]}]}],relevance:0},{className:"function", -beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:l, -contains:["self",i.inherit(i.TITLE_MODE,{begin:c}),p],illegal:/%/},{ -beginKeywords:"while if switch catch for"},{className:"function", -begin:i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", -returnBegin:!0,contains:[p,i.inherit(i.TITLE_MODE,{begin:c})]},{variants:[{ -begin:"\\."+c},{begin:"\\$"+c}],relevance:0},{className:"class", -beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{ -beginKeywords:"extends"},i.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/, -end:/[{;]/,excludeEnd:!0,contains:[i.inherit(i.TITLE_MODE,{begin:c}),"self",p] -},{begin:"(get|set)\\s+(?="+c+"\\()",end:/\{/,keywords:"get set", -contains:[i.inherit(i.TITLE_MODE,{begin:c}),{begin:/\(\)/},p]},{begin:/\$[(.]/}] -}}})()); -hljs.registerLanguage("json",(()=>{"use strict";return n=>{const e={ -literal:"true false null" -},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],a=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],l={ -end:",",endsWithParent:!0,excludeEnd:!0,contains:a,keywords:e},t={begin:/\{/, -end:/\}/,contains:[{className:"attr",begin:/"/,end:/"/, -contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(l,{begin:/:/ -})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(l)], -illegal:"\\S"};return a.push(t,s),i.forEach((n=>{a.push(n)})),{name:"JSON", -contains:a,keywords:e,illegal:"\\S"}}})()); -hljs.registerLanguage("kotlin",(()=>{"use strict" -;var e="\\.([0-9](_*[0-9])*)",n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={ -className:"number",variants:[{ -begin:`(\\b([0-9](_*[0-9])*)((${e})|\\.)?|(${e}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:`\\b([0-9](_*[0-9])*)((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ -begin:`(${e})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ -begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{ -begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], -relevance:0};return e=>{const n={ -keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", -built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", -literal:"true false null"},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" -},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},t={ -className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", -variants:[{begin:'"""',end:'"""(?=[^"])',contains:[t,s]},{begin:"'",end:"'", -illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, -contains:[e.BACKSLASH_ESCAPE,t,s]}]};s.contains.push(r);const l={ -className:"meta", -begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" -},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, -end:/\)/,contains:[e.inherit(r,{className:"meta-string"})]}] -},o=a,b=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),E={ -variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, -contains:[]}]},d=E;return d.variants[1].contains=[E],E.variants[1].contains=[d], -{name:"Kotlin",aliases:["kt","kts"],keywords:n, -contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", -begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,b,{className:"keyword", -begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", -begin:/@\w+/}]}},i,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$", -returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ -begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, -contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, -keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, -endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, -endsWithParent:!0,contains:[E,e.C_LINE_COMMENT_MODE,b],relevance:0 -},e.C_LINE_COMMENT_MODE,b,l,c,r,e.C_NUMBER_MODE]},b]},{className:"class", -beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, -illegal:"extends implements",contains:[{ -beginKeywords:"public protected internal private constructor" -},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, -excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/, -excludeBegin:!0,returnEnd:!0},l,c]},r,{className:"meta",begin:"^#!/usr/bin/env", -end:"$",illegal:"\n"},o]}}})()); -hljs.registerLanguage("less",(()=>{"use strict" -;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],n=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),r=i.concat(o) -;return a=>{const s=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, -HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, -ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, -illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} -}))(a),l=r,d="([\\w-]+|@\\{[\\w-]+\\})",c=[],g=[],b=e=>({className:"string", -begin:"~?"+e+".*?"+e}),m=(e,t,i)=>({className:e,begin:t,relevance:i}),u={ -$pattern:/[a-z-]+/,keyword:"and or not only",attribute:t.join(" ")},p={ -begin:"\\(",end:"\\)",contains:g,keywords:u,relevance:0} -;g.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,b("'"),b('"'),a.CSS_NUMBER_MODE,{ -begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", -excludeEnd:!0} -},s.HEXCOLOR,p,m("variable","@@?[\\w-]+",10),m("variable","@\\{[\\w-]+\\}"),m("built_in","~?`[^`]*?`"),{ -className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 -},s.IMPORTANT);const f=g.concat({begin:/\{/,end:/\}/,contains:c}),h={ -beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not" -}].concat(g)},w={begin:d+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0, -contains:[{begin:/-(webkit|moz|ms|o)-/},{className:"attribute", -begin:"\\b("+n.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0, -illegal:"[<=$]",relevance:0,contains:g}}]},v={className:"keyword", -begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", -starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:g,relevance:0}},y={ -className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ -begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:f}},k={variants:[{ -begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:d,end:/\{/}],returnBegin:!0, -returnEnd:!0,illegal:"[<='$\"]",relevance:0, -contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,h,m("keyword","all\\b"),m("variable","@\\{[\\w-]+\\}"),{ -begin:"\\b("+e.join("|")+")\\b",className:"selector-tag" -},m("selector-tag",d+"%?",0),m("selector-id","#"+d),m("selector-class","\\."+d,0),m("selector-tag","&",0),s.ATTRIBUTE_SELECTOR_MODE,{ -className:"selector-pseudo",begin:":("+i.join("|")+")"},{ -className:"selector-pseudo",begin:"::("+o.join("|")+")"},{begin:"\\(",end:"\\)", -contains:f},{begin:"!important"}]},E={begin:`[\\w-]+:(:)?(${l.join("|")})`, -returnBegin:!0,contains:[k]} -;return c.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,v,y,E,w,k),{ -name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:c}}})()); -hljs.registerLanguage("lua",(()=>{"use strict";return e=>{ -const t="\\[=*\\[",a="\\]=*\\]",n={begin:t,end:a,contains:["self"] -},o=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",a,{contains:[n], -relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, -literal:"true false nil", -keyword:"and break do else elseif end for goto if in local not or repeat return then until while", -built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" -},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)", -contains:[e.inherit(e.TITLE_MODE,{ -begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", -begin:"\\(",endsWithParent:!0,contains:o}].concat(o) -},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", -begin:t,end:a,contains:[n],relevance:5}])}}})()); -hljs.registerLanguage("makefile",(()=>{"use strict";return e=>{const i={ -className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", -contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function n(e){return a("(?=",e,")")} -function a(...n){return n.map((n=>e(n))).join("")}function s(...n){ -return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ -const t=a(/[A-Z_]/,a("(",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),i={ -className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/, -contains:[{className:"meta-keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] -},c=e.inherit(r,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{ -className:"meta-string"}),g=e.inherit(e.QUOTE_STRING_MODE,{ -className:"meta-string"}),m={endsWithParent:!0,illegal:/`]+/}]}] -}]};return{name:"HTML, XML", -aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], -case_insensitive:!0,contains:[{className:"meta",begin://, -relevance:10,contains:[r,g,l,c,{begin:/\[/,end:/\]/,contains:[{className:"meta", -begin://,contains:[r,c,g,l]}]}]},e.COMMENT(//,{ -relevance:10}),{begin://,relevance:10},i,{ -className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag", -begin:/)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{ -end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", -begin:/)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{ -end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ -className:"tag",begin:/<>|<\/>/},{className:"tag", -begin:a(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name", -begin:t,relevance:0,starts:m}]},{className:"tag",begin:a(/<\//,n(a(t,/>/))), -contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0, -endsParent:!0}]}]}}})()); -hljs.registerLanguage("markdown",(()=>{"use strict";function n(...n){ -return n.map((n=>{return(e=n)?"string"==typeof e?e:e.source:null;var e -})).join("")}return e=>{const a={begin:/<\/?[A-Za-z_]/,end:">", -subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0 -},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, -relevance:2},{begin:n(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), -relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ -begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{ -className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, -returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", -excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", -end:"\\]",excludeBegin:!0,excludeEnd:!0}]},s={className:"strong",contains:[], -variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},c={ -className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ -begin:/_(?!_)/,end:/_/,relevance:0}]};s.contains.push(c),c.contains.push(s) -;let t=[a,i] -;return s.contains=s.contains.concat(t),c.contains=c.contains.concat(t), -t=t.concat(s,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ -className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:t},{ -begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", -contains:t}]}]},a,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", -end:"\\s+",excludeEnd:!0},s,c,{className:"quote",begin:"^>\\s+",contains:t, -end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ -begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ -begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", -contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ -begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ -className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ -className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})()); -hljs.registerLanguage("nginx",(()=>{"use strict";return e=>{const n={ -className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/\}/},{ -begin:/[$@]/+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,keywords:{ -$pattern:"[a-z/_]+", -literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll" -},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string", -contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/ -}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n] -},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^", -end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{ -begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number", -begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{ -className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{ -name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{ -begin:e.UNDERSCORE_IDENT_RE+"\\s+\\{",returnBegin:!0,end:/\{/,contains:[{ -className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{ -begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|\\{",returnBegin:!0,contains:[{ -className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}], -illegal:"[^\\s\\}]"}}})()); -hljs.registerLanguage("objectivec",(()=>{"use strict";return e=>{ -const n=/[a-zA-Z@][a-zA-Z0-9_]*/,_={$pattern:n, -keyword:"@interface @class @protocol @implementation"};return{ -name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], -keywords:{$pattern:n, -keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN", -literal:"false true FALSE TRUE nil YES NO NULL", -built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once" -},illegal:"/,end:/$/, -illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ -className:"class",begin:"("+_.keyword.split(" ").join("|")+")\\b",end:/(\{|$)/, -excludeEnd:!0,keywords:_,contains:[e.UNDERSCORE_TITLE_MODE]},{ -begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}})()); -hljs.registerLanguage("perl",(()=>{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function n(...n){ -return n.map((n=>e(n))).join("")}function t(...n){ -return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ -const r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/, -keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" -},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/, -end:/\}/},o={variants:[{begin:/\$\d/},{ -begin:n(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") -},{begin:/[$%@][^\s\w{]/,relevance:0}] -},c=[e.BACKSLASH_ESCAPE,i,o],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],l=(e,t,s="\\1")=>{ -const i="\\1"===s?s:n(s,t) -;return n(n("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,s,r) -},d=(e,t,s)=>n(n("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,s,r),p=[o,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ -endsWithParent:!0}),a,{className:"string",contains:c,variants:[{ -begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", -end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ -begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", -relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", -contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", -contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ -begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", -begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", -relevance:0},{ -begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", -keywords:"split return print reverse grep",relevance:0, -contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ -begin:l("s|tr|y",t(...g))},{begin:l("s|tr|y","\\(","\\)")},{ -begin:l("s|tr|y","\\[","\\]")},{begin:l("s|tr|y","\\{","\\}")}],relevance:2},{ -className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ -begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t(...g),/\1/)},{ -begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ -begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", -end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ -begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", -subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] -}];return i.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:s, -contains:p}}})()); -hljs.registerLanguage("php",(()=>{"use strict";return e=>{const r={ -className:"variable", -begin:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?![A-Za-z0-9])(?![$])"},t={ -className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{ -begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/, -end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null -}),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null, -contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({ -begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, -contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string", -contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'" -}),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},s={className:"number",variants:[{ -begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{ -begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{ -begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?" -}],relevance:0},c={ -keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield", -literal:"false null true", -built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass" -};return{aliases:["php3","php4","php5","php6","php7","php8"], -case_insensitive:!0,keywords:c, -contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t] -}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}] -}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0, -keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{ -begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function", -relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0, -illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{ -begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)", -excludeBegin:!0,excludeEnd:!0,keywords:c, -contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s]}]},{className:"class",variants:[{ -beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", -illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ -beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ -beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, -contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";", -contains:[e.UNDERSCORE_TITLE_MODE]},l,s]}}})()); -hljs.registerLanguage("php-template",(()=>{"use strict";return n=>({ -name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/, -subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"', -end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{ -illegal:null,className:null,contains:null,skip:!0 -}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null, -skip:!0})]}]})})()); -hljs.registerLanguage("plaintext",(()=>{"use strict";return t=>({ -name:"Plain text",aliases:["text","txt"],disableAutodetect:!0})})()); -hljs.registerLanguage("properties",(()=>{"use strict";return e=>{ -var n="[ \\t\\f]*",a=n+"[:=]"+n,t="("+a+"|[ \\t\\f]+)",r="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",s="([^\\\\:= \\t\\f\\n]|\\\\.)+",i={ -end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{ -begin:"\\\\\\\\"},{begin:"\\\\\\n"}]}};return{name:".properties", -case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{ -returnBegin:!0,variants:[{begin:r+a,relevance:1},{begin:r+"[ \\t\\f]+", -relevance:0}],contains:[{className:"attr",begin:r,endsParent:!0,relevance:0}], -starts:i},{begin:s+t,returnBegin:!0,relevance:0,contains:[{className:"meta", -begin:s,endsParent:!0,relevance:0}],starts:i},{className:"attr",relevance:0, -begin:s+n+"$"}]}}})()); -hljs.registerLanguage("python",(()=>{"use strict";return e=>{const n={ -$pattern:/[A-Za-z]\w+|__\w+__/, -keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"], -built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], -literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], -type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] -},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/, -end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},t={ -className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, -contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{ -begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, -end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/([uU]|[rR])'/,end:/'/, -relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ -begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, -end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, -contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},r="[0-9](_?[0-9])*",l=`(\\b(${r}))?\\.(${r})|\\b(${r})\\.`,b={ -className:"number",relevance:0,variants:[{ -begin:`(\\b(${r})|(${l}))[eE][+-]?(${r})[jJ]?\\b`},{begin:`(${l})[jJ]?`},{ -begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{ -begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{ -begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${r})[jJ]\\b`}]},o={ -className:"comment", -begin:(d=/# type:/,((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(?=",d,")")), -end:/$/,keywords:n,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/, -endsWithParent:!0}]},c={className:"params",variants:[{className:"", -begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0, -keywords:n,contains:["self",a,b,t,e.HASH_COMMENT_MODE]}]};var d -;return i.contains=[t,b,a],{name:"Python",aliases:["py","gyp","ipython"], -keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,b,{begin:/\bself\b/},{ -beginKeywords:"if",relevance:0},t,o,e.HASH_COMMENT_MODE,{variants:[{ -className:"function",beginKeywords:"def"},{className:"class", -beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/, -contains:[e.UNDERSCORE_TITLE_MODE,c,{begin:/->/,endsWithParent:!0,keywords:n}] -},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,c,t]}]}}})()); -hljs.registerLanguage("python-repl",(()=>{"use strict";return s=>({ -aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$", -subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{ -begin:/^\.\.\.(?=[ ]|$)/}]}]})})()); -hljs.registerLanguage("r",(()=>{"use strict";function e(...e){return e.map((e=>{ -return(a=e)?"string"==typeof a?a:a.source:null;var a})).join("")}return a=>{ -const n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/;return{name:"R", -illegal:/->/,keywords:{$pattern:n, -keyword:"function if in break next repeat else for while", -literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", -built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" -},compilerExtensions:[(a,n)=>{if(!a.beforeMatch)return -;if(a.starts)throw Error("beforeMatch cannot be used with starts") -;const i=Object.assign({},a);Object.keys(a).forEach((e=>{delete a[e] -})),a.begin=e(i.beforeMatch,e("(?=",i.begin,")")),a.starts={relevance:0, -contains:[Object.assign(i,{endsParent:!0})]},a.relevance=0,delete i.beforeMatch -}],contains:[a.COMMENT(/#'/,/$/,{contains:[{className:"doctag", -begin:"@examples",starts:{contains:[{begin:/\n/},{begin:/#'\s*(?=@[a-zA-Z]+)/, -endsParent:!0},{begin:/#'/,end:/$/,excludeBegin:!0}]}},{className:"doctag", -begin:"@param",end:/$/,contains:[{className:"variable",variants:[{begin:n},{ -begin:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{className:"doctag", -begin:/@[a-zA-Z]+/},{className:"meta-keyword",begin:/\\[a-zA-Z]+/}] -}),a.HASH_COMMENT_MODE,{className:"string",contains:[a.BACKSLASH_ESCAPE], -variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ -}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ -}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ -}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ -}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ -}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', -relevance:0},{begin:"'",end:"'",relevance:0}]},{className:"number",relevance:0, -beforeMatch:/([^a-zA-Z0-9._])/,variants:[{ -match:/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/},{ -match:/0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/},{ -match:/(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/}]},{begin:"%",end:"%"},{ -begin:e(/[a-zA-Z][a-zA-Z_0-9]*/,"\\s+<-\\s+")},{begin:"`",end:"`",contains:[{ -begin:/\\./}]}]}}})()); -hljs.registerLanguage("ruby",(()=>{"use strict";function e(...e){ -return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n -})).join("")}return n=>{ -const a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i={ -keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__", -built_in:"proc lambda",literal:"true false nil"},s={className:"doctag", -begin:"@[A-Za-z]+"},r={begin:"#<",end:">"},b=[n.COMMENT("#","$",{contains:[s] -}),n.COMMENT("^=begin","^=end",{contains:[s],relevance:10 -}),n.COMMENT("^__END__","\\n$")],c={className:"subst",begin:/#\{/,end:/\}/, -keywords:i},t={className:"string",contains:[n.BACKSLASH_ESCAPE,c],variants:[{ -begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/, -end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{ -begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/, -end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{ -begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{ -begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ -begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ -begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ -begin:/<<[-~]?'?(\w+)\n(?:[^\n]*\n)*?\s*\1\b/,returnBegin:!0,contains:[{ -begin:/<<[-~]?'?/},n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, -contains:[n.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",d={className:"number", -relevance:0,variants:[{ -begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ -begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" -},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ -begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ -begin:"\\b0(_?[0-7])+r?i?\\b"}]},l={className:"params",begin:"\\(",end:"\\)", -endsParent:!0,keywords:i},o=[t,{className:"class",beginKeywords:"class module", -end:"$|;",illegal:/=/,contains:[n.inherit(n.TITLE_MODE,{ -begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{ -begin:"("+n.IDENT_RE+"::)?"+n.IDENT_RE,relevance:0}]}].concat(b)},{ -className:"function",begin:e(/def\s+/,(_=a+"\\s*(\\(|;|$)",e("(?=",_,")"))), -relevance:0,keywords:"def",end:"$|;",contains:[n.inherit(n.TITLE_MODE,{begin:a -}),l].concat(b)},{begin:n.IDENT_RE+"::"},{className:"symbol", -begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", -begin:":(?!\\s)",contains:[t,{begin:a}],relevance:0},d,{className:"variable", -begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ -className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:i},{ -begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{ -className:"regexp",contains:[n.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{ -begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(", -end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}] -}].concat(r,b),relevance:0}].concat(r,b);var _;c.contains=o,l.contains=o -;const E=[{begin:/^\s*=>/,starts:{end:"$",contains:o}},{className:"meta", -begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", -starts:{end:"$",contains:o}}];return b.unshift(r),{name:"Ruby", -aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/, -contains:[n.SHEBANG({binary:"ruby"})].concat(E).concat(b).concat(o)}}})()); -hljs.registerLanguage("rust",(()=>{"use strict";return e=>{ -const n="([ui](8|16|32|64|128|size)|f(32|64))?",t="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!" -;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?", -keyword:"abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield", -literal:"true false Some None Ok Err",built_in:t},illegal:""}]}}})()); -hljs.registerLanguage("scss",(()=>{"use strict" -;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse() -;return a=>{const n=(e=>({IMPORTANT:{className:"meta",begin:"!important"}, -HEXCOLOR:{className:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, -ATTRIBUTE_SELECTOR_MODE:{className:"selector-attr",begin:/\[/,end:/\]/, -illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]} -}))(a),l=o,s=i,d="@[a-z-]+",c={className:"variable", -begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"};return{name:"SCSS",case_insensitive:!0, -illegal:"[=/|']",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{ -className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ -className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 -},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", -begin:"\\b("+e.join("|")+")\\b",relevance:0},{className:"selector-pseudo", -begin:":("+s.join("|")+")"},{className:"selector-pseudo", -begin:"::("+l.join("|")+")"},c,{begin:/\(/,end:/\)/,contains:[a.CSS_NUMBER_MODE] -},{className:"attribute",begin:"\\b("+r.join("|")+")\\b"},{ -begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" -},{begin:":",end:";", -contains:[c,n.HEXCOLOR,a.CSS_NUMBER_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,n.IMPORTANT] -},{begin:"@(page|font-face)",lexemes:d,keywords:"@page @font-face"},{begin:"@", -end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, -keyword:"and or not only",attribute:t.join(" ")},contains:[{begin:d, -className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" -},c,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,n.HEXCOLOR,a.CSS_NUMBER_MODE]}]}} -})()); -hljs.registerLanguage("shell",(()=>{"use strict";return s=>({ -name:"Shell Session",aliases:["console"],contains:[{className:"meta", -begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#]/,starts:{end:/[^\\](?=\s*$)/, -subLanguage:"bash"}}]})})()); -hljs.registerLanguage("sql",(()=>{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function r(...r){ -return r.map((r=>e(r))).join("")}function t(...r){ -return"("+r.map((r=>e(r))).join("|")+")"}return e=>{ -const n=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],o=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],c=s,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update ","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!s.includes(e))),u={ -begin:r(/\b/,t(...c),/\s*\(/),keywords:{built_in:c}};return{name:"SQL", -case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/, -keyword:((e,{exceptions:r,when:t}={})=>{const n=t -;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) -})(l,{when:e=>e.length<3}),literal:a,type:i, -built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] -},contains:[{begin:t(...o),keywords:{$pattern:/[\w\.]+/,keyword:l.concat(o), -literal:a,type:i}},{className:"type", -begin:t("double precision","large object","with timezone","without timezone") -},u,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ -begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ -begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator", -begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})()); -hljs.registerLanguage("swift",(()=>{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function n(e){return a("(?=",e,")")} -function a(...n){return n.map((n=>e(n))).join("")}function t(...n){ -return"("+n.map((n=>e(n))).join("|")+")"} -const i=e=>a(/\b/,e,/\w$/.test(e)?/\b/:/\B/),s=["Protocol","Type"].map(i),u=["init","self"].map(i),c=["Any","Self"],r=["associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],o=["false","nil","true"],l=["assignment","associativity","higherThan","left","lowerThan","none","right"],m=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],d=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],p=t(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),F=t(p,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),b=a(p,F,"*"),h=t(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),f=t(h,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),w=a(h,f,"*"),y=a(/[A-Z]/,f,"*"),g=["autoclosure",a(/convention\(/,t("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",a(/objc\(/,w,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","testable","UIApplicationMain","unknown","usableFromInline"],E=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] -;return e=>{const p={match:/\s+/,relevance:0},h=e.COMMENT("/\\*","\\*/",{ -contains:["self"]}),v=[e.C_LINE_COMMENT_MODE,h],N={className:"keyword", -begin:a(/\./,n(t(...s,...u))),end:t(...s,...u),excludeBegin:!0},A={ -match:a(/\./,t(...r)),relevance:0 -},C=r.filter((e=>"string"==typeof e)).concat(["_|0"]),_={variants:[{ -className:"keyword", -match:t(...r.filter((e=>"string"!=typeof e)).concat(c).map(i),...u)}]},D={ -$pattern:t(/\b\w+/,/#\w+/),keyword:C.concat(m),literal:o},B=[N,A,_],k=[{ -match:a(/\./,t(...d)),relevance:0},{className:"built_in", -match:a(/\b/,t(...d),/(?=\()/)}],M={match:/->/,relevance:0},S=[M,{ -className:"operator",relevance:0,variants:[{match:b},{match:`\\.(\\.|${F})+`}] -}],x="([0-9a-fA-F]_*)+",I={className:"number",relevance:0,variants:[{ -match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{ -match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(([0-9]_*)+))?\\b`},{ -match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(e="")=>({ -className:"subst",variants:[{match:a(/\\/,e,/[0\\tnr"']/)},{ -match:a(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),T=(e="")=>({className:"subst", -match:a(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),L=(e="")=>({className:"subst", -label:"interpol",begin:a(/\\/,e,/\(/),end:/\)/}),P=(e="")=>({begin:a(e,/"""/), -end:a(/"""/,e),contains:[O(e),T(e),L(e)]}),$=(e="")=>({begin:a(e,/"/), -end:a(/"/,e),contains:[O(e),L(e)]}),K={className:"string", -variants:[P(),P("#"),P("##"),P("###"),$(),$("#"),$("##"),$("###")]},j={ -match:a(/`/,w,/`/)},z=[j,{className:"variable",match:/\$\d+/},{ -className:"variable",match:`\\$${f}+`}],q=[{match:/(@|#)available/, -className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:E, -contains:[...S,I,K]}]}},{className:"keyword",match:a(/@/,t(...g))},{ -className:"meta",match:a(/@/,w)}],U={match:n(/\b[A-Z]/),relevance:0,contains:[{ -className:"type", -match:a(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,f,"+") -},{className:"type",match:y,relevance:0},{match:/[?!]+/,relevance:0},{ -match:/\.\.\./,relevance:0},{match:a(/\s+&\s+/,n(y)),relevance:0}]},Z={ -begin://,keywords:D,contains:[...v,...B,...q,M,U]};U.contains.push(Z) -;const G={begin:/\(/,end:/\)/,relevance:0,keywords:D,contains:["self",{ -match:a(w,/\s*:/),keywords:"_|0",relevance:0 -},...v,...B,...k,...S,I,K,...z,...q,U]},H={beginKeywords:"func",contains:[{ -className:"title",match:t(j.match,w,b),endsParent:!0,relevance:0},p]},R={ -begin://,contains:[...v,U]},V={begin:/\(/,end:/\)/,keywords:D, -contains:[{begin:t(n(a(w,/\s*:/)),n(a(w,/\s+/,w,/\s*:/))),end:/:/,relevance:0, -contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:w}] -},...v,...B,...S,I,K,...q,U,G],endsParent:!0,illegal:/["']/},W={ -className:"function",match:n(/\bfunc\b/),contains:[H,R,V,p],illegal:[/\[/,/%/] -},X={className:"function",match:/\b(subscript|init[?!]?)\s*(?=[<(])/,keywords:{ -keyword:"subscript init init? init!",$pattern:/\w+[?!]?/},contains:[R,V,p], -illegal:/\[|%/},J={beginKeywords:"operator",end:e.MATCH_NOTHING_RE,contains:[{ -className:"title",match:b,endsParent:!0,relevance:0}]},Q={ -beginKeywords:"precedencegroup",end:e.MATCH_NOTHING_RE,contains:[{ -className:"title",match:y,relevance:0},{begin:/{/,end:/}/,relevance:0, -endsParent:!0,keywords:[...l,...o],contains:[U]}]};for(const e of K.variants){ -const n=e.contains.find((e=>"interpol"===e.label));n.keywords=D -;const a=[...B,...k,...S,I,K,...z];n.contains=[...a,{begin:/\(/,end:/\)/, -contains:["self",...a]}]}return{name:"Swift",keywords:D,contains:[...v,W,X,{ -className:"class",beginKeywords:"struct protocol class extension enum", -end:"\\{",excludeEnd:!0,keywords:D,contains:[e.inherit(e.TITLE_MODE,{ -begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...B]},J,Q,{ -beginKeywords:"import",end:/$/,contains:[...v],relevance:0 -},...B,...k,...S,I,K,...z,...q,U,G]}}})()); -hljs.registerLanguage("typescript",(()=>{"use strict" -;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],s=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]) -;function t(e){return r("(?=",e,")")}function r(...e){return e.map((e=>{ -return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return i=>{ -const c={$pattern:e, -keyword:n.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]), -literal:a, -built_in:s.concat(["any","void","number","boolean","string","object","never","enum"]) -},o={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},l=(e,n,a)=>{ -const s=e.contains.findIndex((e=>e.label===n)) -;if(-1===s)throw Error("can not find mode to replace");e.contains.splice(s,1,a) -},b=(i=>{const c=e,o={begin:/<[A-Za-z0-9\\._:-]+/, -end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ -const a=e[0].length+e.index,s=e.input[a];"<"!==s?">"===s&&(((e,{after:n})=>{ -const a="", -returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{ -begin:i.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0 -},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:f}]}] -},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{ -variants:[{begin:"<>",end:""},{begin:o.begin,"on:begin":o.isTrulyOpeningTag, -end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0, -contains:["self"]}]}],relevance:0},{className:"function", -beginKeywords:"function",end:/[{;]/,excludeEnd:!0,keywords:l, -contains:["self",i.inherit(i.TITLE_MODE,{begin:c}),A],illegal:/%/},{ -beginKeywords:"while if switch catch for"},{className:"function", -begin:i.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", -returnBegin:!0,contains:[A,i.inherit(i.TITLE_MODE,{begin:c})]},{variants:[{ -begin:"\\."+c},{begin:"\\$"+c}],relevance:0},{className:"class", -beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"[\]]/,contains:[{ -beginKeywords:"extends"},i.UNDERSCORE_TITLE_MODE]},{begin:/\b(?=constructor)/, -end:/[{;]/,excludeEnd:!0,contains:[i.inherit(i.TITLE_MODE,{begin:c}),"self",A] -},{begin:"(get|set)\\s+(?="+c+"\\()",end:/\{/,keywords:"get set", -contains:[i.inherit(i.TITLE_MODE,{begin:c}),{begin:/\(\)/},A]},{begin:/\$[(.]/}] -}})(i) -;return Object.assign(b.keywords,c),b.exports.PARAMS_CONTAINS.push(o),b.contains=b.contains.concat([o,{ -beginKeywords:"namespace",end:/\{/,excludeEnd:!0},{beginKeywords:"interface", -end:/\{/,excludeEnd:!0,keywords:"interface extends" -}]),l(b,"shebang",i.SHEBANG()),l(b,"use_strict",{className:"meta",relevance:10, -begin:/^\s*['"]use strict['"]/ -}),b.contains.find((e=>"function"===e.className)).relevance=0,Object.assign(b,{ -name:"TypeScript",aliases:["ts","tsx"]}),b}})()); -hljs.registerLanguage("vbnet",(()=>{"use strict";function e(e){ -return e?"string"==typeof e?e:e.source:null}function n(...n){ -return n.map((n=>e(n))).join("")}function t(...n){ -return"("+n.map((n=>e(n))).join("|")+")"}return e=>{ -const a=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,o={ -className:"literal",variants:[{begin:n(/# */,t(i,a),/ *#/)},{ -begin:n(/# */,r,/ *#/)},{begin:n(/# */,s,/ *#/)},{ -begin:n(/# */,t(i,a),/ +/,t(s,r),/ *#/)}]},l=e.COMMENT(/'''/,/$/,{contains:[{ -className:"doctag",begin:/<\/?/,end:/>/}]}),c=e.COMMENT(null,/$/,{variants:[{ -begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET", -aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{ -keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", -built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", -type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", -literal:"true false nothing"}, -illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ -className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, -end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0, -variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ -},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ -begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ -className:"label",begin:/^\w+:/},l,c,{className:"meta", -begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, -end:/$/,keywords:{ -"meta-keyword":"const disable else elseif enable end externalsource if region then" -},contains:[c]}]}}})()); -hljs.registerLanguage("yaml",(()=>{"use strict";return e=>{ -var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={ -className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ -},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", -variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(s,{ -variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={ -end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},t={begin:/\{/, -end:/\}/,contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]", -contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{ -begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ -begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", -relevance:10},{className:"string", -begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ -begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, -relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type", -begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a -},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", -begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", -relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ -className:"number", -begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" -},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},t,g,s],r=[...b] -;return r.pop(),r.push(i),l.contains=r,{name:"YAML",case_insensitive:!0, -aliases:["yml"],contains:b}}})()); \ No newline at end of file diff --git a/htmlReport/js/highlightjs-line-numbers.min.js b/htmlReport/js/highlightjs-line-numbers.min.js deleted file mode 100644 index 8548576..0000000 --- a/htmlReport/js/highlightjs-line-numbers.min.js +++ /dev/null @@ -1,24 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2017 Yauheni Pakala - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - */ -!function(r,o){"use strict";var e,i="hljs-ln",l="hljs-ln-line",h="hljs-ln-code",s="hljs-ln-numbers",c="hljs-ln-n",m="data-line-number",a=/\r\n|\r|\n/g;function u(e){for(var n=e.toString(),t=e.anchorNode;"TD"!==t.nodeName;)t=t.parentNode;for(var r=e.focusNode;"TD"!==r.nodeName;)r=r.parentNode;var o=parseInt(t.dataset.lineNumber),a=parseInt(r.dataset.lineNumber);if(o==a)return n;var i,l=t.textContent,s=r.textContent;for(a
{6}',[l,s,c,m,h,o+n.startFrom,0{1}',[i,r])}return e}(e.innerHTML,o)}function v(e){var n=e.className;if(/hljs-/.test(n)){for(var t=g(e.innerHTML),r=0,o="";r{1}
\n',[n,0 - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_BLOCK.html b/htmlReport/ns-1/index_SORT_BY_BLOCK.html deleted file mode 100644 index 21e8b9b..0000000 --- a/htmlReport/ns-1/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 7adfb64..0000000 --- a/htmlReport/ns-1/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_CLASS.html b/htmlReport/ns-1/index_SORT_BY_CLASS.html deleted file mode 100644 index c63d3e5..0000000 --- a/htmlReport/ns-1/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index aeae973..0000000 --- a/htmlReport/ns-1/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_LINE.html b/htmlReport/ns-1/index_SORT_BY_LINE.html deleted file mode 100644 index 4072968..0000000 --- a/htmlReport/ns-1/index_SORT_BY_LINE.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 76547f4..0000000 --- a/htmlReport/ns-1/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_METHOD.html b/htmlReport/ns-1/index_SORT_BY_METHOD.html deleted file mode 100644 index 28a702f..0000000 --- a/htmlReport/ns-1/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 3442f2a..0000000 --- a/htmlReport/ns-1/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 700bf7c..0000000 --- a/htmlReport/ns-1/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SempreAlertaApplication - - 100% - - - (1/1) - - - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
- - - - - - diff --git a/htmlReport/ns-1/sources/source-1.html b/htmlReport/ns-1/sources/source-1.html deleted file mode 100644 index 89235aa..0000000 --- a/htmlReport/ns-1/sources/source-1.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - Coverage Report > SempreAlertaApplication - - - - - - -
- - -

Coverage Summary for Class: SempreAlertaApplication (com.institutosemprealerta.semprealerta)

- - - - - - - - - - - - - - - - - - - - - -
Class - Method, % - - Line, % -
SempreAlertaApplication - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
SempreAlertaApplication$$SpringCGLIB$$0
Total - - 50% - - - (1/2) - - - - 50% - - - (1/2) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta;
- 
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- 
- @SpringBootApplication
- public class SempreAlertaApplication {
- 
-     public static void main(String[] args) {
-         SpringApplication.run(SempreAlertaApplication.class, args);
-     }
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-10/index.html b/htmlReport/ns-10/index.html deleted file mode 100644 index 8198818..0000000 --- a/htmlReport/ns-10/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_BLOCK.html b/htmlReport/ns-10/index_SORT_BY_BLOCK.html deleted file mode 100644 index c453132..0000000 --- a/htmlReport/ns-10/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 99aa58e..0000000 --- a/htmlReport/ns-10/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_CLASS.html b/htmlReport/ns-10/index_SORT_BY_CLASS.html deleted file mode 100644 index e263dad..0000000 --- a/htmlReport/ns-10/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 4750905..0000000 --- a/htmlReport/ns-10/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_LINE.html b/htmlReport/ns-10/index_SORT_BY_LINE.html deleted file mode 100644 index a9ae8b1..0000000 --- a/htmlReport/ns-10/index_SORT_BY_LINE.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 3cb80ad..0000000 --- a/htmlReport/ns-10/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_METHOD.html b/htmlReport/ns-10/index_SORT_BY_METHOD.html deleted file mode 100644 index b688e87..0000000 --- a/htmlReport/ns-10/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 2200318..0000000 --- a/htmlReport/ns-10/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 1e6b8ba..0000000 --- a/htmlReport/ns-10/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.repositories - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.repositories

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.infrastructure.repositories
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-10/sources/source-1.html b/htmlReport/ns-10/sources/source-1.html deleted file mode 100644 index 16a9951..0000000 --- a/htmlReport/ns-10/sources/source-1.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - Coverage Report > JpaUserRepository - - - - - - -
- - -

Coverage Summary for Class: JpaUserRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

- - - - - - - - - - - - - - - - - - -
Class
JpaUserRepository$MockitoMock$LZE1B28P
JpaUserRepository$MockitoMock$LZE1B28P$auxiliary$ci3DkrR6
JpaUserRepository$MockitoMock$LZE1B28P$auxiliary$MS6yQbDf
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.repositories;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import org.springframework.data.jpa.repository.JpaRepository;
- import org.springframework.data.jpa.repository.Query;
- import org.springframework.stereotype.Repository;
- 
- import java.util.Optional;
- 
- @Repository
- public interface JpaUserRepository extends JpaRepository<User, Integer> {
-     @Query("SELECT u FROM User u WHERE u.contact.email = ?1")
-     Optional<User> findByEmail(String email);
- 
-     Optional<User> findByRegistration(String registration);
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-10/sources/source-2.html b/htmlReport/ns-10/sources/source-2.html deleted file mode 100644 index 4706d09..0000000 --- a/htmlReport/ns-10/sources/source-2.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - Coverage Report > JpaPostRepository - - - - - - -
- - -

Coverage Summary for Class: JpaPostRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

- - - - - - - - - - - - - - - - - - -
Class
JpaPostRepository$MockitoMock$97KgGPUb
JpaPostRepository$MockitoMock$97KgGPUb$auxiliary$85LpAoIc
JpaPostRepository$MockitoMock$97KgGPUb$auxiliary$Vm7GFIkF
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.repositories;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
- import org.springframework.data.jpa.repository.JpaRepository;
- import org.springframework.stereotype.Repository;
- 
- import java.util.Optional;
- 
- @Repository
- public interface JpaPostRepository extends JpaRepository<PostEntity, Long>{
-     Optional<PostEntity> findBySlug(String slug);
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-10/sources/source-3.html b/htmlReport/ns-10/sources/source-3.html deleted file mode 100644 index d8573f9..0000000 --- a/htmlReport/ns-10/sources/source-3.html +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - Coverage Report > JpaFileRepository - - - - - - -
- - -

Coverage Summary for Class: JpaFileRepository (com.institutosemprealerta.semprealerta.infrastructure.repositories)

- - - - - - - - - - - - - - - - - - -
Class
JpaFileRepository$MockitoMock$aN8pxh2a
JpaFileRepository$MockitoMock$aN8pxh2a$auxiliary$b55TKeQJ
JpaFileRepository$MockitoMock$aN8pxh2a$auxiliary$KGoKCtcZ
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.repositories;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity;
- import org.springframework.data.jpa.repository.JpaRepository;
- import org.springframework.stereotype.Repository;
- 
- @Repository
- public interface JpaFileRepository extends JpaRepository<FileEntity, Long> {
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-2/index.html b/htmlReport/ns-2/index.html deleted file mode 100644 index 6ff3cfe..0000000 --- a/htmlReport/ns-2/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_BLOCK.html b/htmlReport/ns-2/index_SORT_BY_BLOCK.html deleted file mode 100644 index 6c86ecf..0000000 --- a/htmlReport/ns-2/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 83ce012..0000000 --- a/htmlReport/ns-2/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_CLASS.html b/htmlReport/ns-2/index_SORT_BY_CLASS.html deleted file mode 100644 index 6891eb3..0000000 --- a/htmlReport/ns-2/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 70aba21..0000000 --- a/htmlReport/ns-2/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_LINE.html b/htmlReport/ns-2/index_SORT_BY_LINE.html deleted file mode 100644 index 37e4949..0000000 --- a/htmlReport/ns-2/index_SORT_BY_LINE.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index d9b09d0..0000000 --- a/htmlReport/ns-2/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_METHOD.html b/htmlReport/ns-2/index_SORT_BY_METHOD.html deleted file mode 100644 index bfe4f88..0000000 --- a/htmlReport/ns-2/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index d6f6d90..0000000 --- a/htmlReport/ns-2/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 9829650..0000000 --- a/htmlReport/ns-2/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.application.service.impl - - 100% - - - (3/3) - - - - 95.7% - - - (22/23) - - - - 83.1% - - - (54/65) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-2/sources/source-1.html b/htmlReport/ns-2/sources/source-1.html deleted file mode 100644 index e4f5381..0000000 --- a/htmlReport/ns-2/sources/source-1.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - Coverage Report > PostServiceImpl - - - - - - -
- - -

Coverage Summary for Class: PostServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
PostServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (8/8) - - - - 100% - - - (14/14) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service.impl;
- 
- import com.institutosemprealerta.semprealerta.application.service.PostService;
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
- import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository;
- import org.springframework.data.domain.Page;
- import org.springframework.stereotype.Service;
- import org.springframework.data.domain.Pageable;
- 
- import java.util.List;
- 
- @Service
- public class PostServiceImpl implements PostService {
-     private final PostRepository postRepository;
-     private final SlugGenerator slugGenerator;
- 
-     public PostServiceImpl(PostRepository postRepository, SlugGenerator slugGenerator) {
-         this.postRepository = postRepository;
-         this.slugGenerator = slugGenerator;
-     }
- 
-     @Override
-     public String save(Post post) {
-         String slug = this.generateSlug(post.getTitle());
-         post.setSlug(slug);
- 
-         return postRepository.save(post);
-     }
- 
-     @Override
-     public void delete(Long id) {
-         postRepository.delete(id);
-     }
- 
-     @Override
-     public void update(Long id, Post post) {
-         String slug = this.generateSlug(post.getTitle());
-         post.setSlug(slug);
-         postRepository.update(id, post);
-     }
- 
-     @Override
-     public Page<Post> listAll(Pageable pageable) {
-         return postRepository.listAll(pageable);
-     }
- 
- 
-     @Override
-     public Post findBySlug(String slug) {
-         return postRepository.findBySlug(slug);
-     }
- 
-     @Override
-     public Post findById(Long id) {
-         return postRepository.findById(id);
-     }
- 
-     private String generateSlug(String title) {
-         return  slugGenerator.generate(title);
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-2/sources/source-2.html b/htmlReport/ns-2/sources/source-2.html deleted file mode 100644 index 73dac7a..0000000 --- a/htmlReport/ns-2/sources/source-2.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - Coverage Report > StorageServiceImpl - - - - - - -
- - -

Coverage Summary for Class: StorageServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
StorageServiceImpl - - 100% - - - (1/1) - - - - 87.5% - - - (7/8) - - - - 72.5% - - - (29/40) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service.impl;
- 
- import com.institutosemprealerta.semprealerta.application.service.StorageService;
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties;
- import lombok.extern.log4j.Log4j2;
- import org.springframework.core.io.Resource;
- import org.springframework.core.io.UrlResource;
- import org.springframework.stereotype.Service;
- import org.springframework.util.FileSystemUtils;
- import org.springframework.util.StringUtils;
- import org.springframework.web.multipart.MultipartFile;
- 
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URI;
- import java.nio.file.Files;
- import java.nio.file.Path;
- import java.nio.file.Paths;
- import java.util.List;
- 
- @Service
- public class StorageServiceImpl implements StorageService {
-     private final Path fileStorageLocation;
-     private final FileRepository fileRepository;
- 
-     public StorageServiceImpl(FileStorageProperties fileStorageProperties, FileRepository fileRepository) {
-         this.fileStorageLocation = Paths.get(fileStorageProperties.getUploadDir())
-                 .toAbsolutePath().normalize();
-         this.fileRepository = fileRepository;
-     }
- 
-     @Override
-     public void init() {
-         try {
-             Files.createDirectories(fileStorageLocation);
-         } catch (IOException e) {
-             throw new RuntimeException("Could not create the directory where the uploaded files will be stored.", e);
-         }
-     }
- 
-     @Override
-     public String store(MultipartFile file, String fileType) {
-         if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) {
-             throw new RuntimeException("File name is empty");
-         }
-         String fileName = StringUtils.cleanPath(file.getOriginalFilename());
- 
-         try {
-             Path targetLocation = fileStorageLocation.resolve(fileName);
-             init();
- 
-             file.transferTo(targetLocation.toFile());
- 
-             String fileDownloadUri = "/api/v1/files/download/" + fileName;
- 
-             File fileData = File.builder()
-                     .fileName(fileName)
-                     .fileType(fileType)
-                     .fileDownloadUri(fileDownloadUri)
-                     .build();
- 
-             this.fileRepository.save(fileData);
-         } catch (IOException e) {
-             throw new RuntimeException("Could not store file " + fileName + ". Please try again!", e);
-         }
-         return fileName;
-     }
- 
-     @Override
-     public List<FileResponse> loadAll() {
- 
-         return this.fileRepository.listAll();
-     }
- 
-     @Override
-     public Path load(String filename) {
-         Path file = fileStorageLocation.resolve(filename).normalize();
-         if (!Files.exists(file)) {
-             throw new RuntimeException("File not found " + filename);
-         }
-         return file;
-     }
- 
-     @Override
-     public Resource loadAsResource(String filename) {
-         URI fileUri = load(filename).toUri();
-         try {
-             return new UrlResource(fileUri);
-         } catch (MalformedURLException e) {
-             throw new RuntimeException(e);
-         }
-     }
- 
-     @Override
-     public void delete(String filename) {
-         Path file = load(filename);
- 
-         try {
-             Files.deleteIfExists(file);
-         } catch (IOException e) {
-             throw new RuntimeException(e);
-         }
-     }
- 
-     @Override
-     public void deleteAll() {
-         FileSystemUtils.deleteRecursively(fileStorageLocation.toFile());
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-2/sources/source-3.html b/htmlReport/ns-2/sources/source-3.html deleted file mode 100644 index 8e24b6a..0000000 --- a/htmlReport/ns-2/sources/source-3.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - Coverage Report > UserServiceImpl - - - - - - -
- - -

Coverage Summary for Class: UserServiceImpl (com.institutosemprealerta.semprealerta.application.service.impl)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
UserServiceImpl - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (11/11) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service.impl;
- 
- import com.institutosemprealerta.semprealerta.application.service.UserService;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository;
- import org.springframework.stereotype.Service;
- 
- @Service
- public class UserServiceImpl implements UserService {
- 
-     private final UserRepository userRepository;
- 
-     public UserServiceImpl(UserRepository userRepository) {
-         this.userRepository = userRepository;
-     }
- 
-     @Override
-     public void save(User user) {
-         this.userRepository.save(user);
-     }
- 
-     @Override
-     public void update(int id, User user) {
-         this.userRepository.update(id, user);
-     }
- 
-     @Override
-     public void delete(int id) {
-         this.userRepository.delete(id);
-     }
- 
-     @Override
-     public User findByRegistration(String registration) {
-         return this.userRepository.findByRegistration(registration)
-                 .orElseThrow(() -> new RuntimeException("User not found"));
-     }
- 
-     @Override
-     public User findByEmail(String email) {
-         return this.userRepository.findByEmail(email)
-                 .orElseThrow(() -> new RuntimeException("User not found"));
-     }
- 
-     @Override
-     public User findById(int id) {
-         return this.userRepository.findById(id)
-                 .orElseThrow(() -> new RuntimeException("User not found"));
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-3/index.html b/htmlReport/ns-3/index.html deleted file mode 100644 index d646df7..0000000 --- a/htmlReport/ns-3/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_BLOCK.html b/htmlReport/ns-3/index_SORT_BY_BLOCK.html deleted file mode 100644 index 2e1502d..0000000 --- a/htmlReport/ns-3/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index bd9d754..0000000 --- a/htmlReport/ns-3/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_CLASS.html b/htmlReport/ns-3/index_SORT_BY_CLASS.html deleted file mode 100644 index 4f59fa5..0000000 --- a/htmlReport/ns-3/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 2c812fa..0000000 --- a/htmlReport/ns-3/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_LINE.html b/htmlReport/ns-3/index_SORT_BY_LINE.html deleted file mode 100644 index 538088c..0000000 --- a/htmlReport/ns-3/index_SORT_BY_LINE.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 09008ae..0000000 --- a/htmlReport/ns-3/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_METHOD.html b/htmlReport/ns-3/index_SORT_BY_METHOD.html deleted file mode 100644 index f3eaa12..0000000 --- a/htmlReport/ns-3/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index d34fa95..0000000 --- a/htmlReport/ns-3/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 1b08a3d..0000000 --- a/htmlReport/ns-3/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.model - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.model

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.model - - 100% - - - (4/4) - - - - 73.7% - - - (14/19) - - - - 81.5% - - - (22/27) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
File - - 100% - - - (2/2) - - - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-3/sources/source-1.html b/htmlReport/ns-3/sources/source-1.html deleted file mode 100644 index 73791d8..0000000 --- a/htmlReport/ns-3/sources/source-1.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - Coverage Report > File - - - - - - -
- - -

Coverage Summary for Class: File (com.institutosemprealerta.semprealerta.domain.model)

- - - - - - - - - - - - - - - - - - - - - - - -
Class - Method, % - - Line, % -
File - - 57.1% - - - (4/7) - - - - 57.1% - - - (4/7) - -
File$FileBuilder - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
Total - - 62.5% - - - (5/8) - - - - 62.5% - - - (5/8) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.model;
- 
- import lombok.Builder;
- @Builder
- public class File {
-         private String fileName;
-         private String fileDownloadUri;
-         private String fileType;
- 
-         public String getFileName() {
-                 return fileName;
-         }
- 
-         public void setFileName(String fileName) {
-                 this.fileName = fileName;
-         }
- 
-         public String getFileDownloadUri() {
-                 return fileDownloadUri;
-         }
- 
-         public void setFileDownloadUri(String fileDownloadUri) {
-                 this.fileDownloadUri = fileDownloadUri;
-         }
- 
-         public String getFileType() {
-                 return fileType;
-         }
- 
-         public void setFileType(String fileType) {
-                 this.fileType = fileType;
-         }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-3/sources/source-2.html b/htmlReport/ns-3/sources/source-2.html deleted file mode 100644 index dd7a396..0000000 --- a/htmlReport/ns-3/sources/source-2.html +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - Coverage Report > Post - - - - - - -
- - -

Coverage Summary for Class: Post (com.institutosemprealerta.semprealerta.domain.model)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
Post - - 100% - - - (1/1) - - - - 77.8% - - - (7/9) - - - - 86.7% - - - (13/15) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.model;
- 
- import lombok.Getter;
- import lombok.Setter;
- 
- import java.time.LocalDateTime;
- 
- @Getter
- @Setter
- public class Post {
- 
-     private Long id;
-     private String title;
-     private String slug;
- 
-     private String content;
-     private String banner;
-     private LocalDateTime createdAt;
- 
-     public Post(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) {
-         this.id = id;
-         this.title = title;
-         this.slug = slug;
-         this.content = content;
-         this.banner = banner;
-         this.createdAt = createdAt;
-     }
- 
-     public Post() {
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-3/sources/source-3.html b/htmlReport/ns-3/sources/source-3.html deleted file mode 100644 index 0f71f19..0000000 --- a/htmlReport/ns-3/sources/source-3.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - Coverage Report > UserDTO - - - - - - -
- - -

Coverage Summary for Class: UserDTO (com.institutosemprealerta.semprealerta.domain.model)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
UserDTO - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (4/4) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.model;
- 
- 
- import com.fasterxml.jackson.annotation.JsonFormat;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles;
- import com.institutosemprealerta.semprealerta.utils.DateManipulation;
- import jakarta.validation.constraints.*;
- 
- import java.time.LocalDate;
- import java.time.format.DateTimeFormatter;
- 
- public record UserDTO(
-         @NotBlank
-         String name,
-         @Email
-         String email,
-         @NotBlank
-         String password,
-         @NotBlank
-         String phone,
-         String gender,
-         @PastOrPresent
-         LocalDate birthDate,
-         @NotNull
-         UserRoles roles,
-         String street,
-         String number,
-         String city,
-         String zipCode
- 
- ) {
-     public User toDomain() {
-         //LocalDate birth = DateManipulation.stringToLocalDate(birthDate);
-         Contact contact = new Contact(
-                 email,
-                 phone
-         );
- 
-         Address address = new Address(
-                 street,
-                 number,
-                 city,
-                 zipCode
-         );
-         return new User(
-                 name,
-                 password,
-                 gender,
-                 birthDate,
-                 roles,
-                 contact,
-                 address
-         );
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-4/index.html b/htmlReport/ns-4/index.html deleted file mode 100644 index 0973b9c..0000000 --- a/htmlReport/ns-4/index.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_BLOCK.html b/htmlReport/ns-4/index_SORT_BY_BLOCK.html deleted file mode 100644 index 9911c02..0000000 --- a/htmlReport/ns-4/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 2eabd6a..0000000 --- a/htmlReport/ns-4/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_CLASS.html b/htmlReport/ns-4/index_SORT_BY_CLASS.html deleted file mode 100644 index a650627..0000000 --- a/htmlReport/ns-4/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 0639744..0000000 --- a/htmlReport/ns-4/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_LINE.html b/htmlReport/ns-4/index_SORT_BY_LINE.html deleted file mode 100644 index b2e3cd8..0000000 --- a/htmlReport/ns-4/index_SORT_BY_LINE.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 289c8db..0000000 --- a/htmlReport/ns-4/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_METHOD.html b/htmlReport/ns-4/index_SORT_BY_METHOD.html deleted file mode 100644 index 59637a5..0000000 --- a/htmlReport/ns-4/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 2932aff..0000000 --- a/htmlReport/ns-4/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index a2110bb..0000000 --- a/htmlReport/ns-4/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in.impl - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in.impl

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.in.impl - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-4/sources/source-1.html b/htmlReport/ns-4/sources/source-1.html deleted file mode 100644 index c12514f..0000000 --- a/htmlReport/ns-4/sources/source-1.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - Coverage Report > SlugifySlugGenerator - - - - - - -
- - -

Coverage Summary for Class: SlugifySlugGenerator (com.institutosemprealerta.semprealerta.domain.ports.in.impl)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
SlugifySlugGenerator - - 0% - - - (0/1) - - - - 0% - - - (0/2) - - - - 0% - - - (0/3) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.in.impl;
- 
- import com.github.slugify.Slugify;
- import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
- import org.springframework.stereotype.Component;
- 
- @Component
- public class SlugifySlugGenerator implements SlugGenerator {
-     private final Slugify slug;
- 
-     public SlugifySlugGenerator() {
-         this.slug = Slugify.builder().build();
-     }
- 
-     @Override
-     public String generate(String input) {
-         return slug.slugify(input);
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-5/index.html b/htmlReport/ns-5/index.html deleted file mode 100644 index 2248da2..0000000 --- a/htmlReport/ns-5/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_BLOCK.html b/htmlReport/ns-5/index_SORT_BY_BLOCK.html deleted file mode 100644 index bc876d7..0000000 --- a/htmlReport/ns-5/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 09cb4fb..0000000 --- a/htmlReport/ns-5/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_CLASS.html b/htmlReport/ns-5/index_SORT_BY_CLASS.html deleted file mode 100644 index 86e057b..0000000 --- a/htmlReport/ns-5/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 6f51ba6..0000000 --- a/htmlReport/ns-5/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_LINE.html b/htmlReport/ns-5/index_SORT_BY_LINE.html deleted file mode 100644 index ef65e0e..0000000 --- a/htmlReport/ns-5/index_SORT_BY_LINE.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 62a444c..0000000 --- a/htmlReport/ns-5/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_METHOD.html b/htmlReport/ns-5/index_SORT_BY_METHOD.html deleted file mode 100644 index faffd3f..0000000 --- a/htmlReport/ns-5/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index e3731e6..0000000 --- a/htmlReport/ns-5/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 20b001e..0000000 --- a/htmlReport/ns-5/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out.responses - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out.responses

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.domain.ports.out.responses - - 66.7% - - - (2/3) - - - - 75% - - - (3/4) - - - - 90.9% - - - (10/11) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-5/sources/source-1.html b/htmlReport/ns-5/sources/source-1.html deleted file mode 100644 index 70d4ac8..0000000 --- a/htmlReport/ns-5/sources/source-1.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - Coverage Report > FileResponse - - - - - - -
- - -

Coverage Summary for Class: FileResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
FileResponse - - 100% - - - (1/1) - - - - 100% - - - (1/1) - - - - 100% - - - (1/1) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
- 
- import java.time.LocalDateTime;
- 
- public record FileResponse(
-         long id,
-         String fileName,
-         String fileDownloadUri,
-         String fileType,
-         LocalDateTime uploadDate
- ) {
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-5/sources/source-2.html b/htmlReport/ns-5/sources/source-2.html deleted file mode 100644 index 51e4375..0000000 --- a/htmlReport/ns-5/sources/source-2.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - Coverage Report > PostResponse - - - - - - -
- - -

Coverage Summary for Class: PostResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
PostResponse - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
- 
- public record PostResponse(
- 
- ) {
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-5/sources/source-3.html b/htmlReport/ns-5/sources/source-3.html deleted file mode 100644 index 3147317..0000000 --- a/htmlReport/ns-5/sources/source-3.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - Coverage Report > UserResponse - - - - - - -
- - -

Coverage Summary for Class: UserResponse (com.institutosemprealerta.semprealerta.domain.ports.out.responses)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
UserResponse - - 100% - - - (1/1) - - - - 100% - - - (2/2) - - - - 100% - - - (9/9) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out.responses;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Address;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles;
- 
- import java.time.LocalDate;
- 
- public record UserResponse(
-          String registration,
-          String name,
- 
-          String gender,
-          LocalDate birthDate,
- 
-          UserRoles roles,
- 
-          Contact contact,
-          Address address
- ) {
- 
-     public static UserResponse toResponse(User user) {
-         return new UserResponse(
-                 user.getRegistration(),
-                 user.getName(),
-                 user.getGender(),
-                 user.getBirthDate(),
-                 user.getRoles(),
-                 user.getContact(),
-                 user.getAddress()
-         );
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-6/index.html b/htmlReport/ns-6/index.html deleted file mode 100644 index f044f1a..0000000 --- a/htmlReport/ns-6/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_BLOCK.html b/htmlReport/ns-6/index_SORT_BY_BLOCK.html deleted file mode 100644 index 239a566..0000000 --- a/htmlReport/ns-6/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index e42a8ab..0000000 --- a/htmlReport/ns-6/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_CLASS.html b/htmlReport/ns-6/index_SORT_BY_CLASS.html deleted file mode 100644 index fc4e348..0000000 --- a/htmlReport/ns-6/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 17e9cbb..0000000 --- a/htmlReport/ns-6/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_LINE.html b/htmlReport/ns-6/index_SORT_BY_LINE.html deleted file mode 100644 index def4dad..0000000 --- a/htmlReport/ns-6/index_SORT_BY_LINE.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 6e4399a..0000000 --- a/htmlReport/ns-6/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_METHOD.html b/htmlReport/ns-6/index_SORT_BY_METHOD.html deleted file mode 100644 index 2a2135f..0000000 --- a/htmlReport/ns-6/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index a0a72ad..0000000 --- a/htmlReport/ns-6/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 8f1007b..0000000 --- a/htmlReport/ns-6/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.adpters - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.adpters

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.adpters - - 100% - - - (3/3) - - - - 100% - - - (18/18) - - - - 100% - - - (41/41) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
- - - - - - diff --git a/htmlReport/ns-6/sources/source-1.html b/htmlReport/ns-6/sources/source-1.html deleted file mode 100644 index f5adfba..0000000 --- a/htmlReport/ns-6/sources/source-1.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - Coverage Report > JpaFileRepositoryAdapter - - - - - - -
- - -

Coverage Summary for Class: JpaFileRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
JpaFileRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (4/4) - - - - 100% - - - (8/8) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.adpters;
- 
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.file.FileEntity;
- import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaFileRepository;
- import org.springframework.stereotype.Component;
- 
- import java.util.List;
- 
- @Component
- public class JpaFileRepositoryAdapter implements FileRepository {
- 
-     private final JpaFileRepository fileRepository;
- 
-     public JpaFileRepositoryAdapter(JpaFileRepository fileRepository) {
-         this.fileRepository = fileRepository;
-     }
- 
-     @Override
-     public void save(File file) {
-         FileEntity fileEntity = FileEntity.fromDomainToModel(file);
-         fileRepository.save(fileEntity);
-     }
- 
-     @Override
-     public void delete(Long id) {
-         fileRepository.deleteById(id);
-     }
- 
-     @Override
-     public List<FileResponse> listAll() {
-         return fileRepository.findAll().stream()
-                 .map(FileEntity::toResponse)
-                 .toList();
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-6/sources/source-2.html b/htmlReport/ns-6/sources/source-2.html deleted file mode 100644 index 51314a4..0000000 --- a/htmlReport/ns-6/sources/source-2.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - Coverage Report > JpaPostRepositoryAdapter - - - - - - -
- - -

Coverage Summary for Class: JpaPostRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
JpaPostRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (19/19) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.adpters;
- 
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
- import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository;
- import org.springframework.data.domain.Page;
- import org.springframework.data.domain.Pageable;
- import org.springframework.stereotype.Component;
- 
- import java.util.List;
- 
- @Component
- public class JpaPostRepositoryAdapter implements PostRepository {
-     private final JpaPostRepository jpaPostRepository;
- 
-     public JpaPostRepositoryAdapter(JpaPostRepository jpaPostRepository) {
-         this.jpaPostRepository = jpaPostRepository;
-     }
- 
-     @Override
-     public String save(Post post) {
-         PostEntity postToSave = PostEntity.fromModel(post);
-         PostEntity postSaved = jpaPostRepository.save(postToSave);
-         return postSaved.getSlug();
-     }
- 
-     @Override
-     public void delete(Long id) {
-         this.findById(id);
-         jpaPostRepository.deleteById(id);
-     }
- 
-     @Override
-     public void update(Long id, Post post) {
-         this.findById(id);
-         PostEntity postToUpdate = PostEntity.fromModel(post);
-         postToUpdate.setId(id);
-         jpaPostRepository.save(postToUpdate);
-     }
- 
-     @Override
-     public Page<Post> listAll(Pageable pageable) {
-         return jpaPostRepository.findAll(pageable)
-                 .map(postEntity -> PostEntity.toModel(postEntity));
-     }
- 
-     @Override
-     public Post findBySlug(String slug) {
-         return jpaPostRepository.findBySlug(slug)
-                 .map(postEntity -> PostEntity.toModel(postEntity))
-                 .orElseThrow(() -> new RuntimeException("Post not found"));
-     }
- 
-     @Override
-     public Post findById(Long id) {
-         return jpaPostRepository.findById(id)
-                 .map(postEntity -> PostEntity.toModel(postEntity))
-                 .orElseThrow(() -> new RuntimeException("Post not found"));
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-6/sources/source-3.html b/htmlReport/ns-6/sources/source-3.html deleted file mode 100644 index 8430b57..0000000 --- a/htmlReport/ns-6/sources/source-3.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - Coverage Report > JpaUserRepositoryAdapter - - - - - - -
- - -

Coverage Summary for Class: JpaUserRepositoryAdapter (com.institutosemprealerta.semprealerta.infrastructure.adpters)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
JpaUserRepositoryAdapter - - 100% - - - (1/1) - - - - 100% - - - (7/7) - - - - 100% - - - (14/14) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.adpters;
- 
- import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository;
- import org.springframework.stereotype.Component;
- 
- import java.util.Optional;
- 
- @Component
- public class JpaUserRepositoryAdapter implements UserRepository {
- 
-     private final JpaUserRepository userRepository;
- 
-     public JpaUserRepositoryAdapter(JpaUserRepository jpaUserRepository) {
-         this.userRepository = jpaUserRepository;
-     }
- 
-     @Override
-     public void save(User user) {
-         this.userRepository.save(user);
-     }
- 
-     @Override
-     public Optional<User> findById(int id) {
-         return this.userRepository.findById(id);
-     }
- 
-     @Override
-     public void update(int id, User user) {
-         User userToUpdate = this.userRepository.findById(id)
-                 .orElseThrow(() -> new RuntimeException("User not found"));
- 
-         user.setId(userToUpdate.getId());
-         user.setRegistration(userToUpdate.getRegistration());
- 
-         this.userRepository.save(user);
-     }
- 
-     @Override
-     public void delete(int id) {
-         User userToDelete = this.userRepository.findById(id)
-                 .orElseThrow(() -> new RuntimeException("User not found"));
- 
-         this.userRepository.delete(userToDelete);
-     }
- 
-     @Override
-     public Optional<User> findByRegistration(String registration) {
-         return this.userRepository.findByRegistration(registration);
-     }
- 
-     @Override
-     public Optional<User> findByEmail(String email) {
-         return this.userRepository.findByEmail(email);
-     }
- 
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-7/index.html b/htmlReport/ns-7/index.html deleted file mode 100644 index 1f07ebd..0000000 --- a/htmlReport/ns-7/index.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_BLOCK.html b/htmlReport/ns-7/index_SORT_BY_BLOCK.html deleted file mode 100644 index e957d44..0000000 --- a/htmlReport/ns-7/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 3544e22..0000000 --- a/htmlReport/ns-7/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_CLASS.html b/htmlReport/ns-7/index_SORT_BY_CLASS.html deleted file mode 100644 index d6e3a8b..0000000 --- a/htmlReport/ns-7/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index c83d6eb..0000000 --- a/htmlReport/ns-7/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_LINE.html b/htmlReport/ns-7/index_SORT_BY_LINE.html deleted file mode 100644 index c33a74e..0000000 --- a/htmlReport/ns-7/index_SORT_BY_LINE.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 847eb4f..0000000 --- a/htmlReport/ns-7/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_METHOD.html b/htmlReport/ns-7/index_SORT_BY_METHOD.html deleted file mode 100644 index 0188531..0000000 --- a/htmlReport/ns-7/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 756e799..0000000 --- a/htmlReport/ns-7/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 4a81a69..0000000 --- a/htmlReport/ns-7/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.config - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.config

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.config - - 0% - - - (0/2) - - - - 0% - - - (0/6) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
- - - - - - diff --git a/htmlReport/ns-7/sources/source-1.html b/htmlReport/ns-7/sources/source-1.html deleted file mode 100644 index 714fa33..0000000 --- a/htmlReport/ns-7/sources/source-1.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - Coverage Report > ApplicationConfig - - - - - - -
- - -

Coverage Summary for Class: ApplicationConfig (com.institutosemprealerta.semprealerta.infrastructure.config)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
ApplicationConfig - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.config;
- 
- import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator;
- import com.institutosemprealerta.semprealerta.domain.ports.in.impl.SlugifySlugGenerator;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.annotation.Configuration;
- import org.springframework.data.domain.PageRequest;
- import org.springframework.data.domain.Pageable;
- import org.springframework.data.domain.Sort;
- 
- @Configuration
- public class ApplicationConfig {
- 
-     @Bean
-     public SlugGenerator slugGenerator() {
-         return new SlugifySlugGenerator();
-     }
- 
-     @Bean
-     public Pageable defaultPageable() {
-         return PageRequest.of(0, 10, Sort.by("createdAt").descending());
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-7/sources/source-2.html b/htmlReport/ns-7/sources/source-2.html deleted file mode 100644 index 00e4800..0000000 --- a/htmlReport/ns-7/sources/source-2.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - Coverage Report > FileStorageProperties - - - - - - -
- - -

Coverage Summary for Class: FileStorageProperties (com.institutosemprealerta.semprealerta.infrastructure.config)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
FileStorageProperties - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/3) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.config;
- 
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.context.annotation.Configuration;
- 
- @Configuration
- @ConfigurationProperties(prefix = "file")
- public class FileStorageProperties {
-     private String uploadDir;
- 
-     public String getUploadDir() {
-         return uploadDir;
-     }
- 
-     public void setUploadDir(String uploadDir) {
-         this.uploadDir = uploadDir;
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-8/index.html b/htmlReport/ns-8/index.html deleted file mode 100644 index 121240f..0000000 --- a/htmlReport/ns-8/index.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_BLOCK.html b/htmlReport/ns-8/index_SORT_BY_BLOCK.html deleted file mode 100644 index 5df34b7..0000000 --- a/htmlReport/ns-8/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index d1266a5..0000000 --- a/htmlReport/ns-8/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_CLASS.html b/htmlReport/ns-8/index_SORT_BY_CLASS.html deleted file mode 100644 index 25826ed..0000000 --- a/htmlReport/ns-8/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 2bcb232..0000000 --- a/htmlReport/ns-8/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_LINE.html b/htmlReport/ns-8/index_SORT_BY_LINE.html deleted file mode 100644 index 2dfa457..0000000 --- a/htmlReport/ns-8/index_SORT_BY_LINE.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 3d6ff3c..0000000 --- a/htmlReport/ns-8/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_METHOD.html b/htmlReport/ns-8/index_SORT_BY_METHOD.html deleted file mode 100644 index 7c28d61..0000000 --- a/htmlReport/ns-8/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index f02afc5..0000000 --- a/htmlReport/ns-8/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 1d626ad..0000000 --- a/htmlReport/ns-8/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.controllers - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.controllers

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.controllers - - 100% - - - (3/3) - - - - 93.8% - - - (15/16) - - - - 88.1% - - - (37/42) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
- - - - - - diff --git a/htmlReport/ns-8/sources/source-1.html b/htmlReport/ns-8/sources/source-1.html deleted file mode 100644 index c237aed..0000000 --- a/htmlReport/ns-8/sources/source-1.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - Coverage Report > FilesStorageController - - - - - - -
- - -

Coverage Summary for Class: FilesStorageController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
FilesStorageController - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 75% - - - (15/20) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.controllers;
- 
- import com.institutosemprealerta.semprealerta.application.service.StorageService;
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- import jakarta.servlet.http.HttpServletRequest;
- import org.springframework.core.io.Resource;
- import org.springframework.http.HttpHeaders;
- import org.springframework.http.MediaType;
- import org.springframework.http.ResponseEntity;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.*;
- import org.springframework.web.multipart.MultipartFile;
- import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
- 
- import java.io.IOException;
- import java.util.List;
- 
- @Controller
- @RequestMapping("/api/v1/files")
- public class FilesStorageController {
-     private StorageService storageService;
- 
-     public FilesStorageController(StorageService storageService) {
-         this.storageService = storageService;
-     }
- 
-     @PostMapping("/upload")
-     public ResponseEntity<String> uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("file_type") String fileType) {
- 
-         String fileName = storageService.store(file, fileType);
- 
-         String fileDownloadUri = ServletUriComponentsBuilder.fromCurrentContextPath()
-                 .path("/api/v1/files/download/")
-                 .path(fileName)
-                 .toUriString();
- 
-         return ResponseEntity.ok("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri);
-     }
- 
-     @GetMapping("/download/{fileName:.+}")
-     @ResponseBody
-     public ResponseEntity<Resource> downloadFile(
-             @PathVariable String fileName,
-             HttpServletRequest request
-     ) {
- 
-         try {
-             Resource resource = storageService.loadAsResource(fileName);
-             String contentType = request.getServletContext().getMimeType(resource.getFile().getAbsolutePath());
- 
-             if (contentType == null) {
-                 contentType = MediaType.APPLICATION_OCTET_STREAM.getType();
-             }
- 
-             return ResponseEntity.ok()
-                     .contentType(MediaType.parseMediaType(contentType))
-                     .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
-                     .body(resource);
-         } catch (IOException e) {
-             throw new RuntimeException(e);
-         }
-     }
- 
-     @GetMapping("/list")
-     public ResponseEntity<List<FileResponse>> listFiles() throws IOException {
-         List<FileResponse> fileNames = storageService.loadAll();
- 
-         return ResponseEntity.ok(fileNames);
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-8/sources/source-2.html b/htmlReport/ns-8/sources/source-2.html deleted file mode 100644 index 043acfb..0000000 --- a/htmlReport/ns-8/sources/source-2.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - Coverage Report > PostController - - - - - - -
- - -

Coverage Summary for Class: PostController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
PostController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (10/10) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.controllers;
- 
- import com.institutosemprealerta.semprealerta.application.service.PostService;
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import org.springframework.data.domain.Page;
- import org.springframework.data.domain.Pageable;
- import org.springframework.http.ResponseEntity;
- import org.springframework.web.bind.annotation.*;
- 
- import java.net.URI;
- import java.util.List;
- 
- @RestController
- @RequestMapping("api/v1/posts")
- public class PostController {
-     private final PostService postService;
- 
-     public PostController(PostService postService) {
-         this.postService = postService;
-     }
- 
-     @GetMapping
-     public ResponseEntity<Page<Post>> getAllPosts(Pageable pageable) {
-         return ResponseEntity.ok(postService.listAll(pageable));
-     }
- 
-     @PostMapping
-     public ResponseEntity<?> createPost(@RequestBody Post post) {
-         String slug = postService.save(post);
-         return ResponseEntity.created(URI.create("/api/v1/posts/" + slug)).build();
-     }
- 
-     @GetMapping("/{slug}")
-     public ResponseEntity<Post> getPostBySlug(@PathVariable String slug) {
-         return ResponseEntity.ok(postService.findBySlug(slug));
-     }
- 
-     @PutMapping("/{id}")
-     public ResponseEntity<?> updatePost(@PathVariable Long id, @RequestBody Post post) {
-         postService.update(id, post);
-         return ResponseEntity.noContent().build();
-     }
- 
-     @DeleteMapping("/{id}")
-     public ResponseEntity<?> deletePost(@PathVariable Long id) {
-         postService.delete(id);
-         return ResponseEntity.noContent().build();
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-8/sources/source-3.html b/htmlReport/ns-8/sources/source-3.html deleted file mode 100644 index 02176c9..0000000 --- a/htmlReport/ns-8/sources/source-3.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - Coverage Report > UserController - - - - - - -
- - -

Coverage Summary for Class: UserController (com.institutosemprealerta.semprealerta.infrastructure.controllers)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
UserController - - 100% - - - (1/1) - - - - 100% - - - (6/6) - - - - 100% - - - (12/12) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.controllers;
- 
- import com.institutosemprealerta.semprealerta.application.service.UserService;
- import com.institutosemprealerta.semprealerta.domain.model.UserDTO;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- import jakarta.validation.Valid;
- import org.apache.catalina.connector.Response;
- import org.springframework.http.HttpStatus;
- import org.springframework.http.ResponseEntity;
- import org.springframework.web.bind.annotation.*;
- 
- @RestController
- @RequestMapping("api/v1/user")
- public class UserController {
- 
-     private final UserService userService;
- 
-     public UserController(UserService userService) {
-         this.userService = userService;
-     }
- 
-     @PostMapping
-     public ResponseEntity<?> createUser(@Valid @RequestBody UserDTO user) {
-         userService.save(user.toDomain());
-         return ResponseEntity.status(HttpStatus.CREATED).build();
-     }
- 
-     @GetMapping("/{id}")
-     public ResponseEntity<UserResponse> findById(@PathVariable int id) {
-         User userFound = userService.findById(id);
-         return ResponseEntity.ok().body(UserResponse.toResponse(userFound));
-     }
- 
-     @GetMapping("/registration/{reg}")
-     public ResponseEntity<UserResponse> findByRegistration(@PathVariable String reg) {
-         User userFound = userService.findByRegistration(reg);
-         return ResponseEntity.ok().body(UserResponse.toResponse(userFound));
-     }
- 
-     @PutMapping("/{id}")
-     public ResponseEntity<?> updateUser(@PathVariable int id, @RequestBody UserDTO user) {
-         userService.update(id, user.toDomain());
-         return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
-     }
- 
-     @DeleteMapping("/{id}")
-     public ResponseEntity<?> deleteUser(@PathVariable int id) {
-         userService.delete(id);
-         return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-9/index.html b/htmlReport/ns-9/index.html deleted file mode 100644 index b48830c..0000000 --- a/htmlReport/ns-9/index.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_BLOCK.html b/htmlReport/ns-9/index_SORT_BY_BLOCK.html deleted file mode 100644 index e90e497..0000000 --- a/htmlReport/ns-9/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index a015536..0000000 --- a/htmlReport/ns-9/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_CLASS.html b/htmlReport/ns-9/index_SORT_BY_CLASS.html deleted file mode 100644 index 3138eea..0000000 --- a/htmlReport/ns-9/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 76fb487..0000000 --- a/htmlReport/ns-9/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_LINE.html b/htmlReport/ns-9/index_SORT_BY_LINE.html deleted file mode 100644 index 72acbd4..0000000 --- a/htmlReport/ns-9/index_SORT_BY_LINE.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 9c4e609..0000000 --- a/htmlReport/ns-9/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_METHOD.html b/htmlReport/ns-9/index_SORT_BY_METHOD.html deleted file mode 100644 index c8ad9fb..0000000 --- a/htmlReport/ns-9/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index a43d322..0000000 --- a/htmlReport/ns-9/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 831f696..0000000 --- a/htmlReport/ns-9/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.file - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.file

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.file - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
FileEntity - - 100% - - - (1/1) - - - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
- - - - - - diff --git a/htmlReport/ns-9/sources/source-1.html b/htmlReport/ns-9/sources/source-1.html deleted file mode 100644 index e669e42..0000000 --- a/htmlReport/ns-9/sources/source-1.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - - Coverage Report > FileEntity - - - - - - -
- - -

Coverage Summary for Class: FileEntity (com.institutosemprealerta.semprealerta.infrastructure.entity.file)

- - - - - - - - - - - - - - - - - - - - - - - - -
Class - Method, % - - Line, % -
FileEntity - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
FileEntity$HibernateInstantiator$lot7KrLx
FileEntity$HibernateProxy$uNG3sB2a
Total - - 100% - - - (10/10) - - - - 100% - - - (21/21) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.file;
- 
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- import jakarta.persistence.*;
- import lombok.Getter;
- import lombok.Setter;
- import org.hibernate.annotations.CreationTimestamp;
- 
- import java.time.LocalDateTime;
- 
- @Entity
- @Table(name = "files")
- @Getter
- @Setter
- public class FileEntity {
-     @Id
-     @GeneratedValue(strategy = GenerationType.IDENTITY)
-     private Long id;
- 
-     private String fileName;
-     private String fileDownloadUri;
-     private String fileType;
- 
-     @CreationTimestamp
-     private LocalDateTime uploadDate;
- 
-     public FileEntity(String fileName, String fileDownloadUri, String fileType) {
-         this.fileName = fileName;
-         this.fileDownloadUri = fileDownloadUri;
-         this.fileType = fileType;
-     }
- 
-     public FileEntity() {
-     }
- 
-     public static FileEntity fromDomainToModel(File file) {
-         return new FileEntity(
-                 file.getFileName(),
-                 file.getFileDownloadUri(),
-                 file.getFileType()
-         );
-     }
- 
-     public static FileResponse toResponse(FileEntity fileEntity) {
-         return new FileResponse(
-                 fileEntity.getId(),
-                 fileEntity.getFileName(),
-                 fileEntity.getFileDownloadUri(),
-                 fileEntity.getFileType(),
-                 fileEntity.getUploadDate()
-         );
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-a/index.html b/htmlReport/ns-a/index.html deleted file mode 100644 index b2d036b..0000000 --- a/htmlReport/ns-a/index.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_BLOCK.html b/htmlReport/ns-a/index_SORT_BY_BLOCK.html deleted file mode 100644 index cd06a3f..0000000 --- a/htmlReport/ns-a/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 569c651..0000000 --- a/htmlReport/ns-a/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_CLASS.html b/htmlReport/ns-a/index_SORT_BY_CLASS.html deleted file mode 100644 index b46de25..0000000 --- a/htmlReport/ns-a/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 3baa618..0000000 --- a/htmlReport/ns-a/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_LINE.html b/htmlReport/ns-a/index_SORT_BY_LINE.html deleted file mode 100644 index b7101ca..0000000 --- a/htmlReport/ns-a/index_SORT_BY_LINE.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 45a6955..0000000 --- a/htmlReport/ns-a/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_METHOD.html b/htmlReport/ns-a/index_SORT_BY_METHOD.html deleted file mode 100644 index 30f29e3..0000000 --- a/htmlReport/ns-a/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 0d997f4..0000000 --- a/htmlReport/ns-a/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 7655798..0000000 --- a/htmlReport/ns-a/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.post - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.post

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.post - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
PostEntity - - 100% - - - (1/1) - - - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
- - - - - - diff --git a/htmlReport/ns-a/sources/source-1.html b/htmlReport/ns-a/sources/source-1.html deleted file mode 100644 index a90952b..0000000 --- a/htmlReport/ns-a/sources/source-1.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - Coverage Report > PostEntity - - - - - - -
- - -

Coverage Summary for Class: PostEntity (com.institutosemprealerta.semprealerta.infrastructure.entity.post)

- - - - - - - - - - - - - - - - - - - - - - - - -
Class - Method, % - - Line, % -
PostEntity - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
PostEntity$HibernateInstantiator$VnkNxDIT
PostEntity$HibernateProxy$0FgOcQ4W
Total - - 92.3% - - - (12/13) - - - - 96.6% - - - (28/29) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.post;
- 
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import jakarta.persistence.*;
- import lombok.Getter;
- import lombok.Setter;
- import org.hibernate.annotations.CreationTimestamp;
- 
- import java.time.LocalDateTime;
- 
- @Setter
- @Getter
- @Entity
- @Table(name = "post")
- public class PostEntity {
-     @Id
-     @GeneratedValue(strategy = GenerationType.IDENTITY)
-     private Long id;
-     @Column(nullable = false)
-     private String title;
-     @Column(nullable = false)
-     private String slug;
-     @Column(columnDefinition = "TEXT")
-     private String content;
-     private String banner;
-     @CreationTimestamp
-     @Column(nullable = false, updatable = false)
-     private LocalDateTime createdAt;
- 
-     public PostEntity() {
-     }
- 
-     public PostEntity(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) {
-         this.id = id;
-         this.title = title;
-         this.slug = slug;
-         this.content = content;
-         this.banner = banner;
-         this.createdAt = createdAt;
-     }
- 
-     public PostEntity(String title, String slug, String content, String banner) {
-         this.title = title;
-         this.slug = slug;
-         this.content = content;
-         this.banner = banner;
-     }
- 
-     public static PostEntity fromModel(Post post) {
-         PostEntity postEntity = new PostEntity();
-         postEntity.setId(post.getId());
-         postEntity.setTitle(post.getTitle());
-         postEntity.setSlug(post.getSlug());
-         postEntity.setContent(post.getContent());
-         postEntity.setBanner(post.getBanner());
-         return postEntity;
-     }
- 
-     public static Post toModel(PostEntity postEntity) {
-         return new Post(postEntity.getId(), postEntity.getTitle(), postEntity.getSlug(), postEntity.getContent(), postEntity.getBanner(), postEntity.getCreatedAt());
-     }
- 
-     public Post toModel() {
-         return new Post(this.getId(), this.getTitle(), this.getSlug(), this.getContent(), this.getBanner(), this.getCreatedAt());
-     }
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-b/index.html b/htmlReport/ns-b/index.html deleted file mode 100644 index 207fabe..0000000 --- a/htmlReport/ns-b/index.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_BLOCK.html b/htmlReport/ns-b/index_SORT_BY_BLOCK.html deleted file mode 100644 index 8e2692c..0000000 --- a/htmlReport/ns-b/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index c23f9a1..0000000 --- a/htmlReport/ns-b/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_CLASS.html b/htmlReport/ns-b/index_SORT_BY_CLASS.html deleted file mode 100644 index 49e64b6..0000000 --- a/htmlReport/ns-b/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 42dce9a..0000000 --- a/htmlReport/ns-b/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_LINE.html b/htmlReport/ns-b/index_SORT_BY_LINE.html deleted file mode 100644 index 41c1ba4..0000000 --- a/htmlReport/ns-b/index_SORT_BY_LINE.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index dc2d558..0000000 --- a/htmlReport/ns-b/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_METHOD.html b/htmlReport/ns-b/index_SORT_BY_METHOD.html deleted file mode 100644 index bf7470d..0000000 --- a/htmlReport/ns-b/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 7d548d1..0000000 --- a/htmlReport/ns-b/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 1781deb..0000000 --- a/htmlReport/ns-b/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.infrastructure.entity.user - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.infrastructure.entity.user

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.infrastructure.entity.user - - 100% - - - (4/4) - - - - 81.2% - - - (26/32) - - - - 75.9% - - - (41/54) - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
User - - 100% - - - (1/1) - - - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
- - - - - - diff --git a/htmlReport/ns-b/sources/source-1.html b/htmlReport/ns-b/sources/source-1.html deleted file mode 100644 index 0612810..0000000 --- a/htmlReport/ns-b/sources/source-1.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - Coverage Report > Address - - - - - - -
- - -

Coverage Summary for Class: Address (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
Address - - 100% - - - (1/1) - - - - 71.4% - - - (5/7) - - - - 71.4% - - - (5/7) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
- 
- import jakarta.persistence.Embeddable;
- import lombok.AllArgsConstructor;
- import lombok.Getter;
- import lombok.NoArgsConstructor;
- import lombok.Setter;
- 
- @Getter
- @Setter
- @AllArgsConstructor
- @NoArgsConstructor
- @Embeddable
- public class Address {
-     private String street;
-     private String number;
-     private String city;
-     private String zipCode;
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-b/sources/source-2.html b/htmlReport/ns-b/sources/source-2.html deleted file mode 100644 index 7d12b57..0000000 --- a/htmlReport/ns-b/sources/source-2.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - Coverage Report > Contact - - - - - - -
- - -

Coverage Summary for Class: Contact (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
Contact - - 100% - - - (1/1) - - - - 80% - - - (4/5) - - - - 80% - - - (4/5) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
- 
- import jakarta.persistence.Embeddable;
- import lombok.AllArgsConstructor;
- import lombok.Getter;
- import lombok.NoArgsConstructor;
- import lombok.Setter;
- 
- @Getter
- @Setter
- @NoArgsConstructor
- @AllArgsConstructor
- @Embeddable
- public class Contact {
-     private String email;
-     private String phone;
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-b/sources/source-3.html b/htmlReport/ns-b/sources/source-3.html deleted file mode 100644 index 7e5226a..0000000 --- a/htmlReport/ns-b/sources/source-3.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - Coverage Report > User - - - - - - -
- - -

Coverage Summary for Class: User (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

- - - - - - - - - - - - - - - - - - - - - - - - -
Class - Method, % - - Line, % -
User - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
User$HibernateInstantiator$AfjpK58m
User$HibernateProxy$TymOTvJg
Total - - 87.5% - - - (14/16) - - - - 75% - - - (27/36) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
- 
- 
- import com.institutosemprealerta.semprealerta.domain.model.UserDTO;
- import com.institutosemprealerta.semprealerta.utils.DateManipulation;
- import jakarta.persistence.*;
- import lombok.Getter;
- import lombok.Setter;
- import org.hibernate.annotations.CreationTimestamp;
- 
- import java.time.LocalDate;
- import java.time.LocalDateTime;
- import java.util.Random;
- 
- 
- @Entity
- @Table(name = "users")
- @Getter
- @Setter
- public class User {
-     @Id
-     @GeneratedValue(strategy = GenerationType.IDENTITY)
-     private Long id;
-     @Column(unique = true)
-     private String registration;
-     private String name;
-     private String password;
-     private String gender;
-     private LocalDate birthDate;
- 
-     private UserRoles roles;
-     @Embedded
-     private Contact contact;
- 
-     @Embedded
-     private Address address;
- 
-     @CreationTimestamp
-     @Column(name = "created_at", updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
-     private LocalDateTime createdAt;
- 
-     public User() {
-     }
- 
- 
-     public User(String name, String password, String gender, LocalDate birthDate, UserRoles roles, Contact contact, Address address) {
-         this.name = name;
-         this.password = password;
-         this.gender = gender;
-         this.birthDate = birthDate;
-         this.roles = roles;
-         this.contact = contact;
-         this.address = address;
-     }
- 
- 
- 
-     @PrePersist
-     public void generateRegistration() {
-         String prefix = this.name.substring(0, 3).toLowerCase() + "-";
-         this.registration = generateRegistration(prefix);
-     }
- 
-     private String  generateRegistration(String prefix) {
-         StringBuilder registration = new StringBuilder(prefix);
-         Random random = new Random();
- 
-         for (int i = 0; i < 8; i++) {
-             int digit = random.nextInt(10);
-             registration.append(digit);
-         }
- 
-         return registration.toString();
-     }
- 
-     public User fromModelToDomain(UserDTO dto) {
-         //LocalDate birth = DateManipulation.stringToLocalDate(dto.birthDate());
-         return new User(
-                 dto.name(),
-                 dto.password(),
-                 dto.gender(),
-                 dto.birthDate(),
-                 dto.roles(),
-                 new Contact(dto.email(), dto.phone()),
-                 new Address(dto.street(), dto.number(), dto.city(), dto.zipCode())
-         );
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-b/sources/source-4.html b/htmlReport/ns-b/sources/source-4.html deleted file mode 100644 index 019711d..0000000 --- a/htmlReport/ns-b/sources/source-4.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - Coverage Report > UserRoles - - - - - - -
- - -

Coverage Summary for Class: UserRoles (com.institutosemprealerta.semprealerta.infrastructure.entity.user)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
UserRoles - - 100% - - - (1/1) - - - - 75% - - - (3/4) - - - - 83.3% - - - (5/6) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.infrastructure.entity.user;
- 
- public enum UserRoles {
-     ADMIN("ADMIN"),
-     USER("USER");
- 
-     private final String role;
- 
-     UserRoles(String role) {
-         this.role = role;
-     }
- 
-     public String getRole() {
-         return role;
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-c/index.html b/htmlReport/ns-c/index.html deleted file mode 100644 index 5a2affe..0000000 --- a/htmlReport/ns-c/index.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_BLOCK.html b/htmlReport/ns-c/index_SORT_BY_BLOCK.html deleted file mode 100644 index 073d7c8..0000000 --- a/htmlReport/ns-c/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 11f4dad..0000000 --- a/htmlReport/ns-c/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_CLASS.html b/htmlReport/ns-c/index_SORT_BY_CLASS.html deleted file mode 100644 index 09f3646..0000000 --- a/htmlReport/ns-c/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 7742b16..0000000 --- a/htmlReport/ns-c/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_LINE.html b/htmlReport/ns-c/index_SORT_BY_LINE.html deleted file mode 100644 index 62a445e..0000000 --- a/htmlReport/ns-c/index_SORT_BY_LINE.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 4a95dbe..0000000 --- a/htmlReport/ns-c/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_METHOD.html b/htmlReport/ns-c/index_SORT_BY_METHOD.html deleted file mode 100644 index c77ccd6..0000000 --- a/htmlReport/ns-c/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 2f37242..0000000 --- a/htmlReport/ns-c/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index e76174f..0000000 --- a/htmlReport/ns-c/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.utils - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.utils

- - - - - - - - - - - - - -
Package - Class, % - - Method, % - - Line, % -
com.institutosemprealerta.semprealerta.utils - - 0% - - - (0/2) - - - - 0% - - - (0/4) - - - - 0% - - - (0/6) - -
- -
-
- - - - - - - - - - - - - - - - - - - - -
-Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
- - - - - - diff --git a/htmlReport/ns-c/sources/source-1.html b/htmlReport/ns-c/sources/source-1.html deleted file mode 100644 index 6665931..0000000 --- a/htmlReport/ns-c/sources/source-1.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - Coverage Report > DateManipulation - - - - - - -
- - -

Coverage Summary for Class: DateManipulation (com.institutosemprealerta.semprealerta.utils)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
DateManipulation - - 0% - - - (0/1) - - - - 0% - - - (0/3) - - - - 0% - - - (0/5) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.utils;
- 
- import java.time.LocalDate;
- import java.time.format.DateTimeFormatter;
- 
- public abstract class DateManipulation {
-     public static LocalDate stringToLocalDate(String date) {
-         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-         return LocalDate.parse(date, formatter);
-     }
- 
-     public static String localDateToString(LocalDate date) {
-         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
-         return date.format(formatter);
-     }
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-c/sources/source-2.html b/htmlReport/ns-c/sources/source-2.html deleted file mode 100644 index 4ea579b..0000000 --- a/htmlReport/ns-c/sources/source-2.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - - - Coverage Report > HashGeneration - - - - - - -
- - -

Coverage Summary for Class: HashGeneration (com.institutosemprealerta.semprealerta.utils)

- - - - - - - - - - - - - - - -
Class - Class, % - - Method, % - - Line, % -
HashGeneration - - 0% - - - (0/1) - - - - 0% - - - (0/1) - - - - 0% - - - (0/1) - -
- -
-
- - -
- package com.institutosemprealerta.semprealerta.utils;
- 
- import java.util.HashSet;
- import java.util.Random;
- import java.util.Set;
- 
- public abstract class HashGeneration {
- 
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-d/index.html b/htmlReport/ns-d/index.html deleted file mode 100644 index 335a1b6..0000000 --- a/htmlReport/ns-d/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_BLOCK.html b/htmlReport/ns-d/index_SORT_BY_BLOCK.html deleted file mode 100644 index e85a315..0000000 --- a/htmlReport/ns-d/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index ce7843a..0000000 --- a/htmlReport/ns-d/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_CLASS.html b/htmlReport/ns-d/index_SORT_BY_CLASS.html deleted file mode 100644 index 3f1c513..0000000 --- a/htmlReport/ns-d/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index aab93bc..0000000 --- a/htmlReport/ns-d/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_LINE.html b/htmlReport/ns-d/index_SORT_BY_LINE.html deleted file mode 100644 index 281486d..0000000 --- a/htmlReport/ns-d/index_SORT_BY_LINE.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index a769347..0000000 --- a/htmlReport/ns-d/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_METHOD.html b/htmlReport/ns-d/index_SORT_BY_METHOD.html deleted file mode 100644 index 20adf31..0000000 --- a/htmlReport/ns-d/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 773f659..0000000 --- a/htmlReport/ns-d/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index eee8037..0000000 --- a/htmlReport/ns-d/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.in - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.in

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.in
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-d/sources/source-1.html b/htmlReport/ns-d/sources/source-1.html deleted file mode 100644 index 6dc1235..0000000 --- a/htmlReport/ns-d/sources/source-1.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - Coverage Report > SlugGenerator - - - - - - -
- - -

Coverage Summary for Class: SlugGenerator (com.institutosemprealerta.semprealerta.domain.ports.in)

- - - - - - - - - - - - - - - - - - -
Class
SlugGenerator$MockitoMock$Uh0DcWOO
SlugGenerator$MockitoMock$Uh0DcWOO$auxiliary$iHPGM3rW
SlugGenerator$MockitoMock$Uh0DcWOO$auxiliary$ZOm3ibOz
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.in;
- 
- public interface SlugGenerator {
-     String generate(String input);
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-e/index.html b/htmlReport/ns-e/index.html deleted file mode 100644 index 6cf07b1..0000000 --- a/htmlReport/ns-e/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_BLOCK.html b/htmlReport/ns-e/index_SORT_BY_BLOCK.html deleted file mode 100644 index 80e68e6..0000000 --- a/htmlReport/ns-e/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index ad703de..0000000 --- a/htmlReport/ns-e/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_CLASS.html b/htmlReport/ns-e/index_SORT_BY_CLASS.html deleted file mode 100644 index 678175f..0000000 --- a/htmlReport/ns-e/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index fc31bc4..0000000 --- a/htmlReport/ns-e/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_LINE.html b/htmlReport/ns-e/index_SORT_BY_LINE.html deleted file mode 100644 index 6e26099..0000000 --- a/htmlReport/ns-e/index_SORT_BY_LINE.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 7eea42d..0000000 --- a/htmlReport/ns-e/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_METHOD.html b/htmlReport/ns-e/index_SORT_BY_METHOD.html deleted file mode 100644 index d100bc9..0000000 --- a/htmlReport/ns-e/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index e036a96..0000000 --- a/htmlReport/ns-e/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 5694cd6..0000000 --- a/htmlReport/ns-e/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.domain.ports.out - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.domain.ports.out

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.domain.ports.out
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-e/sources/source-1.html b/htmlReport/ns-e/sources/source-1.html deleted file mode 100644 index dabac30..0000000 --- a/htmlReport/ns-e/sources/source-1.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - Coverage Report > UserRepository - - - - - - -
- - -

Coverage Summary for Class: UserRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

- - - - - - - - - - - - - - - - - - -
Class
UserRepository$MockitoMock$43J0nWYK
UserRepository$MockitoMock$43J0nWYK$auxiliary$xupH4qnj
UserRepository$MockitoMock$43J0nWYK$auxiliary$y2F2NXYv
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- 
- import java.util.Optional;
- 
- public interface UserRepository {
-     void save(User user);
-     Optional<User> findById(int id);
-     void update(int id, User user);
-     void delete(int id);
-     Optional<User> findByRegistration(String registration);
-     Optional<User> findByEmail(String email);
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-e/sources/source-2.html b/htmlReport/ns-e/sources/source-2.html deleted file mode 100644 index a2b448b..0000000 --- a/htmlReport/ns-e/sources/source-2.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - Coverage Report > PostRepository - - - - - - -
- - -

Coverage Summary for Class: PostRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

- - - - - - - - - - - - - - - - - - -
Class
PostRepository$MockitoMock$FXmIOh2S
PostRepository$MockitoMock$FXmIOh2S$auxiliary$XCsBBgYQ
PostRepository$MockitoMock$FXmIOh2S$auxiliary$yhxdjeMl
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out;
- 
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity;
- import org.springframework.data.domain.Page;
- import org.springframework.data.domain.Pageable;
- 
- import java.util.List;
- 
- public interface PostRepository {
-     String save(Post post);
- 
-     void delete(Long id);
- 
-     void update(Long id, Post post);
- 
-     Page<Post> listAll(Pageable pageable);
- 
-     Post findBySlug(String slug);
-     Post findById(Long id);
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-e/sources/source-3.html b/htmlReport/ns-e/sources/source-3.html deleted file mode 100644 index f33a3e7..0000000 --- a/htmlReport/ns-e/sources/source-3.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - Coverage Report > FileRepository - - - - - - -
- - -

Coverage Summary for Class: FileRepository (com.institutosemprealerta.semprealerta.domain.ports.out)

- - - - - - - - - - - - - - - - - - -
Class
FileRepository$MockitoMock$bdzjIbdl
FileRepository$MockitoMock$bdzjIbdl$auxiliary$dGUXK8ZU
FileRepository$MockitoMock$bdzjIbdl$auxiliary$jV8676Io
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.domain.ports.out;
- 
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- 
- import java.util.List;
- 
- public interface FileRepository {
-     void save(File file);
-     void delete(Long id);
-     List<FileResponse> listAll();
- 
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-f/index.html b/htmlReport/ns-f/index.html deleted file mode 100644 index 2b3720d..0000000 --- a/htmlReport/ns-f/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_BLOCK.html b/htmlReport/ns-f/index_SORT_BY_BLOCK.html deleted file mode 100644 index 4f4d47d..0000000 --- a/htmlReport/ns-f/index_SORT_BY_BLOCK.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html b/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html deleted file mode 100644 index 4ecd10a..0000000 --- a/htmlReport/ns-f/index_SORT_BY_BLOCK_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_CLASS.html b/htmlReport/ns-f/index_SORT_BY_CLASS.html deleted file mode 100644 index 28d33a7..0000000 --- a/htmlReport/ns-f/index_SORT_BY_CLASS.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html b/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html deleted file mode 100644 index 4b7c1bf..0000000 --- a/htmlReport/ns-f/index_SORT_BY_CLASS_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_LINE.html b/htmlReport/ns-f/index_SORT_BY_LINE.html deleted file mode 100644 index 7288496..0000000 --- a/htmlReport/ns-f/index_SORT_BY_LINE.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html b/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html deleted file mode 100644 index 54ebba5..0000000 --- a/htmlReport/ns-f/index_SORT_BY_LINE_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_METHOD.html b/htmlReport/ns-f/index_SORT_BY_METHOD.html deleted file mode 100644 index 6a202e2..0000000 --- a/htmlReport/ns-f/index_SORT_BY_METHOD.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html b/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html deleted file mode 100644 index 5d635c8..0000000 --- a/htmlReport/ns-f/index_SORT_BY_METHOD_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html b/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html deleted file mode 100644 index 9d3dd77..0000000 --- a/htmlReport/ns-f/index_SORT_BY_NAME_DESC.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Coverage Report > com.institutosemprealerta.semprealerta.application.service - - - - - - -
- - - -

Coverage Summary for Package: com.institutosemprealerta.semprealerta.application.service

- - - - - - - -
Package
com.institutosemprealerta.semprealerta.application.service
- -
-
- - - - - -
-Class
- -
- - - - - - diff --git a/htmlReport/ns-f/sources/source-1.html b/htmlReport/ns-f/sources/source-1.html deleted file mode 100644 index d84db5d..0000000 --- a/htmlReport/ns-f/sources/source-1.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Coverage Report > PostService - - - - - - -
- - -

Coverage Summary for Class: PostService (com.institutosemprealerta.semprealerta.application.service)

- - - - - - - - - - - - - - - - - - -
Class
PostService$MockitoMock$MVEKQJkO
PostService$MockitoMock$MVEKQJkO$auxiliary$4qSCe2Cl
PostService$MockitoMock$MVEKQJkO$auxiliary$I1PVc0FV
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service;
- 
- import com.institutosemprealerta.semprealerta.domain.model.Post;
- import org.springframework.data.domain.Page;
- import org.springframework.data.domain.Pageable;
- 
- 
- import java.util.List;
- 
- public interface PostService {
-     String save(Post post);
-     void delete(Long id);
-     void update(Long id, Post post);
-     Page<Post> listAll(Pageable pageable);
- 
-     Post findBySlug(String slug);
-     Post findById(Long id);
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-f/sources/source-2.html b/htmlReport/ns-f/sources/source-2.html deleted file mode 100644 index 198374c..0000000 --- a/htmlReport/ns-f/sources/source-2.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - Coverage Report > StorageService - - - - - - -
- - -

Coverage Summary for Class: StorageService (com.institutosemprealerta.semprealerta.application.service)

- - - - - - - - - - - - - - - - - - -
Class
StorageService$MockitoMock$ok3gzlRG
StorageService$MockitoMock$ok3gzlRG$auxiliary$CDsNzSU1
StorageService$MockitoMock$ok3gzlRG$auxiliary$JZInhQqD
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service;
- 
- import com.institutosemprealerta.semprealerta.domain.model.File;
- import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse;
- import org.springframework.core.io.Resource;
- import org.springframework.web.multipart.MultipartFile;
- 
- import java.nio.file.Path;
- import java.util.List;
- import java.util.stream.Stream;
- 
- public interface StorageService {
-     void init();
-     String store(MultipartFile file, String fileType);
-     List<FileResponse> loadAll();
-     Path load(String filename);
-     Resource loadAsResource(String filename);
-     void delete(String filename);
-     void deleteAll();
- }
-
-
-
- - - - - - diff --git a/htmlReport/ns-f/sources/source-3.html b/htmlReport/ns-f/sources/source-3.html deleted file mode 100644 index 39ad11f..0000000 --- a/htmlReport/ns-f/sources/source-3.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - Coverage Report > UserService - - - - - - -
- - -

Coverage Summary for Class: UserService (com.institutosemprealerta.semprealerta.application.service)

- - - - - - - - - - - - - - - - - - -
Class
UserService$MockitoMock$iVZX1TuB
UserService$MockitoMock$iVZX1TuB$auxiliary$DLBgNvSR
UserService$MockitoMock$iVZX1TuB$auxiliary$GNdSaOGg
Total
- -
-
- - -
- package com.institutosemprealerta.semprealerta.application.service;
- 
- import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User;
- 
- public interface UserService {
-     void save(User user);
-     void update(int id, User user);
-     void delete(int id);
-     User findByRegistration(String registration);
-     User findByEmail(String email);
-     User findById(int id);
- }
-
-
-
- - - - - - diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java index 732d5f3..165f63c 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.application.service.impl; import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; import org.springframework.stereotype.Service; @@ -38,12 +39,12 @@ public User findByRegistration(String registration) { @Override public User findByEmail(String email) { return this.userRepository.findByEmail(email) - .orElseThrow(() -> new RuntimeException("User not found")); + .orElseThrow(() -> new UserNotFoundException("User not found")); } @Override public User findById(int id) { return this.userRepository.findById(id) - .orElseThrow(() -> new RuntimeException("User not found")); + .orElseThrow(() -> new UserNotFoundException("User not found")); } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/EmailAlreadyExistsException.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/EmailAlreadyExistsException.java new file mode 100644 index 0000000..f37d95e --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/EmailAlreadyExistsException.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user; + +public class EmailAlreadyExistsException extends RuntimeException { + public EmailAlreadyExistsException(String message) { + super(message); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/UserNotFoundException.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/UserNotFoundException.java new file mode 100644 index 0000000..4241ff4 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/user/UserNotFoundException.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user; + +public class UserNotFoundException extends RuntimeException { + public UserNotFoundException(String message) { + super(message); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java index f7e27a1..9875a61 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaUserRepositoryAdapter.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.adpters; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaUserRepository; import org.springframework.stereotype.Component; @@ -29,7 +30,7 @@ public Optional findById(int id) { @Override public void update(int id, User user) { User userToUpdate = this.userRepository.findById(id) - .orElseThrow(() -> new RuntimeException("User not found")); + .orElseThrow(() -> new UserNotFoundException("User not found")); user.setId(userToUpdate.getId()); user.setRegistration(userToUpdate.getRegistration()); From b2e56189d32edf293f1f708fd8601f7d5592a95d Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 11:34:01 -0300 Subject: [PATCH 44/65] feat: files and posts exceptions Signed-off-by: MatheusVict --- .../service/impl/StorageServiceImpl.java | 13 +++++++------ .../out/exceptions/file/FileNotFoundException.java | 7 +++++++ .../out/exceptions/file/InvalidFileException.java | 7 +++++++ .../out/exceptions/post/PostNotFoundException.java | 7 +++++++ .../adpters/JpaPostRepositoryAdapter.java | 5 +++-- 5 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/FileNotFoundException.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/InvalidFileException.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/post/PostNotFoundException.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java index 819acfc..a4c1f2c 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java @@ -3,6 +3,8 @@ import com.institutosemprealerta.semprealerta.application.service.StorageService; import com.institutosemprealerta.semprealerta.domain.model.File; import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.FileNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.InvalidFileException; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; import lombok.extern.log4j.Log4j2; @@ -44,7 +46,7 @@ public void init() { @Override public String store(MultipartFile file, String fileType) { if (file.getOriginalFilename() == null || file.getOriginalFilename().isEmpty()) { - throw new RuntimeException("File name is empty"); + throw new InvalidFileException("File name is empty"); } String fileName = StringUtils.cleanPath(file.getOriginalFilename()); @@ -64,7 +66,7 @@ public String store(MultipartFile file, String fileType) { this.fileRepository.save(fileData); } catch (IOException e) { - throw new RuntimeException("Could not store file " + fileName + ". Please try again!", e); + throw new InvalidFileException("Could not store file " + fileName + ". Please try again!"); } return fileName; } @@ -79,7 +81,7 @@ public List loadAll() { public Path load(String filename) { Path file = fileStorageLocation.resolve(filename).normalize(); if (!Files.exists(file)) { - throw new RuntimeException("File not found " + filename); + throw new FileNotFoundException("File not found " + filename); } return file; } @@ -90,18 +92,17 @@ public Resource loadAsResource(String filename) { try { return new UrlResource(fileUri); } catch (MalformedURLException e) { - throw new RuntimeException(e); + throw new InvalidFileException("Throwing exception when trying to read file " + filename + e.getMessage()); } } @Override public void delete(String filename) { Path file = load(filename); - try { Files.deleteIfExists(file); } catch (IOException e) { - throw new RuntimeException(e); + throw new FileNotFoundException("File not found " + filename); } } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/FileNotFoundException.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/FileNotFoundException.java new file mode 100644 index 0000000..be7a345 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/FileNotFoundException.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file; + +public class FileNotFoundException extends RuntimeException { + public FileNotFoundException(String message) { + super(message); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/InvalidFileException.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/InvalidFileException.java new file mode 100644 index 0000000..3f082a0 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/file/InvalidFileException.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file; + +public class InvalidFileException extends RuntimeException { + public InvalidFileException(String message) { + super(message); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/post/PostNotFoundException.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/post/PostNotFoundException.java new file mode 100644 index 0000000..2ac6a26 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/post/PostNotFoundException.java @@ -0,0 +1,7 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.post; + +public class PostNotFoundException extends RuntimeException { + public PostNotFoundException(String message) { + super(message); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java index bc44d38..091e8e0 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java @@ -2,6 +2,7 @@ import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.post.PostNotFoundException; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; import com.institutosemprealerta.semprealerta.infrastructure.repositories.JpaPostRepository; import org.springframework.data.domain.Page; @@ -49,13 +50,13 @@ public Page listAll(Pageable pageable) { public Post findBySlug(String slug) { return jpaPostRepository.findBySlug(slug) .map(postEntity -> PostEntity.toModel(postEntity)) - .orElseThrow(() -> new RuntimeException("Post not found")); + .orElseThrow(() -> new PostNotFoundException("Post not found")); } @Override public Post findById(Long id) { return jpaPostRepository.findById(id) .map(postEntity -> PostEntity.toModel(postEntity)) - .orElseThrow(() -> new RuntimeException("Post not found")); + .orElseThrow(() -> new PostNotFoundException("Post not found")); } } From f3f43ffdd15fdfa3b88b86452d08bd38fc955ae8 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 11:35:16 -0300 Subject: [PATCH 45/65] feat: dto valid Signed-off-by: MatheusVict --- .../semprealerta/domain/model/Post.java | 4 ++++ .../infrastructure/controllers/PostController.java | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java index ce108c6..9287c85 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java @@ -1,5 +1,6 @@ package com.institutosemprealerta.semprealerta.domain.model; +import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; @@ -10,10 +11,13 @@ public class Post { private Long id; + @NotBlank private String title; private String slug; + @NotBlank private String content; + @NotBlank private String banner; private LocalDateTime createdAt; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java index ba0ab91..2726244 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java @@ -2,6 +2,7 @@ import com.institutosemprealerta.semprealerta.application.service.PostService; import com.institutosemprealerta.semprealerta.domain.model.Post; +import jakarta.validation.Valid; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.ResponseEntity; @@ -25,7 +26,7 @@ public ResponseEntity> getAllPosts(Pageable pageable) { } @PostMapping - public ResponseEntity createPost(@RequestBody Post post) { + public ResponseEntity createPost(@Valid @RequestBody Post post) { String slug = postService.save(post); return ResponseEntity.created(URI.create("/api/v1/posts/" + slug)).build(); } @@ -36,7 +37,7 @@ public ResponseEntity getPostBySlug(@PathVariable String slug) { } @PutMapping("/{id}") - public ResponseEntity updatePost(@PathVariable Long id, @RequestBody Post post) { + public ResponseEntity updatePost(@PathVariable Long id, @Valid @RequestBody Post post) { postService.update(id, post); return ResponseEntity.noContent().build(); } From 430ece75304c0f8413766e1b7d7a27cc9fa355b0 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 12:01:25 -0300 Subject: [PATCH 46/65] feat: global exception handler Signed-off-by: MatheusVict --- .../controllers/FilesStorageController.java | 5 +- .../controllers/PostController.java | 5 +- .../controllers/UserController.java | 5 +- .../handler/GlobalExceptionHandler.java | 117 ++++++++++++++++++ .../semprealerta/domain/model/Post.java | 6 +- .../out/exceptions/ExceptionPattern.java | 20 +++ .../service/PostService.java | 2 +- .../service/StorageService.java | 2 +- .../service/UserService.java | 2 +- .../service/impl/PostServiceImpl.java | 6 +- .../service/impl/StorageServiceImpl.java | 5 +- .../service/impl/UserServiceImpl.java | 6 +- .../service/impl/PostServiceImplTest.java | 2 +- .../service/impl/StorageServiceImplTest.java | 3 +- .../service/impl/UserServiceImplTest.java | 1 + .../FilesStorageControllerTest.java | 3 +- .../controllers/PostControllerTest.java | 3 +- .../controllers/UserControllerTest.java | 3 +- 18 files changed, 165 insertions(+), 31 deletions(-) rename src/main/java/com/institutosemprealerta/semprealerta/{infrastructure => application}/controllers/FilesStorageController.java (91%) rename src/main/java/com/institutosemprealerta/semprealerta/{infrastructure => application}/controllers/PostController.java (89%) rename src/main/java/com/institutosemprealerta/semprealerta/{infrastructure => application}/controllers/UserController.java (89%) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/ExceptionPattern.java rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/PostService.java (85%) rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/StorageService.java (90%) rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/UserService.java (82%) rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/impl/PostServiceImpl.java (90%) rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/impl/StorageServiceImpl.java (95%) rename src/main/java/com/institutosemprealerta/semprealerta/{application => domain}/service/impl/UserServiceImpl.java (85%) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java similarity index 91% rename from src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java rename to src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java index 6c6f7a7..0a6e3d6 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java @@ -1,7 +1,6 @@ -package com.institutosemprealerta.semprealerta.infrastructure.controllers; +package com.institutosemprealerta.semprealerta.application.controllers; -import com.institutosemprealerta.semprealerta.application.service.StorageService; -import com.institutosemprealerta.semprealerta.domain.model.File; +import com.institutosemprealerta.semprealerta.domain.service.StorageService; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.io.Resource; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java similarity index 89% rename from src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java rename to src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java index 2726244..4ea45b0 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java @@ -1,6 +1,6 @@ -package com.institutosemprealerta.semprealerta.infrastructure.controllers; +package com.institutosemprealerta.semprealerta.application.controllers; -import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.domain.service.PostService; import com.institutosemprealerta.semprealerta.domain.model.Post; import jakarta.validation.Valid; import org.springframework.data.domain.Page; @@ -9,7 +9,6 @@ import org.springframework.web.bind.annotation.*; import java.net.URI; -import java.util.List; @RestController @RequestMapping("api/v1/posts") diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java similarity index 89% rename from src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java rename to src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java index c4c8df9..5866eba 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java @@ -1,11 +1,10 @@ -package com.institutosemprealerta.semprealerta.infrastructure.controllers; +package com.institutosemprealerta.semprealerta.application.controllers; -import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.service.UserService; import com.institutosemprealerta.semprealerta.domain.model.UserDTO; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import jakarta.validation.Valid; -import org.apache.catalina.connector.Response; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java new file mode 100644 index 0000000..e9f616f --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java @@ -0,0 +1,117 @@ +package com.institutosemprealerta.semprealerta.application.handler; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.ExceptionPattern; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.FileNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.InvalidFileException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.post.PostNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.EmailAlreadyExistsException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.FieldError; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.stream.Collectors; + +@ControllerAdvice +public class GlobalExceptionHandler { + + @ExceptionHandler(UserNotFoundException.class) + public ResponseEntity handlerUserNotFoundException(UserNotFoundException exception) { + LocalDateTime timestamp = LocalDateTime.now(); + return ResponseEntity.status(HttpStatus.NOT_FOUND).body( + ExceptionPattern.builder() + .title("User Not Found Exception") + .status(HttpStatus.NOT_FOUND.value()) + .details("User not found") + .timestamp(timestamp) + .developerMessage(exception.getClass().getName()) + .build() + ); + } + + @ExceptionHandler(EmailAlreadyExistsException.class) + public ResponseEntity handlerEmailAlreadyExistsException(EmailAlreadyExistsException bre) { + LocalDateTime timestamp = LocalDateTime.now(); + + return ResponseEntity.status(HttpStatus.CONFLICT).body( + ExceptionPattern.builder() + .title("Email already exists, check the documentation") + .status(HttpStatus.CONFLICT.value()) + .details(bre.getMessage()) + .timestamp(timestamp) + .developerMessage(bre.getClass().getName()) + .build() + ); + } + + @ExceptionHandler(PostNotFoundException.class) + public ResponseEntity handlerPostNotFoundException(PostNotFoundException bre) { + LocalDateTime timestamp = LocalDateTime.now(); + + return ResponseEntity.status(HttpStatus.NOT_FOUND).body( + ExceptionPattern.builder() + .title("Post not found, check the documentation") + .status(HttpStatus.NOT_FOUND.value()) + .details(bre.getMessage()) + .timestamp(timestamp) + .developerMessage(bre.getClass().getName()) + .build() + ); + } + @ExceptionHandler(FileNotFoundException.class) + public ResponseEntity handlerFileNotFoundException(FileNotFoundException bre) { + LocalDateTime timestamp = LocalDateTime.now(); + + return ResponseEntity.status(HttpStatus.NOT_FOUND).body( + ExceptionPattern.builder() + .title("File not found, check the documentation") + .status(HttpStatus.NOT_FOUND.value()) + .details(bre.getMessage()) + .timestamp(timestamp) + .developerMessage(bre.getClass().getName()) + .build() + ); + } + + @ExceptionHandler(InvalidFileException.class) + public ResponseEntity handlerInvalidFileException(InvalidFileException bre) { + LocalDateTime timestamp = LocalDateTime.now(); + + return ResponseEntity.badRequest().body( + ExceptionPattern.builder() + .title("The file is invalid, check the documentation or try another file type") + .status(HttpStatus.BAD_REQUEST.value()) + .details(bre.getMessage()) + .timestamp(timestamp) + .developerMessage(bre.getClass().getName()) + .build() + ); + } + + + @ExceptionHandler(MethodArgumentNotValidException.class) + public ResponseEntity handlerMethodArgumentNotValidExceptionException(MethodArgumentNotValidException exception) { + List fieldError = exception.getBindingResult().getFieldErrors(); + + String fields = fieldError.stream().map(FieldError::getField).collect(Collectors.joining(", ")); + String fieldMessage = fieldError.stream().map(FieldError::getDefaultMessage).collect(Collectors.joining(", ")); + LocalDateTime timestamp = LocalDateTime.now(); + + return ResponseEntity.badRequest().body( + ExceptionPattern.builder() + .title("Bad Request Exception, Invalid Fields") + .status(HttpStatus.BAD_REQUEST.value()) + .details("Check the field(s) error") + .timestamp(timestamp) + .developerMessage(exception.getClass().getName()) + .fields(fields) + .fieldsMessage(fieldMessage) + .build() + ); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java index 9287c85..f09f901 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java @@ -11,13 +11,13 @@ public class Post { private Long id; - @NotBlank + @NotBlank(message = "Title is mandatory") private String title; private String slug; - @NotBlank + @NotBlank(message = "Content is mandatory") private String content; - @NotBlank + @NotBlank(message = "Banner is mandatory") private String banner; private LocalDateTime createdAt; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/ExceptionPattern.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/ExceptionPattern.java new file mode 100644 index 0000000..a0c2a12 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/exceptions/ExceptionPattern.java @@ -0,0 +1,20 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.exceptions; + +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Getter +@Setter +@Builder +public class ExceptionPattern { + private String title; + private int status; + private String details; + private LocalDateTime timestamp; + private String developerMessage; + private String fields; + private String fieldsMessage; +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/PostService.java similarity index 85% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/PostService.java index da29577..f4ac8c0 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/PostService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/PostService.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.application.service; +package com.institutosemprealerta.semprealerta.domain.service; import com.institutosemprealerta.semprealerta.domain.model.Post; import org.springframework.data.domain.Page; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/StorageService.java similarity index 90% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/StorageService.java index 0bdd517..ed1106f 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/StorageService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/StorageService.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.application.service; +package com.institutosemprealerta.semprealerta.domain.service; import com.institutosemprealerta.semprealerta.domain.model.File; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/UserService.java similarity index 82% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/UserService.java index f84b57d..5e10df6 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/UserService.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/UserService.java @@ -1,4 +1,4 @@ -package com.institutosemprealerta.semprealerta.application.service; +package com.institutosemprealerta.semprealerta.domain.service; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/PostServiceImpl.java similarity index 90% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/PostServiceImpl.java index a5d517e..e79e3b6 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/PostServiceImpl.java @@ -1,6 +1,6 @@ -package com.institutosemprealerta.semprealerta.application.service.impl; +package com.institutosemprealerta.semprealerta.domain.service.impl; -import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.domain.service.PostService; import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; @@ -8,8 +8,6 @@ import org.springframework.stereotype.Service; import org.springframework.data.domain.Pageable; -import java.util.List; - @Service public class PostServiceImpl implements PostService { private final PostRepository postRepository; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/StorageServiceImpl.java similarity index 95% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/StorageServiceImpl.java index a4c1f2c..4085d82 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/StorageServiceImpl.java @@ -1,13 +1,12 @@ -package com.institutosemprealerta.semprealerta.application.service.impl; +package com.institutosemprealerta.semprealerta.domain.service.impl; -import com.institutosemprealerta.semprealerta.application.service.StorageService; +import com.institutosemprealerta.semprealerta.domain.service.StorageService; import com.institutosemprealerta.semprealerta.domain.model.File; import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.FileNotFoundException; import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.InvalidFileException; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; -import lombok.extern.log4j.Log4j2; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.stereotype.Service; diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java similarity index 85% rename from src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java rename to src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java index 165f63c..4d985c7 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java @@ -1,6 +1,6 @@ -package com.institutosemprealerta.semprealerta.application.service.impl; +package com.institutosemprealerta.semprealerta.domain.service.impl; -import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.domain.service.UserService; import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; @@ -33,7 +33,7 @@ public void delete(int id) { @Override public User findByRegistration(String registration) { return this.userRepository.findByRegistration(registration) - .orElseThrow(() -> new RuntimeException("User not found")); + .orElseThrow(() -> new UserNotFoundException("User not found")); } @Override diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java index 3430c9f..bda6f87 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/PostServiceImplTest.java @@ -3,7 +3,7 @@ import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; import com.institutosemprealerta.semprealerta.domain.ports.out.PostRepository; -import com.institutosemprealerta.semprealerta.infrastructure.entity.post.PostEntity; +import com.institutosemprealerta.semprealerta.domain.service.impl.PostServiceImpl; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks.PostMocks; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java index 3de9636..f38d343 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/StorageServiceImplTest.java @@ -3,18 +3,17 @@ import com.institutosemprealerta.semprealerta.domain.model.File; import com.institutosemprealerta.semprealerta.domain.ports.out.FileRepository; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import com.institutosemprealerta.semprealerta.domain.service.impl.StorageServiceImpl; import com.institutosemprealerta.semprealerta.infrastructure.config.FileStorageProperties; import com.institutosemprealerta.semprealerta.infrastructure.entity.file.mocks.FileMocks; import org.junit.jupiter.api.*; import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.core.io.Resource; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; -import java.net.URI; import java.nio.file.*; import java.nio.file.spi.FileSystemProvider; import java.util.List; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java index c7980bf..c80629c 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/service/impl/UserServiceImplTest.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.application.service.impl; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import com.institutosemprealerta.semprealerta.domain.service.impl.UserServiceImpl; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; import org.junit.jupiter.api.AfterEach; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java index b68c046..1987200 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.controllers; -import com.institutosemprealerta.semprealerta.application.service.StorageService; +import com.institutosemprealerta.semprealerta.application.controllers.FilesStorageController; +import com.institutosemprealerta.semprealerta.domain.service.StorageService; import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java index 2622579..6eaaec8 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/PostControllerTest.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.controllers; -import com.institutosemprealerta.semprealerta.application.service.PostService; +import com.institutosemprealerta.semprealerta.application.controllers.PostController; +import com.institutosemprealerta.semprealerta.domain.service.PostService; import com.institutosemprealerta.semprealerta.domain.model.Post; import com.institutosemprealerta.semprealerta.infrastructure.entity.post.mocks.PostMocks; import org.junit.jupiter.api.AfterEach; diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java index 4daea57..50faac5 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/UserControllerTest.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.controllers; -import com.institutosemprealerta.semprealerta.application.service.UserService; +import com.institutosemprealerta.semprealerta.application.controllers.UserController; +import com.institutosemprealerta.semprealerta.domain.service.UserService; import com.institutosemprealerta.semprealerta.domain.model.UserDTO; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; From 248dee5dc09030a03f123544e3371329453ef441 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 12:40:57 -0300 Subject: [PATCH 47/65] feat: generate new slug Signed-off-by: MatheusVict --- .../application/handler/GlobalExceptionHandler.java | 1 + .../adpters/JpaPostRepositoryAdapter.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java index e9f616f..1aa7fff 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java @@ -63,6 +63,7 @@ public ResponseEntity handlerPostNotFoundException(PostNotFoun .build() ); } + @ExceptionHandler(FileNotFoundException.class) public ResponseEntity handlerFileNotFoundException(FileNotFoundException bre) { LocalDateTime timestamp = LocalDateTime.now(); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java index 091e8e0..fee725c 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/adpters/JpaPostRepositoryAdapter.java @@ -9,8 +9,6 @@ import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Component; -import java.util.List; - @Component public class JpaPostRepositoryAdapter implements PostRepository { private final JpaPostRepository jpaPostRepository; @@ -21,6 +19,13 @@ public JpaPostRepositoryAdapter(JpaPostRepository jpaPostRepository) { @Override public String save(Post post) { + boolean slugAlreadyExists = slugAlreadyExists(post.getSlug()); + + if (slugAlreadyExists) { + String newSlug = post.getSlug() + "-" + Math.random(); + post.setSlug(newSlug); + } + PostEntity postToSave = PostEntity.fromModel(post); PostEntity postSaved = jpaPostRepository.save(postToSave); return postSaved.getSlug(); @@ -59,4 +64,8 @@ public Post findById(Long id) { .map(postEntity -> PostEntity.toModel(postEntity)) .orElseThrow(() -> new PostNotFoundException("Post not found")); } + + private boolean slugAlreadyExists(String slug) { + return jpaPostRepository.findBySlug(slug).isPresent(); + } } From ba2d941f59cc4eea7b1296b8f9dd8dfc3c261ea1 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 12:54:56 -0300 Subject: [PATCH 48/65] feat: add swagger plugin Signed-off-by: MatheusVict --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index 91204cd..7eb5268 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ sempre-alerta 17 + 2.3.0 @@ -37,6 +38,16 @@ org.springframework.boot spring-boot-starter-web + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc-openapi-starter-webmvc-ui.version} + + + org.springdoc + springdoc-openapi-starter-webmvc-api + ${springdoc-openapi-starter-webmvc-ui.version} + org.flywaydb flyway-core From 65ee5c963e4930e9405d3130206111ff21994ebc Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 13:40:24 -0300 Subject: [PATCH 49/65] feat: swagger custom response annotations Signed-off-by: MatheusVict --- .../controllers/FilesStorageController.java | 9 +++++++-- .../swagger/annotations/ConflictResponse.java | 18 ++++++++++++++++++ .../swagger/annotations/CreatedResponse.java | 14 ++++++++++++++ .../swagger/annotations/NoContentResponse.java | 14 ++++++++++++++ .../swagger/annotations/NotFoundResponse.java | 18 ++++++++++++++++++ .../swagger/annotations/OkResponse.java | 15 +++++++++++++++ src/main/resources/application-dev.yml | 2 ++ 7 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java index 0a6e3d6..0d90555 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java @@ -2,6 +2,8 @@ import com.institutosemprealerta.semprealerta.domain.service.StorageService; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletRequest; import org.springframework.core.io.Resource; import org.springframework.http.HttpHeaders; @@ -17,6 +19,7 @@ @Controller @RequestMapping("/api/v1/files") +@Tag(name = "Files", description = "Files management") public class FilesStorageController { private StorageService storageService; @@ -24,8 +27,9 @@ public FilesStorageController(StorageService storageService) { this.storageService = storageService; } - @PostMapping("/upload") - public ResponseEntity uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("file_type") String fileType) { + @Operation(summary = "Upload a file", description = "Upload a file to the server") + @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public ResponseEntity uploadFile(@RequestPart("file") MultipartFile file, @RequestParam("file_type") String fileType) { String fileName = storageService.store(file, fileType); @@ -39,6 +43,7 @@ public ResponseEntity uploadFile(@RequestParam("file") MultipartFile fil @GetMapping("/download/{fileName:.+}") @ResponseBody + @Operation(summary = "Download a file", description = "Download a file from the server") public ResponseEntity downloadFile( @PathVariable String fileName, HttpServletRequest request diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java new file mode 100644 index 0000000..80d47d5 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.ExceptionPattern; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "409", description = "There are some conflicts", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) +public @interface ConflictResponse { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java new file mode 100644 index 0000000..1a72b8f --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java @@ -0,0 +1,14 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "201", description = "Created Successfully", useReturnTypeSchema = true) +public @interface CreatedResponse { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java new file mode 100644 index 0000000..77d52e5 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java @@ -0,0 +1,14 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "204", description = "Request finished successfully without content", useReturnTypeSchema = true) +public @interface NoContentResponse { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java new file mode 100644 index 0000000..6418927 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.ExceptionPattern; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "404", description = "Resource not found", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) +public @interface NotFoundResponse { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java new file mode 100644 index 0000000..b09ded5 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java @@ -0,0 +1,15 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import org.springframework.http.HttpStatus; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "200", description = "Request finished successfully", useReturnTypeSchema = true) +public @interface OkResponse { +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 01e05b1..d5de074 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -20,4 +20,6 @@ spring: file: upload-dir: pdf +springdoc: + show-actuator: true From 3fdbf9fc477a7648bd9e647c76f0df625ed9288c Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 13:48:46 -0300 Subject: [PATCH 50/65] docs: files controller docs Signed-off-by: MatheusVict --- .../controllers/FilesStorageController.java | 16 +++++++++++++++- .../annotations/BadRequestResponse.java | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java index 0d90555..64d166e 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java @@ -2,6 +2,10 @@ import com.institutosemprealerta.semprealerta.domain.service.StorageService; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.FileResponse; +import com.institutosemprealerta.semprealerta.swagger.annotations.BadRequestResponse; +import com.institutosemprealerta.semprealerta.swagger.annotations.CreatedResponse; +import com.institutosemprealerta.semprealerta.swagger.annotations.NotFoundResponse; +import com.institutosemprealerta.semprealerta.swagger.annotations.OkResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.servlet.http.HttpServletRequest; @@ -15,6 +19,7 @@ import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import java.io.IOException; +import java.net.URI; import java.util.List; @Controller @@ -29,6 +34,8 @@ public FilesStorageController(StorageService storageService) { @Operation(summary = "Upload a file", description = "Upload a file to the server") @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + @CreatedResponse + @BadRequestResponse public ResponseEntity uploadFile(@RequestPart("file") MultipartFile file, @RequestParam("file_type") String fileType) { String fileName = storageService.store(file, fileType); @@ -38,12 +45,16 @@ public ResponseEntity uploadFile(@RequestPart("file") MultipartFile file .path(fileName) .toUriString(); - return ResponseEntity.ok("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri); + URI uri = URI.create(fileDownloadUri); + return ResponseEntity.created(uri).body("File uploaded successfully, file name: " + fileName + " on path: " + fileDownloadUri); } @GetMapping("/download/{fileName:.+}") @ResponseBody @Operation(summary = "Download a file", description = "Download a file from the server") + @OkResponse + @NotFoundResponse + @BadRequestResponse public ResponseEntity downloadFile( @PathVariable String fileName, HttpServletRequest request @@ -67,6 +78,9 @@ public ResponseEntity downloadFile( } @GetMapping("/list") + @Operation(summary = "List all files", description = "List all files from the server") + @OkResponse + @BadRequestResponse public ResponseEntity> listFiles() throws IOException { List fileNames = storageService.loadAll(); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java new file mode 100644 index 0000000..7f03831 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.swagger.annotations; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.ExceptionPattern; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@ApiResponse(responseCode = "400", description = "Error on client side", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) +public @interface BadRequestResponse { +} From ebb1de33759e8a2810a6f4ba8d89401a7439cb2e Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:02:02 -0300 Subject: [PATCH 51/65] docs: post controller docs Signed-off-by: MatheusVict --- .../controllers/PostController.java | 19 +++++++++++++++++++ .../semprealerta/domain/model/Post.java | 17 ++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java index 4ea45b0..7be3df5 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/PostController.java @@ -2,6 +2,9 @@ import com.institutosemprealerta.semprealerta.domain.service.PostService; import com.institutosemprealerta.semprealerta.domain.model.Post; +import com.institutosemprealerta.semprealerta.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -12,6 +15,7 @@ @RestController @RequestMapping("api/v1/posts") +@Tag(name = "Post", description = "Post management") public class PostController { private final PostService postService; @@ -20,28 +24,43 @@ public PostController(PostService postService) { } @GetMapping + @Operation(summary = "Lista de todos os posts", description = "Lista de todos os posts com paginação") + @OkResponse public ResponseEntity> getAllPosts(Pageable pageable) { return ResponseEntity.ok(postService.listAll(pageable)); } @PostMapping + @Operation(summary = "Criar postagem", description = "Crie uma nova postagem") + @CreatedResponse + @BadRequestResponse public ResponseEntity createPost(@Valid @RequestBody Post post) { String slug = postService.save(post); return ResponseEntity.created(URI.create("/api/v1/posts/" + slug)).build(); } @GetMapping("/{slug}") + @Operation(summary = "Pegar post pelo slug", description = "Procura um post pelo seu slug") + @OkResponse + @NotFoundResponse public ResponseEntity getPostBySlug(@PathVariable String slug) { return ResponseEntity.ok(postService.findBySlug(slug)); } @PutMapping("/{id}") + @Operation(summary = "Atualizar post", description = "Atualize um post existente pelo seu id") + @NoContentResponse + @NotFoundResponse + @BadRequestResponse public ResponseEntity updatePost(@PathVariable Long id, @Valid @RequestBody Post post) { postService.update(id, post); return ResponseEntity.noContent().build(); } @DeleteMapping("/{id}") + @Operation(summary = "Deletar post", description = "Deleta um post existente pelo seu id") + @NoContentResponse + @NotFoundResponse public ResponseEntity deletePost(@PathVariable Long id) { postService.delete(id); return ResponseEntity.noContent().build(); diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java index f09f901..7ed0db5 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/Post.java @@ -1,5 +1,7 @@ package com.institutosemprealerta.semprealerta.domain.model; +import io.swagger.v3.oas.annotations.Hidden; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; @@ -10,15 +12,24 @@ @Setter public class Post { + @Hidden private Long id; - @NotBlank(message = "Title is mandatory") + + @NotBlank(message = "Title é obrigatorio") + @Schema(description = "Title do post", example = "Titulo do post") private String title; + private String slug; - @NotBlank(message = "Content is mandatory") + @NotBlank(message = "Content é obrigatorio") + @Schema(description = "Contenteudo do post", example = "Conteudo do post") private String content; - @NotBlank(message = "Banner is mandatory") + + @NotBlank(message = "Banner é obrigatorio") + @Schema(description = "Banner do post", example = "https://www.https://github.com/MatheusVict.png") private String banner; + + @Hidden private LocalDateTime createdAt; public Post(Long id, String title, String slug, String content, String banner, LocalDateTime createdAt) { From ddd2272e8de61d15be05341fd11f6ea8b21d2785 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:04:49 -0300 Subject: [PATCH 52/65] docs: translate docs Signed-off-by: MatheusVict --- .../semprealerta/swagger/annotations/BadRequestResponse.java | 2 +- .../semprealerta/swagger/annotations/ConflictResponse.java | 2 +- .../semprealerta/swagger/annotations/CreatedResponse.java | 2 +- .../semprealerta/swagger/annotations/NoContentResponse.java | 2 +- .../semprealerta/swagger/annotations/NotFoundResponse.java | 2 +- .../semprealerta/swagger/annotations/OkResponse.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java index 7f03831..0ebeb1f 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/BadRequestResponse.java @@ -12,7 +12,7 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "400", description = "Error on client side", +@ApiResponse(responseCode = "400", description = "Erro de requisição inválida, no lado do cliente", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) public @interface BadRequestResponse { } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java index 80d47d5..0dbe12c 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/ConflictResponse.java @@ -12,7 +12,7 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "409", description = "There are some conflicts", +@ApiResponse(responseCode = "409", description = "Possui alguns conflitos na requisição", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) public @interface ConflictResponse { } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java index 1a72b8f..8ce4829 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/CreatedResponse.java @@ -9,6 +9,6 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "201", description = "Created Successfully", useReturnTypeSchema = true) +@ApiResponse(responseCode = "201", description = "Criado com sucesso", useReturnTypeSchema = true) public @interface CreatedResponse { } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java index 77d52e5..8016606 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NoContentResponse.java @@ -9,6 +9,6 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "204", description = "Request finished successfully without content", useReturnTypeSchema = true) +@ApiResponse(responseCode = "204", description = "Requisição bem sucedida e sem retorno", useReturnTypeSchema = true) public @interface NoContentResponse { } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java index 6418927..9eb6e93 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/NotFoundResponse.java @@ -12,7 +12,7 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "404", description = "Resource not found", +@ApiResponse(responseCode = "404", description = "Objeto não encontrado", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ExceptionPattern.class))) public @interface NotFoundResponse { } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java index b09ded5..cf40ec7 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/swagger/annotations/OkResponse.java @@ -10,6 +10,6 @@ @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) -@ApiResponse(responseCode = "200", description = "Request finished successfully", useReturnTypeSchema = true) +@ApiResponse(responseCode = "200", description = "Requisição finalizada com sucesso", useReturnTypeSchema = true) public @interface OkResponse { } From f5ef083f7e4ce3746bb9cfa3eb693b4bbd03730b Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:07:46 -0300 Subject: [PATCH 53/65] docs: translate files controller docs Signed-off-by: MatheusVict --- .../application/controllers/FilesStorageController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java index 64d166e..8dffd37 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/FilesStorageController.java @@ -32,7 +32,7 @@ public FilesStorageController(StorageService storageService) { this.storageService = storageService; } - @Operation(summary = "Upload a file", description = "Upload a file to the server") + @Operation(summary = "Faça o upload de um arquivo", description = "Upload de um arquivo para o servidor") @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @CreatedResponse @BadRequestResponse @@ -51,7 +51,7 @@ public ResponseEntity uploadFile(@RequestPart("file") MultipartFile file @GetMapping("/download/{fileName:.+}") @ResponseBody - @Operation(summary = "Download a file", description = "Download a file from the server") + @Operation(summary = "Download de um arquivo", description = "Baixe um arquivo pelo nome do arquivo") @OkResponse @NotFoundResponse @BadRequestResponse @@ -78,7 +78,7 @@ public ResponseEntity downloadFile( } @GetMapping("/list") - @Operation(summary = "List all files", description = "List all files from the server") + @Operation(summary = "List todos os arquivos", description = "Liste todos os arquivos do servidor") @OkResponse @BadRequestResponse public ResponseEntity> listFiles() throws IOException { From 616a5ccf7e0ba421b80f465f92ff790d1b0c4554 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:12:22 -0300 Subject: [PATCH 54/65] docs: user controller docs Signed-off-by: MatheusVict --- .../controllers/UserController.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java index 5866eba..a98fa57 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/UserController.java @@ -4,6 +4,9 @@ import com.institutosemprealerta.semprealerta.domain.model.UserDTO; import com.institutosemprealerta.semprealerta.domain.ports.out.responses.UserResponse; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.validation.Valid; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -11,6 +14,7 @@ @RestController @RequestMapping("api/v1/user") +@Tag(name = "User", description = "Administração de usuários") public class UserController { private final UserService userService; @@ -20,30 +24,46 @@ public UserController(UserService userService) { } @PostMapping + @Operation(summary = "Criação de um usuário", description = "Criação de um usuário no sistema") + @CreatedResponse + @ConflictResponse public ResponseEntity createUser(@Valid @RequestBody UserDTO user) { userService.save(user.toDomain()); return ResponseEntity.status(HttpStatus.CREATED).build(); } @GetMapping("/{id}") + @Operation(summary = "Busca de um usuário", description = "Busca de um usuário pelo id") + @OkResponse + @NotFoundResponse public ResponseEntity findById(@PathVariable int id) { User userFound = userService.findById(id); return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); } @GetMapping("/registration/{reg}") + @Operation(summary = "Busca de um usuário", description = "Busca de um usuário pela matrícula") + @OkResponse + @NotFoundResponse public ResponseEntity findByRegistration(@PathVariable String reg) { User userFound = userService.findByRegistration(reg); return ResponseEntity.ok().body(UserResponse.toResponse(userFound)); } @PutMapping("/{id}") + @Operation(summary = "Atualização de um usuário", description = "Atualização de um usuário pelo id") + @NoContentResponse + @NotFoundResponse + @ConflictResponse public ResponseEntity updateUser(@PathVariable int id, @RequestBody UserDTO user) { userService.update(id, user.toDomain()); - return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); + return ResponseEntity.noContent().build(); } @DeleteMapping("/{id}") + @Operation(summary = "Deleção de um usuário", description = "Deleção de um usuário pelo id") + @NoContentResponse + @NotFoundResponse public ResponseEntity deleteUser(@PathVariable int id) { userService.delete(id); return ResponseEntity.status(HttpStatus.NO_CONTENT).build(); From b7709ee3df6311bce866dd626b91619c799b645f Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:20:22 -0300 Subject: [PATCH 55/65] chore: docs infos and authorization Signed-off-by: MatheusVict --- .../config/ApplicationConfig.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java index f144020..b7adbce 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/ApplicationConfig.java @@ -2,12 +2,22 @@ import com.institutosemprealerta.semprealerta.domain.ports.in.SlugGenerator; import com.institutosemprealerta.semprealerta.domain.ports.in.impl.SlugifySlugGenerator; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.security.SecurityRequirement; +import io.swagger.v3.oas.models.security.SecurityScheme; +import io.swagger.v3.oas.models.servers.Server; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; +import java.util.List; + @Configuration public class ApplicationConfig { @@ -20,4 +30,29 @@ public SlugGenerator slugGenerator() { public Pageable defaultPageable() { return PageRequest.of(0, 10, Sort.by("createdAt").descending()); } + + public SecurityScheme createAPIKeyScheme() { + return new SecurityScheme() + .type(SecurityScheme.Type.HTTP) + .bearerFormat("JWT") + .scheme("bearer"); + } + + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .addSecurityItem(new SecurityRequirement() + .addList("Bearer Authentication")) + .components(new Components().addSecuritySchemes( + "Bearer Authentication", + createAPIKeyScheme() + )) + .info(new Info().title("Instituto Sempre Alerta API") + .description("API do Instituto Sempre Alerta.") + .version("1.0").contact(new Contact().name("Matheus Victor") + .email("matheusvictorhenrique@gmail.com") + .url("https://www.instituto-sempre-alerta.com.br/")) + .license(new License().name("License of API") + .url("https://opensource.org/license/mit/"))); + } } From 21e8d361132aee2f77f538b674a209e494bd7e31 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:23:39 -0300 Subject: [PATCH 56/65] docs: user dto Signed-off-by: MatheusVict --- .../semprealerta/domain/model/UserDTO.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java index bb70fb5..004a824 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/model/UserDTO.java @@ -7,6 +7,7 @@ import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.UserRoles; import com.institutosemprealerta.semprealerta.utils.DateManipulation; +import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.time.LocalDate; @@ -14,21 +15,32 @@ public record UserDTO( @NotBlank + @Schema(description = "Nome do usuário", example = "Matheus Victor") String name, @Email + @Schema(description = "Email do usuário", example = "muryllo@gg.com") String email, @NotBlank + @Schema(description = "Senha do usuário", example = "123456") String password, @NotBlank + @Schema(description = "Telefone do usuário", example = "123456") String phone, + @Schema(description = "Gênero do usuário", example = "Masculino") String gender, @PastOrPresent + @Schema(description = "Data de nascimento do usuário", example = "1999-12-12") LocalDate birthDate, @NotNull + @Schema(description = "Papel do usuário", example = "ADMIN") UserRoles roles, + @Schema(description = "Rua do usuário", example = "Rua 1") String street, + @Schema(description = "Número da casa do usuário", example = "123") String number, + @Schema(description = "Cidade do usuário", example = "Igarassu e Lima") String city, + @Schema(description = "CEP do usuário", example = "123456") String zipCode ) { From d04b24f34545ea79818cf5ef13f87e197d3f4ce2 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Mon, 4 Mar 2024 14:30:47 -0300 Subject: [PATCH 57/65] fix: fix test asserts Signed-off-by: MatheusVict --- .../infrastructure/controllers/FilesStorageControllerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java index 1987200..73a3e28 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/controllers/FilesStorageControllerTest.java @@ -88,7 +88,7 @@ void should_UploadFile_Successfully() { ResponseEntity responseEntity = filesStorageController.uploadFile(mockFile, fileType); assertTrue(responseEntity.getStatusCode().is2xxSuccessful()); - assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); + assertEquals(HttpStatus.CREATED, responseEntity.getStatusCode()); assertEquals(expected, responseEntity.getBody()); } From 2a94409054552bf11de53671c6f6f020c7927b96 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 5 Mar 2024 10:42:13 -0300 Subject: [PATCH 58/65] feat: add spring security Signed-off-by: MatheusVict --- pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pom.xml b/pom.xml index 7eb5268..bdb9fad 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,15 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-test + test + org.springdoc springdoc-openapi-starter-webmvc-ui From f90dcbc749f8785e71e74f78d8d5265702c83179 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Tue, 5 Mar 2024 14:02:27 -0300 Subject: [PATCH 59/65] generate token and protect routes Signed-off-by: MatheusVict --- pom.xml | 5 ++ .../semprealerta/SempreAlertaApplication.java | 3 + .../controllers/AuthenticationController.java | 31 +++++++++ .../domain/ports/out/request/LoginDTO.java | 14 ++++ .../ports/out/responses/LoginResponse.java | 11 +++ .../domain/service/AuthenticationService.java | 10 +++ .../domain/service/TokenService.java | 9 +++ .../impl/AuthenticationServiceImpl.java | 40 +++++++++++ .../service/impl/AuthorizationService.java | 21 ++++++ .../domain/service/impl/TokenServiceImpl.java | 55 +++++++++++++++ .../domain/service/impl/UserServiceImpl.java | 4 ++ .../security/SecurityConfigurations.java | 67 +++++++++++++++++++ .../infrastructure/entity/user/User.java | 44 +++++++++++- src/main/resources/application-dev.yml | 4 ++ src/main/resources/application.yml | 7 +- 15 files changed, 319 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/request/LoginDTO.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/LoginResponse.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/service/AuthenticationService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/service/TokenService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImpl.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationService.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImpl.java create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java diff --git a/pom.xml b/pom.xml index bdb9fad..3d4bc8c 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,11 @@ 1.0.2 test + + com.auth0 + java-jwt + 4.4.0 + org.springframework.boot spring-boot-starter-test diff --git a/src/main/java/com/institutosemprealerta/semprealerta/SempreAlertaApplication.java b/src/main/java/com/institutosemprealerta/semprealerta/SempreAlertaApplication.java index 3c8af65..1efe528 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/SempreAlertaApplication.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/SempreAlertaApplication.java @@ -1,9 +1,12 @@ package com.institutosemprealerta.semprealerta; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.servers.Server; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication +@OpenAPIDefinition(servers = {@Server(url = "/", description = "Default server url")}) public class SempreAlertaApplication { public static void main(String[] args) { diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java new file mode 100644 index 0000000..3c0958e --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java @@ -0,0 +1,31 @@ +package com.institutosemprealerta.semprealerta.application.controllers; + +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.service.AuthenticationService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/auth") +@Tag(name = "auth") +public class AuthenticationController { + + private final AuthenticationService authenticationService; + + public AuthenticationController(AuthenticationService authenticationService) { + this.authenticationService = authenticationService; + } + + @PostMapping("/login") + @Operation(summary = "Login", description = "You can login with your email and password") + + public ResponseEntity login(@RequestBody @Valid LoginDTO loginRequestBody) { + return ResponseEntity.ok(authenticationService.login(loginRequestBody)); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/request/LoginDTO.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/request/LoginDTO.java new file mode 100644 index 0000000..ac0a8e1 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/request/LoginDTO.java @@ -0,0 +1,14 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.request; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; + +public record LoginDTO( + @NotBlank(message = "email is mandatory") + @Schema(description = "email do usuário", example = "muryllo@email.com") + String email, + @NotBlank(message = "password is mandatory") + @Schema(description = "Senha do usuário", example = "12345") + String password +) { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/LoginResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/LoginResponse.java new file mode 100644 index 0000000..f72a32a --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/LoginResponse.java @@ -0,0 +1,11 @@ +package com.institutosemprealerta.semprealerta.domain.ports.out.responses; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public record LoginResponse( + @Schema(description = "token de autorização para acessar os recursos", example = "eyn32nklafjçj354335g35") + @JsonProperty("access_token") + String accessToken +) { +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/AuthenticationService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/AuthenticationService.java new file mode 100644 index 0000000..1cf782a --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/AuthenticationService.java @@ -0,0 +1,10 @@ +package com.institutosemprealerta.semprealerta.domain.service; + +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; + +public interface AuthenticationService { + LoginResponse login(LoginDTO login); + void register(User user); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/TokenService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/TokenService.java new file mode 100644 index 0000000..154d3d9 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/TokenService.java @@ -0,0 +1,9 @@ +package com.institutosemprealerta.semprealerta.domain.service; + +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; + +public interface TokenService { + String generateToken(User user); + String validateToken(String token); +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImpl.java new file mode 100644 index 0000000..5b3e4fe --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImpl.java @@ -0,0 +1,40 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; +import com.institutosemprealerta.semprealerta.domain.service.AuthenticationService; +import com.institutosemprealerta.semprealerta.domain.service.TokenService; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Service; + +@Service +public class AuthenticationServiceImpl implements AuthenticationService { + + private final AuthenticationManager authenticationManager; + + private final TokenService tokenService; + + public AuthenticationServiceImpl(AuthenticationManager authenticationManager, TokenService tokenService) { + this.authenticationManager = authenticationManager; + this.tokenService = tokenService; + } + + @Override + public LoginResponse login(LoginDTO login) { + UsernamePasswordAuthenticationToken userNamePassword = + new UsernamePasswordAuthenticationToken(login.email(), login.password()); + Authentication auth = this.authenticationManager.authenticate(userNamePassword); + + String token = tokenService.generateToken((User) auth.getPrincipal()); + + return new LoginResponse(token); + } + + @Override + public void register(User user) { + + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationService.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationService.java new file mode 100644 index 0000000..a1e485d --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationService.java @@ -0,0 +1,21 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.institutosemprealerta.semprealerta.domain.service.UserService; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +@Service +public class AuthorizationService implements UserDetailsService { + private final UserService userService; + + public AuthorizationService(UserService userService) { + this.userService = userService; + } + + @Override + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + return userService.findByEmail(username); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImpl.java new file mode 100644 index 0000000..3d262d6 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImpl.java @@ -0,0 +1,55 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTCreationException; +import com.auth0.jwt.exceptions.JWTVerificationException; +import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.domain.service.TokenService; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; + +@Service +public class TokenServiceImpl implements TokenService { + + private String secret = "secret"; + + private final Algorithm encryptionAlgorithm = Algorithm.HMAC256(secret); + + private final String issuer = "sempre-alerta"; + + @Override + public String generateToken(User user) { + try { + return JWT.create() + .withIssuer(issuer) + .withSubject(user.getContact().getEmail()) + .withExpiresAt(generationExpirationDate()) + .sign(encryptionAlgorithm); + } catch (JWTCreationException e) { + throw new JWTCreationException("Error while generating token", e); + } + } + + @Override + public String validateToken(String token) { + try { + return JWT.require(encryptionAlgorithm) + .withIssuer(issuer) + .build() + .verify(token) + .getSubject(); + } catch (JWTVerificationException e) { + return ""; + } + } + + private Instant generationExpirationDate() { + return LocalDateTime.now().plusHours(2).toInstant(ZoneOffset.of("-03:00")); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java index 4d985c7..372e151 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/domain/service/impl/UserServiceImpl.java @@ -4,6 +4,7 @@ import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; import com.institutosemprealerta.semprealerta.domain.ports.out.UserRepository; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; @Service @@ -17,6 +18,9 @@ public UserServiceImpl(UserRepository userRepository) { @Override public void save(User user) { + String newPassword = new BCryptPasswordEncoder().encode(user.getPassword()); + + user.setPassword(newPassword); this.userRepository.save(user); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java new file mode 100644 index 0000000..4bb8dc2 --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java @@ -0,0 +1,67 @@ +package com.institutosemprealerta.semprealerta.infrastructure.config.security; + +import lombok.AllArgsConstructor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.HttpMethod; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +@EnableWebSecurity +@AllArgsConstructor +public class SecurityConfigurations { + + private final String[] AUTH_SWAGGER_WHITELIST = { + "/swagger-ui/**", + "/swagger-ui", + "/swagger-resources/**", + "/webjars/**", + "/v3/api-docs/**", + "/swagger-ui.html" + }; + + private final String[] ACTUATOR_WHITELIST = { + "/actuator", + "/actuator/health", + "/actuator/health/**" + }; + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception { + return httpSecurity + .csrf(AbstractHttpConfigurer::disable) + .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .authorizeHttpRequests(authorize -> authorize + .requestMatchers(AUTH_SWAGGER_WHITELIST).permitAll() + .requestMatchers(ACTUATOR_WHITELIST).permitAll() + .requestMatchers(HttpMethod.POST, "/auth/login").permitAll() + .requestMatchers("/api/v1/user/**").hasRole("ADMIN") + .requestMatchers(HttpMethod.POST, "/api/v1/files/upload").hasRole("ADMIN") + .requestMatchers(HttpMethod.POST, "/api/v1/posts/").hasRole("ADMIN") + .requestMatchers(HttpMethod.PUT, "/api/v1/posts/**").hasRole("ADMIN") + .requestMatchers(HttpMethod.DELETE, "/api/v1/posts/**").hasRole("ADMIN") + .anyRequest().authenticated() + ) + .build(); + } + + @Bean + public AuthenticationManager authenticationManager( + AuthenticationConfiguration authenticationConfiguration + ) throws Exception { + return authenticationConfiguration.getAuthenticationManager(); + } + + @Bean + public PasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java index 1a65c57..8876141 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/User.java @@ -7,9 +7,14 @@ import lombok.Getter; import lombok.Setter; import org.hibernate.annotations.CreationTimestamp; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.Collection; +import java.util.List; import java.util.Random; @@ -17,7 +22,7 @@ @Table(name = "users") @Getter @Setter -public class User { +public class User implements UserDetails { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @@ -54,14 +59,13 @@ public User(String name, String password, String gender, LocalDate birthDate, Us } - @PrePersist public void generateRegistration() { String prefix = this.name.substring(0, 3).toLowerCase() + "-"; this.registration = generateRegistration(prefix); } - private String generateRegistration(String prefix) { + private String generateRegistration(String prefix) { StringBuilder registration = new StringBuilder(prefix); Random random = new Random(); @@ -85,4 +89,38 @@ public User fromModelToDomain(UserDTO dto) { new Address(dto.street(), dto.number(), dto.city(), dto.zipCode()) ); } + + @Override + public Collection getAuthorities() { + if (this.roles == UserRoles.ADMIN) { + return List.of(new SimpleGrantedAuthority("ROLE_ADMIN"), new SimpleGrantedAuthority("ROLE_USER")); + } else { + return List.of(new SimpleGrantedAuthority("ROLE_USER")); + } + } + + @Override + public String getUsername() { + return this.contact.getEmail(); + } + + @Override + public boolean isAccountNonExpired() { + return true; + } + + @Override + public boolean isAccountNonLocked() { + return true; + } + + @Override + public boolean isCredentialsNonExpired() { + return true; + } + + @Override + public boolean isEnabled() { + return true; + } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index d5de074..2bc41ea 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -22,4 +22,8 @@ file: upload-dir: pdf springdoc: show-actuator: true +api: + security: + token: + secret: ${SECRET:secret} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 90cdd40..a1d742e 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,7 @@ file: upload-dir: pdf -spring: - profiles: - active: dev +api: + security: + token: + secret: ${SECRET:secret} \ No newline at end of file From c46d5349b35636a9575d50a32a65fb3caeb91077 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 10:50:54 -0300 Subject: [PATCH 60/65] feat: verify token Signed-off-by: MatheusVict --- .../security/SecurityConfigurations.java | 4 ++ .../config/security/securtityFilter.java | 53 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/securtityFilter.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java index 4bb8dc2..07b1b0b 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/SecurityConfigurations.java @@ -13,12 +13,15 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; @Configuration @EnableWebSecurity @AllArgsConstructor public class SecurityConfigurations { + private final securtityFilter securtityFilter; + private final String[] AUTH_SWAGGER_WHITELIST = { "/swagger-ui/**", "/swagger-ui", @@ -50,6 +53,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws .requestMatchers(HttpMethod.DELETE, "/api/v1/posts/**").hasRole("ADMIN") .anyRequest().authenticated() ) + .addFilterBefore(securtityFilter, UsernamePasswordAuthenticationFilter.class) .build(); } diff --git a/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/securtityFilter.java b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/securtityFilter.java new file mode 100644 index 0000000..9eb9f7f --- /dev/null +++ b/src/main/java/com/institutosemprealerta/semprealerta/infrastructure/config/security/securtityFilter.java @@ -0,0 +1,53 @@ +package com.institutosemprealerta.semprealerta.infrastructure.config.security; + +import com.institutosemprealerta.semprealerta.domain.service.TokenService; +import com.institutosemprealerta.semprealerta.domain.service.UserService; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; + +@Component +public class securtityFilter extends OncePerRequestFilter { + private final TokenService tokenService; + private final UserService userService; + + public securtityFilter(TokenService tokenService, UserService userService) { + this.tokenService = tokenService; + this.userService = userService; + } + + @Override + protected void doFilterInternal( + HttpServletRequest request, + HttpServletResponse response, + FilterChain filterChain + ) throws ServletException, IOException { + String token = this.recoverToken(request); + if (token != null) { + String email = tokenService.validateToken(token); + UserDetails user = userService.findByEmail(email); + + UsernamePasswordAuthenticationToken authentication = + new UsernamePasswordAuthenticationToken(user, null, user.getAuthorities()); + SecurityContextHolder.getContext().setAuthentication(authentication); + + } + filterChain.doFilter(request, response); + } + + private String recoverToken(HttpServletRequest request) { + String authHeader = request.getHeader("Authorization"); + if (authHeader == null || !authHeader.startsWith("Bearer ")) { + return null; + } + return authHeader.substring(7, authHeader.length()); + } +} From 52026edcfebb244d7ee9c81e3dda6dabd0ffed70 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 11:11:36 -0300 Subject: [PATCH 61/65] test: auth controller test Signed-off-by: MatheusVict --- .../controllers/AuthenticationController.java | 4 +- .../AuthenticationControllerTest.java | 66 +++++++++++++++++++ .../entity/user/LoginFactory.java | 18 +++++ .../entity/user/mocks/UserMocks.java | 8 +++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationControllerTest.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/LoginFactory.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java index 3c0958e..693df89 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationController.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.application.controllers; import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; import com.institutosemprealerta.semprealerta.domain.service.AuthenticationService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; @@ -26,6 +27,7 @@ public AuthenticationController(AuthenticationService authenticationService) { @Operation(summary = "Login", description = "You can login with your email and password") public ResponseEntity login(@RequestBody @Valid LoginDTO loginRequestBody) { - return ResponseEntity.ok(authenticationService.login(loginRequestBody)); + LoginResponse token = authenticationService.login(loginRequestBody); + return ResponseEntity.ok(token); } } diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationControllerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationControllerTest.java new file mode 100644 index 0000000..a0653a9 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/controllers/AuthenticationControllerTest.java @@ -0,0 +1,66 @@ +package com.institutosemprealerta.semprealerta.application.controllers; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; +import com.institutosemprealerta.semprealerta.domain.service.AuthenticationService; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.LoginFactory; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("AuthenticationController") +class AuthenticationControllerTest { + + @InjectMocks + private AuthenticationController authenticationController; + + @Mock + private AuthenticationService authenticationService; + + private final LoginResponse token = LoginFactory.INSTANCE.createNewLoginResponse("this-is-the-way"); + private final LoginDTO userCredentials = UserMocks.returnValidLoginDTO(); + + @BeforeEach + void setUp() { + when(authenticationService.login(any(LoginDTO.class))) + .thenReturn(token); + } + + @AfterEach + void tearDown() { + reset(authenticationService); + } + + @Test + @DisplayName("Should login successfully") + void should_Login_Successfully() { + ResponseEntity loginResponse = authenticationController.login(userCredentials); + + assertNotNull(loginResponse); + assertEquals(HttpStatus.OK, loginResponse.getStatusCode()); + assertEquals(token, loginResponse.getBody()); + } + @Test + @DisplayName("Should login with failure") + void should_Login_With_Failure() { + when(authenticationService.login(any(LoginDTO.class))).thenThrow(UserNotFoundException.class); + + assertThrows(UserNotFoundException.class, () -> authenticationController.login(userCredentials)); + } + +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/LoginFactory.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/LoginFactory.java new file mode 100644 index 0000000..1d04c44 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/LoginFactory.java @@ -0,0 +1,18 @@ +package com.institutosemprealerta.semprealerta.infrastructure.entity.user; + +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; + +public class LoginFactory { + public static final LoginFactory INSTANCE = new LoginFactory(); + + private LoginFactory() {} + + public LoginResponse createNewLoginResponse(String token) { + return new LoginResponse(token); + } + + public LoginDTO createNewLoginDTO(String email, String password) { + return new LoginDTO(email, password); + } +} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java index 4bf14cd..ddd84e5 100644 --- a/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java +++ b/src/test/java/com/institutosemprealerta/semprealerta/infrastructure/entity/user/mocks/UserMocks.java @@ -1,6 +1,7 @@ package com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks; import com.institutosemprealerta.semprealerta.domain.model.UserDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; import com.institutosemprealerta.semprealerta.infrastructure.entity.user.*; import java.time.LocalDate; @@ -63,4 +64,11 @@ public static UserDTO returnValidUserDTO() { user.getAddress().getZipCode() ); } + + public static LoginDTO returnValidLoginDTO() { + return LoginFactory.INSTANCE.createNewLoginDTO( + "user@email.com", + "1234" + ); + } } From 16ef43718a5888b6feae61dfcb81e26e60c7e6b2 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 11:32:00 -0300 Subject: [PATCH 62/65] test: global handler exception test Signed-off-by: MatheusVict --- .../handler/GlobalExceptionHandler.java | 2 +- .../handler/GlobalExceptionHandlerTest.java | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandlerTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java index 1aa7fff..1361ba7 100644 --- a/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java +++ b/src/main/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandler.java @@ -27,7 +27,7 @@ public ResponseEntity handlerUserNotFoundException(UserNotFoun ExceptionPattern.builder() .title("User Not Found Exception") .status(HttpStatus.NOT_FOUND.value()) - .details("User not found") + .details(exception.getMessage()) .timestamp(timestamp) .developerMessage(exception.getClass().getName()) .build() diff --git a/src/test/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandlerTest.java b/src/test/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandlerTest.java new file mode 100644 index 0000000..27cd5a8 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/application/handler/GlobalExceptionHandlerTest.java @@ -0,0 +1,90 @@ +package com.institutosemprealerta.semprealerta.application.handler; + +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.ExceptionPattern; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.FileNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.file.InvalidFileException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.post.PostNotFoundException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.EmailAlreadyExistsException; +import com.institutosemprealerta.semprealerta.domain.ports.out.exceptions.user.UserNotFoundException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +import java.util.Objects; + +import static org.junit.jupiter.api.Assertions.*; + +@ExtendWith(MockitoExtension.class) +@DisplayName("GlobalExceptionHandler") +class GlobalExceptionHandlerTest { + + @InjectMocks + private GlobalExceptionHandler globalExceptionHandler; + + + @Test + @DisplayName("Should handler with user not found exception") + void should_HandlerUserNotFoundException() { + UserNotFoundException exception = new UserNotFoundException("User not found"); + ResponseEntity response = globalExceptionHandler.handlerUserNotFoundException(exception); + + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertNotNull(response); + assertEquals(exception.getMessage(), Objects.requireNonNull(response.getBody()).getDetails()); + assertEquals(exception.getClass().getName(), Objects.requireNonNull(response.getBody()).getDeveloperMessage()); + } + + @Test + @DisplayName("Should handler with email already exists exception") + void should_HandlerEmailAlreadyExistsException() { + EmailAlreadyExistsException exception = new EmailAlreadyExistsException("user email already exists"); + ResponseEntity response = globalExceptionHandler.handlerEmailAlreadyExistsException(exception); + + assertNotNull(response); + assertEquals(HttpStatus.CONFLICT, response.getStatusCode()); + assertEquals(exception.getMessage(), Objects.requireNonNull(response.getBody()).getDetails()); + assertEquals(exception.getClass().getName(), Objects.requireNonNull(response.getBody()).getDeveloperMessage()); + } + + @Test + @DisplayName("Should handler with post not found exception") + void should_HandlerPostNotFoundException() { + PostNotFoundException exception = new PostNotFoundException("Post not found"); + ResponseEntity response = globalExceptionHandler.handlerPostNotFoundException(exception); + + assertNotNull(response); + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertEquals(exception.getMessage(), Objects.requireNonNull(response.getBody()).getDetails()); + assertEquals(exception.getClass().getName(), Objects.requireNonNull(response.getBody()).getDeveloperMessage()); + } + + @Test + @DisplayName("Should handler with file not found exception") + void should_HandlerFileNotFoundException() { + FileNotFoundException exception = new FileNotFoundException("File not found"); + ResponseEntity response = globalExceptionHandler.handlerFileNotFoundException(exception); + + assertNotNull(response); + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertEquals(exception.getMessage(), Objects.requireNonNull(response.getBody()).getDetails()); + assertEquals(exception.getClass().getName(), Objects.requireNonNull(response.getBody()).getDeveloperMessage()); + } + + @Test + @DisplayName("Should handler with invalid file exception") + void should_HandlerInvalidFileException() { + InvalidFileException exception = new InvalidFileException("File type invalid"); + ResponseEntity response = globalExceptionHandler.handlerInvalidFileException(exception); + + assertNotNull(response); + assertEquals(HttpStatus.BAD_REQUEST, response.getStatusCode()); + assertEquals(exception.getMessage(), Objects.requireNonNull(response.getBody()).getDetails()); + assertEquals(exception.getClass().getName(), Objects.requireNonNull(response.getBody()).getDeveloperMessage()); + } +} \ No newline at end of file From 18c87aedb152b6a109e9d8395435d0598e6b61e7 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 11:42:22 -0300 Subject: [PATCH 63/65] test: slugify test Signed-off-by: MatheusVict --- .../ports/out/responses/PostResponse.java | 6 --- .../in/impl/SlugifySlugGeneratorTest.java | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 6 deletions(-) delete mode 100644 src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGeneratorTest.java diff --git a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java b/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java deleted file mode 100644 index fdd82e6..0000000 --- a/src/main/java/com/institutosemprealerta/semprealerta/domain/ports/out/responses/PostResponse.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.institutosemprealerta.semprealerta.domain.ports.out.responses; - -public record PostResponse( - -) { -} diff --git a/src/test/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGeneratorTest.java b/src/test/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGeneratorTest.java new file mode 100644 index 0000000..e48293b --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/domain/ports/in/impl/SlugifySlugGeneratorTest.java @@ -0,0 +1,48 @@ +package com.institutosemprealerta.semprealerta.domain.ports.in.impl; + +import com.github.slugify.Slugify; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.data.util.ReflectionUtils; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Slugify slug generator test") +class SlugifySlugGeneratorTest { + + @InjectMocks + private SlugifySlugGenerator slugifySlugGenerator; + + @Mock + Slugify slugify; + + @BeforeEach + void setUp() { + + } + + @AfterEach + void turnDown() { + reset(slugify); + } + + @Test + @DisplayName("Should generate slug successfully") + void should_GenerateSlug_Successfully() { + String input = "Test Input"; + String expectedSlug = "test-input"; + when(slugify.slugify(input)).thenReturn(expectedSlug); + + String result = slugifySlugGenerator.generate(input); + assertEquals(expectedSlug, result); + } +} \ No newline at end of file From f5edcdcee9f4333fb0258b6a1a8b69981b4427e3 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 12:17:03 -0300 Subject: [PATCH 64/65] test: authorization service test Signed-off-by: MatheusVict --- .../impl/AuthorizationServiceTest.java | 51 ++++++++++++ .../service/impl/TokenServiceImplTest.java | 81 +++++++++++++++++++ 2 files changed, 132 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationServiceTest.java create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImplTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationServiceTest.java b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationServiceTest.java new file mode 100644 index 0000000..cba3a4c --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthorizationServiceTest.java @@ -0,0 +1,51 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.institutosemprealerta.semprealerta.domain.service.UserService; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.security.core.userdetails.UserDetails; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Authorization Service") +class AuthorizationServiceTest { + + @InjectMocks + private AuthorizationService authorizationService; + + @Mock + private UserService userService; + + private final User validUserEntity = UserMocks.returnValidUserEntity(); + + @BeforeEach + void setUp() { + when(userService.findByEmail(anyString())) + .thenReturn(validUserEntity); + } + + @AfterEach + void tearDown() { + reset(userService); + } + + @Test + @DisplayName("Should load user by username successfully") + void should_LoadUserByUsername_Successfully() { + UserDetails response = authorizationService.loadUserByUsername(validUserEntity.getContact().getEmail()); + + assertNotNull(response); + } +} \ No newline at end of file diff --git a/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImplTest.java new file mode 100644 index 0000000..c30aff4 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/TokenServiceImplTest.java @@ -0,0 +1,81 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTCreationException; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.test.util.ReflectionTestUtils; + +import java.util.Date; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Token service") +class TokenServiceImplTest { + + @InjectMocks + private TokenServiceImpl tokenService; + + @Mock + User user; + + @Mock + Contact contact; + + private final String secret = "secret"; + + @BeforeEach + void setUp() { + ReflectionTestUtils.setField(tokenService, "secret", secret); + + when(user.getContact()).thenReturn(contact); + when(user.getContact().getEmail()) + .thenReturn(UserMocks.returnValidContact().getEmail()); + } + + @AfterEach + void turnDown() { + reset(user, contact); + } + + @Test + @DisplayName("Should generate token successfully") + void should_GenerateToken_Successfully() { + String token = tokenService.generateToken(user); + + assertNotNull(token); + } + + @Test + @DisplayName("Should validate token successfully") + void should_ValidateToken_Successfully() { + String token = tokenService.generateToken(user); + String subject = tokenService.validateToken(token); + + assertEquals(user.getContact().getEmail(), subject); + } + + @Test + @DisplayName("Should validate token with failure") + void should_ValidateToken_With_Failure() { + String invalidToken = "where are you now?"; + String invalidSubject = tokenService.validateToken(invalidToken); + + assertTrue(invalidSubject.isBlank()); + } +} \ No newline at end of file From f554e17b6b2d218f2160f78eae176c13cfdf7429 Mon Sep 17 00:00:00 2001 From: MatheusVict Date: Wed, 6 Mar 2024 12:30:02 -0300 Subject: [PATCH 65/65] test: authentication service test Signed-off-by: MatheusVict --- .../impl/AuthenticationServiceImplTest.java | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImplTest.java diff --git a/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImplTest.java b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImplTest.java new file mode 100644 index 0000000..4cf8545 --- /dev/null +++ b/src/test/java/com/institutosemprealerta/semprealerta/domain/service/impl/AuthenticationServiceImplTest.java @@ -0,0 +1,69 @@ +package com.institutosemprealerta.semprealerta.domain.service.impl; + +import com.institutosemprealerta.semprealerta.domain.ports.out.request.LoginDTO; +import com.institutosemprealerta.semprealerta.domain.ports.out.responses.LoginResponse; +import com.institutosemprealerta.semprealerta.domain.service.TokenService; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.Contact; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.User; +import com.institutosemprealerta.semprealerta.infrastructure.entity.user.mocks.UserMocks; +import org.springframework.security.core.Authentication; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; + + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +@DisplayName("Authentication service") +class AuthenticationServiceImplTest { + + @InjectMocks + private AuthenticationServiceImpl authenticationService; + + @Mock + private AuthenticationManager authenticationManager; + + @Mock + private TokenService tokenService; + + private final Contact contact = UserMocks.returnValidContact(); + private LoginDTO loginDTO; + + private final String token = "mockToken"; + + @BeforeEach + void setUp() { + loginDTO = new LoginDTO(contact.getEmail(), "123"); + User user = new User(); + user.setContact(contact); + + UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user, null); + when(authenticationManager.authenticate(any(Authentication.class))).thenReturn(authentication); + + + when(tokenService.generateToken(any(User.class))).thenReturn(token); + + } + + @AfterEach + void tearDown() { + reset(tokenService, authenticationManager); + } + + @Test + void login() { + LoginResponse response = authenticationService.login(loginDTO); + assertEquals(token, response.accessToken()); + } +} \ No newline at end of file