Commit b42ba8a9 authored by Colin DAMON's avatar Colin DAMON

Ignore coverage for generated classes

parent 6be18b3d
...@@ -497,6 +497,11 @@ ...@@ -497,6 +497,11 @@
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version> <version>${jacoco-maven-plugin.version}</version>
<configuration>
<excludes>
<exclude>com/ippon/pouet/domain/*</exclude>
</excludes>
</configuration>
<executions> <executions>
<execution> <execution>
<id>pre-unit-tests</id> <id>pre-unit-tests</id>
......
...@@ -5,10 +5,13 @@ import io.github.jhipster.config.DefaultProfileUtil; ...@@ -5,10 +5,13 @@ import io.github.jhipster.config.DefaultProfileUtil;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import com.ippon.pouet.common.domain.Generated;
/** /**
* This is a helper Java class that provides an alternative to creating a {@code web.xml}. * This is a helper Java class that provides an alternative to creating a {@code web.xml}.
* This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc. * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc.
*/ */
@Generated
public class ApplicationWebXml extends SpringBootServletInitializer { public class ApplicationWebXml extends SpringBootServletInitializer {
@Override @Override
......
package com.ippon.pouet; package com.ippon.pouet;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.config.ApplicationProperties; import com.ippon.pouet.config.ApplicationProperties;
import io.github.jhipster.config.DefaultProfileUtil; import io.github.jhipster.config.DefaultProfileUtil;
...@@ -20,6 +21,7 @@ import java.net.UnknownHostException; ...@@ -20,6 +21,7 @@ import java.net.UnknownHostException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
@Generated
@SpringBootApplication @SpringBootApplication
@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) @EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class})
public class PouetApp { public class PouetApp {
......
...@@ -13,6 +13,8 @@ import org.slf4j.LoggerFactory; ...@@ -13,6 +13,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles; import org.springframework.core.env.Profiles;
import com.ippon.pouet.common.domain.Generated;
import java.util.Arrays; import java.util.Arrays;
/** /**
...@@ -21,6 +23,7 @@ import java.util.Arrays; ...@@ -21,6 +23,7 @@ import java.util.Arrays;
* By default, it only runs with the "dev" profile. * By default, it only runs with the "dev" profile.
*/ */
@Aspect @Aspect
@Generated
public class LoggingAspect { public class LoggingAspect {
private final Environment env; private final Environment env;
......
package com.ippon.pouet.common.domain;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface Generated {
}
...@@ -2,12 +2,15 @@ package com.ippon.pouet.config; ...@@ -2,12 +2,15 @@ package com.ippon.pouet.config;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import com.ippon.pouet.common.domain.Generated;
/** /**
* Properties specific to Pouet. * Properties specific to Pouet.
* <p> * <p>
* Properties are configured in the {@code application.yml} file. * Properties are configured in the {@code application.yml} file.
* See {@link io.github.jhipster.config.JHipsterProperties} for a good example. * See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
*/ */
@Generated
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) @ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
public class ApplicationProperties { public class ApplicationProperties {
} }
...@@ -13,10 +13,13 @@ import org.springframework.scheduling.annotation.EnableAsync; ...@@ -13,10 +13,13 @@ import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import com.ippon.pouet.common.domain.Generated;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
@Configuration @Generated
@EnableAsync @EnableAsync
@Configuration
@EnableScheduling @EnableScheduling
public class AsyncConfiguration implements AsyncConfigurer { public class AsyncConfiguration implements AsyncConfigurer {
......
...@@ -7,10 +7,12 @@ import org.slf4j.LoggerFactory; ...@@ -7,10 +7,12 @@ import org.slf4j.LoggerFactory;
import org.springframework.cloud.config.java.AbstractCloudConfig; import org.springframework.cloud.config.java.AbstractCloudConfig;
import org.springframework.context.annotation.*; import org.springframework.context.annotation.*;
import com.ippon.pouet.common.domain.Generated;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
@Generated
@Configuration @Configuration
@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD) @Profile(JHipsterConstants.SPRING_PROFILE_CLOUD)
public class CloudDatabaseConfiguration extends AbstractCloudConfig { public class CloudDatabaseConfiguration extends AbstractCloudConfig {
......
package com.ippon.pouet.config; package com.ippon.pouet.config;
import com.ippon.pouet.common.domain.Generated;
/** /**
* Application constants. * Application constants.
*/ */
@Generated
public final class Constants { public final class Constants {
// Regex for acceptable logins // Regex for acceptable logins
......
...@@ -13,8 +13,11 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing; ...@@ -13,8 +13,11 @@ import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.ippon.pouet.common.domain.Generated;
import java.sql.SQLException; import java.sql.SQLException;
@Generated
@Configuration @Configuration
@EnableJpaRepositories("com.ippon.pouet.repository") @EnableJpaRepositories("com.ippon.pouet.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware") @EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
......
...@@ -5,9 +5,12 @@ import org.springframework.format.FormatterRegistry; ...@@ -5,9 +5,12 @@ import org.springframework.format.FormatterRegistry;
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.ippon.pouet.common.domain.Generated;
/** /**
* Configure the converters to use the ISO format for dates by default. * Configure the converters to use the ISO format for dates by default.
*/ */
@Generated
@Configuration @Configuration
public class DateTimeFormatConfiguration implements WebMvcConfigurer { public class DateTimeFormatConfiguration implements WebMvcConfigurer {
......
...@@ -3,12 +3,14 @@ package com.ippon.pouet.config; ...@@ -3,12 +3,14 @@ package com.ippon.pouet.config;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module; import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.ippon.pouet.common.domain.Generated;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.zalando.problem.ProblemModule; import org.zalando.problem.ProblemModule;
import org.zalando.problem.violations.ConstraintViolationProblemModule; import org.zalando.problem.violations.ConstraintViolationProblemModule;
@Generated
@Configuration @Configuration
public class JacksonConfiguration { public class JacksonConfiguration {
......
...@@ -15,9 +15,12 @@ import org.springframework.context.annotation.Configuration; ...@@ -15,9 +15,12 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.core.env.Profiles; import org.springframework.core.env.Profiles;
import com.ippon.pouet.common.domain.Generated;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
@Generated
@Configuration @Configuration
public class LiquibaseConfiguration { public class LiquibaseConfiguration {
......
...@@ -8,6 +8,9 @@ import org.springframework.web.servlet.LocaleResolver; ...@@ -8,6 +8,9 @@ import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.*; import org.springframework.web.servlet.config.annotation.*;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import com.ippon.pouet.common.domain.Generated;
@Generated
@Configuration @Configuration
public class LocaleConfiguration implements WebMvcConfigurer { public class LocaleConfiguration implements WebMvcConfigurer {
......
package com.ippon.pouet.config; package com.ippon.pouet.config;
import com.ippon.pouet.aop.logging.LoggingAspect; import com.ippon.pouet.aop.logging.LoggingAspect;
import com.ippon.pouet.common.domain.Generated;
import io.github.jhipster.config.JHipsterConstants; import io.github.jhipster.config.JHipsterConstants;
import org.springframework.context.annotation.*; import org.springframework.context.annotation.*;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
@Generated
@Configuration @Configuration
@EnableAspectJAutoProxy @EnableAspectJAutoProxy
public class LoggingAspectConfiguration { public class LoggingAspectConfiguration {
......
...@@ -3,6 +3,8 @@ package com.ippon.pouet.config; ...@@ -3,6 +3,8 @@ package com.ippon.pouet.config;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.LoggerContext;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.ippon.pouet.common.domain.Generated;
import io.github.jhipster.config.JHipsterProperties; import io.github.jhipster.config.JHipsterProperties;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -16,6 +18,7 @@ import static io.github.jhipster.config.logging.LoggingUtils.*; ...@@ -16,6 +18,7 @@ import static io.github.jhipster.config.logging.LoggingUtils.*;
/* /*
* Configures the console and Logstash log appenders from the app properties * Configures the console and Logstash log appenders from the app properties
*/ */
@Generated
@Configuration @Configuration
public class LoggingConfiguration { public class LoggingConfiguration {
......
package com.ippon.pouet.config; package com.ippon.pouet.config;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.security.*; import com.ippon.pouet.security.*;
import com.ippon.pouet.security.jwt.*; import com.ippon.pouet.security.jwt.*;
...@@ -19,6 +20,7 @@ import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWrite ...@@ -19,6 +20,7 @@ import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWrite
import org.springframework.web.filter.CorsFilter; import org.springframework.web.filter.CorsFilter;
import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport; import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport;
@Generated
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
@Import(SecurityProblemSupport.class) @Import(SecurityProblemSupport.class)
......
...@@ -9,8 +9,11 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistra ...@@ -9,8 +9,11 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistra
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.ippon.pouet.common.domain.Generated;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Generated
@Configuration @Configuration
@Profile({JHipsterConstants.SPRING_PROFILE_PRODUCTION}) @Profile({JHipsterConstants.SPRING_PROFILE_PRODUCTION})
public class StaticResourcesWebConfiguration implements WebMvcConfigurer { public class StaticResourcesWebConfiguration implements WebMvcConfigurer {
......
...@@ -17,6 +17,8 @@ import org.springframework.web.cors.CorsConfiguration; ...@@ -17,6 +17,8 @@ import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter; import org.springframework.web.filter.CorsFilter;
import com.ippon.pouet.common.domain.Generated;
import javax.servlet.*; import javax.servlet.*;
import java.io.File; import java.io.File;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
...@@ -28,6 +30,7 @@ import static java.net.URLDecoder.decode; ...@@ -28,6 +30,7 @@ import static java.net.URLDecoder.decode;
/** /**
* Configuration of web application with Servlet 3.0 APIs. * Configuration of web application with Servlet 3.0 APIs.
*/ */
@Generated
@Configuration @Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> { public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
......
package com.ippon.pouet.config.audit; package com.ippon.pouet.config.audit;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.domain.PersistentAuditEvent; import com.ippon.pouet.domain.PersistentAuditEvent;
import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.boot.actuate.audit.AuditEvent;
...@@ -8,6 +9,7 @@ import org.springframework.stereotype.Component; ...@@ -8,6 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.*; import java.util.*;
@Generated
@Component @Component
public class AuditEventConverter { public class AuditEventConverter {
......
package com.ippon.pouet.domain; package com.ippon.pouet.domain;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ippon.pouet.common.domain.Generated;
import org.springframework.data.annotation.CreatedBy; import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate; import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy; import org.springframework.data.annotation.LastModifiedBy;
...@@ -17,6 +19,7 @@ import javax.persistence.MappedSuperclass; ...@@ -17,6 +19,7 @@ import javax.persistence.MappedSuperclass;
* Base abstract class for entities which will hold definitions for created, last modified, created by, * Base abstract class for entities which will hold definitions for created, last modified, created by,
* last modified by attributes. * last modified by attributes.
*/ */
@Generated
@MappedSuperclass @MappedSuperclass
@EntityListeners(AuditingEntityListener.class) @EntityListeners(AuditingEntityListener.class)
public abstract class AbstractAuditingEntity implements Serializable { public abstract class AbstractAuditingEntity implements Serializable {
......
...@@ -6,6 +6,9 @@ import javax.persistence.Table; ...@@ -6,6 +6,9 @@ import javax.persistence.Table;
import javax.persistence.Column; import javax.persistence.Column;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import com.ippon.pouet.common.domain.Generated;
import java.io.Serializable; import java.io.Serializable;
import java.util.Objects; import java.util.Objects;
...@@ -13,6 +16,7 @@ import java.util.Objects; ...@@ -13,6 +16,7 @@ import java.util.Objects;
* An authority (a security role) used by Spring Security. * An authority (a security role) used by Spring Security.
*/ */
@Entity @Entity
@Generated
@Table(name = "jhi_authority") @Table(name = "jhi_authority")
public class Authority implements Serializable { public class Authority implements Serializable {
......
package com.ippon.pouet.domain; package com.ippon.pouet.domain;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.config.Constants; import com.ippon.pouet.config.Constants;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
...@@ -21,6 +22,7 @@ import java.util.Set; ...@@ -21,6 +22,7 @@ import java.util.Set;
* A user. * A user.
*/ */
@Entity @Entity
@Generated
@Table(name = "jhi_user") @Table(name = "jhi_user")
public class User extends AbstractAuditingEntity implements Serializable { public class User extends AbstractAuditingEntity implements Serializable {
......
package com.ippon.pouet.repository; package com.ippon.pouet.repository;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.config.Constants; import com.ippon.pouet.config.Constants;
import com.ippon.pouet.config.audit.AuditEventConverter; import com.ippon.pouet.config.audit.AuditEventConverter;
import com.ippon.pouet.domain.PersistentAuditEvent; import com.ippon.pouet.domain.PersistentAuditEvent;
...@@ -18,6 +19,7 @@ import java.util.*; ...@@ -18,6 +19,7 @@ import java.util.*;
/** /**
* An implementation of Spring Boot's {@link AuditEventRepository}. * An implementation of Spring Boot's {@link AuditEventRepository}.
*/ */
@Generated
@Repository @Repository
public class CustomAuditEventRepository implements AuditEventRepository { public class CustomAuditEventRepository implements AuditEventRepository {
......
package com.ippon.pouet.security; package com.ippon.pouet.security;
import com.ippon.pouet.common.domain.Generated;
/** /**
* Constants for Spring Security authorities. * Constants for Spring Security authorities.
*/ */
@Generated
public final class AuthoritiesConstants { public final class AuthoritiesConstants {
public static final String ADMIN = "ROLE_ADMIN"; public static final String ADMIN = "ROLE_ADMIN";
......
package com.ippon.pouet.security; package com.ippon.pouet.security;
import com.ippon.pouet.common.domain.Generated;
import com.ippon.pouet.domain.User; import com.ippon.pouet.domain.User;
import com.ippon.pouet.repository.UserRepository; import com.ippon.pouet.repository.UserRepository;
import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator; import org.hibernate.validator.internal.constraintvalidators.hv.EmailValidator;
...@@ -19,6 +20,7 @@ import java.util.stream.Collectors; ...@@ -19,6 +20,7 @@ import java.util.stream.Collectors;
/** /**
* Authenticate a user from the database. * Authenticate a user from the database.
*/ */
@Generated
@Component("userDetailsService") @Component("userDetailsService")
public class DomainUserDetailsService implements UserDetailsService { public class DomainUserDetailsService implements UserDetailsService {
......
...@@ -6,12 +6,15 @@ import org.springframework.security.core.context.SecurityContext; ...@@ -6,12 +6,15 @@ import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import com.ippon.pouet.common.domain.Generated;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Stream; import java.util.stream.Stream;
/** /**
* Utility class for Spring Security. * Utility class for Spring Security.
*/ */
@Generated
public final class SecurityUtils { public final class SecurityUtils {
private SecurityUtils() { private SecurityUtils() {
......