Commit 002d0de3 authored by Colin DAMON's avatar Colin DAMON

Upgrade prettier

parent 4a32243d
......@@ -19,6 +19,7 @@ import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
......@@ -97,7 +98,6 @@ public class MavenWrapperDownloader {
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(
new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
......
......@@ -22,6 +22,7 @@ import org.springframework.core.env.Environment;
@SpringBootApplication
@EnableConfigurationProperties({ LiquibaseProperties.class, ApplicationProperties.class })
public class BorestopApp {
private static final Logger log = LoggerFactory.getLogger(BorestopApp.class);
private final Environment env;
......
......@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
@Service
public class ActivitesApplicationService {
private final ActivitiesFactory activities;
public ActivitesApplicationService(IdeasRepository ideas, PartnersRepository partners) {
......
package com.ippon.borestop.activity.domain;
public class Activities {
private final IdeasRepository ideas;
private final PartnersRepository partners;
......
package com.ippon.borestop.activity.domain;
public class ActivitiesFactory {
private final IdeasRepository ideas;
private final PartnersRepository partners;
......
......@@ -4,6 +4,7 @@ import com.ippon.borestop.common.domain.error.Assert;
import java.util.Collection;
public class Activity {
private final Idea idea;
private final Partners partners;
......
......@@ -3,5 +3,5 @@ package com.ippon.borestop.activity.domain;
public enum Category {
COOKING,
RELAXATION,
DEFAULT
DEFAULT,
}
......@@ -3,6 +3,7 @@ package com.ippon.borestop.activity.domain;
import com.ippon.borestop.common.domain.error.Assert;
public class Idea {
private final String label;
private final Category category;
......
......@@ -3,6 +3,7 @@ package com.ippon.borestop.activity.domain;
import com.ippon.borestop.common.domain.error.Assert;
public class Partner {
private final String name;
private final String website;
......@@ -27,6 +28,7 @@ public class Partner {
}
public static class PartnerBuilder {
private String name;
private String website;
......
......@@ -6,6 +6,7 @@ import java.util.Collections;
import java.util.List;
public class Partners {
private final Collection<Partner> partners;
private Partners(PartnersBuilder builder) {
......@@ -25,6 +26,7 @@ public class Partners {
}
public static class PartnersBuilder {
private final List<Partner> partners = new ArrayList<>();
public PartnersBuilder add(Partner partner) {
......
......@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "Activities")
@RequestMapping("/api/activity")
class ActivitesResource {
private final ActivitesApplicationService activites;
public ActivitesResource(ActivitesApplicationService activites) {
......
......@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
@ApiModel(value = "Activity", description = "An ideal activity for you!")
class RestActivity {
private final String label;
private final Collection<RestPartner> partners;
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
@ApiModel(value = "Partner", description = "Partner for an idea")
class RestPartner {
private final String name;
private final String website;
......
......@@ -11,6 +11,7 @@ enum BoredApiCategory {
COOKING("cooking"),
RELAXATION("relaxation"),
DEFAULT("default");
private static final Map<String, BoredApiCategory> categories = buildCategories();
private static Map<String, BoredApiCategory> buildCategories() {
......
......@@ -10,6 +10,7 @@ import org.springframework.web.client.RestTemplate;
@Service
class BoredApiIdeasRepository implements IdeasRepository {
private final RestTemplate rest;
private final String url;
......
......@@ -9,6 +9,7 @@ import org.springframework.validation.annotation.Validated;
@Validated
@ConfigurationProperties("bored-api")
class BoredApiProperties {
private String url;
private Duration connectTimeout;
private Duration readTimeout;
......
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.ippon.borestop.activity.domain.Idea;
class BoredApiResponse {
private final String activity;
private final String type;
......
......@@ -22,6 +22,7 @@ import org.springframework.core.env.Profiles;
@Aspect
@Generated
public class LoggingAspect {
private final Environment env;
public LoggingAspect(Environment env) {
......
......@@ -58,6 +58,7 @@ import java.util.Map;
* </p>
*/
public class BorestopException extends RuntimeException {
private final Map<String, String> arguments;
private final ErrorStatus status;
private final BorestopMessage borestopMessage;
......@@ -126,6 +127,7 @@ public class BorestopException extends RuntimeException {
}
public static class BorestopExceptionBuilder {
private final Map<String, String> arguments = new HashMap<>();
private String message;
private ErrorStatus status;
......
......@@ -6,5 +6,5 @@ public enum ErrorStatus {
FORBIDDEN,
NOT_FOUND,
CONFLICT,
INTERNAL_SERVER_ERROR
INTERNAL_SERVER_ERROR,
}
......@@ -6,6 +6,7 @@ public enum StandardMessage implements BorestopMessage {
INTERNAL_SERVER_ERROR("server.internal-server-error"),
SERVER_MANDATORY_NULL("server.mandatory-null"),
SERVER_MANDATORY_BLANK("server.mandatory-blank");
private final String messageKey;
private StandardMessage(String code) {
......
......@@ -3,6 +3,7 @@ package com.ippon.borestop.common.infrastructure.primary;
import java.util.Map;
final class ArgumentsReplacer {
private static final String OPEN_MUSTACHE = "\\{\\{\\s*";
private static final String CLOSE_MUSTACHE = "\\s*\\}\\}";
......
......@@ -4,6 +4,7 @@ import com.ippon.borestop.common.domain.error.BorestopMessage;
enum AuthenticationMessage implements BorestopMessage {
NOT_AUTHENTICATED("user.authentication-not-authenticated");
private final String messageKey;
AuthenticationMessage(String messageKey) {
......
......@@ -11,6 +11,7 @@ import java.util.List;
@ApiModel(description = "Error result for a WebService call")
public class BorestopError {
@ApiModelProperty(value = "Technical type of this error", example = "user.mandatory", required = true)
private final String errorType;
......
......@@ -40,6 +40,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExcep
@ControllerAdvice
public class BorestopErrorHandler extends ResponseEntityExceptionHandler {
private static final String MESSAGE_PREFIX = "borestop.error.";
private static final String DEFAULT_KEY = StandardMessage.INTERNAL_SERVER_ERROR.getMessageKey();
private static final String BAD_REQUEST_KEY = StandardMessage.BAD_REQUEST.getMessageKey();
......
......@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiModelProperty;
@JsonDeserialize(builder = BorestopFieldErrorBuilder.class)
@ApiModel(description = "Error for a field validation")
public class BorestopFieldError {
@ApiModelProperty(value = "Path to the field in error", example = "address.country", required = true)
private final String fieldPath;
......@@ -45,6 +46,7 @@ public class BorestopFieldError {
@JsonPOJOBuilder(withPrefix = "")
public static class BorestopFieldErrorBuilder {
private String fieldPath;
private String reason;
private String message;
......
package com.ippon.borestop.common.infrastructure.primary;
public final class ValidationMessage {
public static final String MANDATORY = "user.mandatory";
public static final String WRONG_FORMAT = "user.wrong-format";
public static final String RPPS_FORMAT = "user.wrong-national-id-format";
......
......@@ -20,6 +20,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@Configuration
@EnableScheduling
public class AsyncConfiguration implements AsyncConfigurer {
private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);
private final TaskExecutionProperties taskExecutionProperties;
......
......@@ -17,6 +17,7 @@ import org.springframework.web.servlet.HandlerExceptionResolver;
@Generated
@Component
class AuthenticationErrorsHandler implements AuthenticationEntryPoint, AccessDeniedHandler {
private final HandlerExceptionResolver resolver;
@Autowired
......
......@@ -13,6 +13,7 @@ import org.springframework.context.annotation.*;
@Configuration
@Profile(JHipsterConstants.SPRING_PROFILE_CLOUD)
public class CloudDatabaseConfiguration extends AbstractCloudConfig {
private final Logger log = LoggerFactory.getLogger(CloudDatabaseConfiguration.class);
private static final String CLOUD_CONFIGURATION_HIKARI_PREFIX = "spring.datasource.hikari";
......
......@@ -7,6 +7,7 @@ import com.ippon.borestop.common.infrastructure.Generated;
*/
@Generated
public final class Constants {
// Regex for acceptable logins
public static final String LOGIN_REGEX = "^(?>[a-zA-Z0-9!$&*+=?^_`{|}~.-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)|(?>[_.@A-Za-z0-9-]+)$";
......
......@@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
private final Environment env;
......
......@@ -21,6 +21,7 @@ import org.springframework.core.env.Profiles;
@Generated
@Configuration
public class LiquibaseConfiguration {
private final Logger log = LoggerFactory.getLogger(LiquibaseConfiguration.class);
private final Environment env;
......
......@@ -25,8 +25,7 @@ public class LoggingConfiguration {
@Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties,
ObjectMapper mapper
)
throws JsonProcessingException {
) throws JsonProcessingException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
Map<String, String> map = new HashMap<>();
......
......@@ -26,6 +26,7 @@ import org.springframework.web.filter.CorsFilter;
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
private final TokenProvider tokenProvider;
private final CorsFilter corsFilter;
......@@ -99,7 +100,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
.and()
.securityContext()
.securityContextRepository(securityContextRepository());
// @formatter:on
// @formatter:on
}
@Bean
......
......@@ -15,10 +15,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@Profile({ JHipsterConstants.SPRING_PROFILE_PRODUCTION })
public class StaticResourcesWebConfiguration implements WebMvcConfigurer {
protected static final String[] RESOURCE_LOCATIONS = new String[] {
"classpath:/static/app/",
"classpath:/static/content/",
"classpath:/static/i18n/"
"classpath:/static/i18n/",
};
protected static final String[] RESOURCE_PATHS = new String[] { "/app/*", "/content/*", "/i18n/*" };
......
......@@ -31,6 +31,7 @@ import org.springframework.web.filter.CorsFilter;
@Generated
@Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);
private final Environment env;
......
......@@ -21,6 +21,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
public abstract class AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@CreatedBy
......
......@@ -17,6 +17,7 @@ import javax.validation.constraints.Size;
@Generated
@Table(name = "jhi_authority")
public class Authority implements Serializable {
private static final long serialVersionUID = 1L;
@NotNull
......
......@@ -17,6 +17,7 @@ import javax.validation.constraints.NotNull;
@Generated
@Table(name = "jhi_persistent_audit_event")
public class PersistentAuditEvent implements Serializable {
private static final long serialVersionUID = 1L;
@Id
......
......@@ -23,6 +23,7 @@ import org.hibernate.annotations.BatchSize;
@Generated
@Table(name = "jhi_user")
public class User extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
......
......@@ -20,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
@Generated
@Repository
public class CustomAuditEventRepository implements AuditEventRepository {
private static final String AUTHORIZATION_FAILURE = "AUTHORIZATION_FAILURE";
/**
......
......@@ -7,6 +7,7 @@ import com.ippon.borestop.common.infrastructure.Generated;
*/
@Generated
public final class AuthoritiesConstants {
public static final String ADMIN = "ROLE_ADMIN";
public static final String USER = "ROLE_USER";
......
......@@ -22,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
@Generated
@Component("userDetailsService")
public class DomainUserDetailsService implements UserDetailsService {
private final Logger log = LoggerFactory.getLogger(DomainUserDetailsService.class);
private final UserRepository userRepository;
......
......@@ -8,6 +8,7 @@ import org.springframework.security.core.AuthenticationException;
*/
@Generated
public class UserNotActivatedException extends AuthenticationException {
private static final long serialVersionUID = 1L;
public UserNotActivatedException(String message) {
......
......@@ -8,6 +8,7 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
@Generated
public class JWTConfigurer extends SecurityConfigurerAdapter<DefaultSecurityFilterChain, HttpSecurity> {
private final TokenProvider tokenProvider;
public JWTConfigurer(TokenProvider tokenProvider) {
......
......@@ -18,6 +18,7 @@ import org.springframework.web.filter.GenericFilterBean;
*/
@Generated
public class JWTFilter extends GenericFilterBean {
public static final String AUTHORIZATION_HEADER = "Authorization";
private final TokenProvider tokenProvider;
......
......@@ -23,6 +23,7 @@ import org.springframework.util.StringUtils;
@Generated
@Component
public class TokenProvider {
private final Logger log = LoggerFactory.getLogger(TokenProvider.class);
private static final String AUTHORITIES_KEY = "auth";
......
......@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Transactional;
@Generated
@Transactional
public class AuditEventService {
private final Logger log = LoggerFactory.getLogger(AuditEventService.class);
private final JHipsterProperties jHipsterProperties;
......
......@@ -6,6 +6,7 @@ import com.ippon.borestop.common.infrastructure.Generated;
@Generated
public class EmailAlreadyUsedException extends BorestopException {
private static final long serialVersionUID = 1L;
public EmailAlreadyUsedException() {
......
......@@ -6,6 +6,7 @@ import com.ippon.borestop.common.infrastructure.Generated;
@Generated
public class LoginAlreadyUsedException extends BorestopException {
private static final long serialVersionUID = 1L;
public LoginAlreadyUsedException() {
......
......@@ -26,6 +26,7 @@ import org.thymeleaf.spring5.SpringTemplateEngine;
@Service
@Generated
public class MailService {
private final Logger log = LoggerFactory.getLogger(MailService.class);
private static final String USER = "user";
......
......@@ -6,6 +6,7 @@ enum UserMessage implements BorestopMessage {
EMAIL_ALREADY_USED("user.e-mail-already-used"),
LOGIN_ALREADY_USED("user.login-already-used"),
INVALID_PASSWORD("user.invalid-password");
private final String messageKey;
private UserMessage(String messageKey) {
......
......@@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
@Generated
@Transactional
public class UserService {
private final Logger log = LoggerFactory.getLogger(UserService.class);
private final UserRepository userRepository;
......
......@@ -7,6 +7,7 @@ import com.ippon.borestop.common.infrastructure.Generated;
*/
@Generated
public class PasswordChangeDTO {
private String currentPassword;
private String newPassword;