Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
pionas committed Dec 4, 2023
1 parent a7df995 commit a312b37
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/main/java/info/pionas/quiz/api/quiz/NewAnswerDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@NoArgsConstructor
@Getter
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/info/pionas/quiz/api/quiz/NewQuestionDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import info.pionas.quiz.infrastructure.database.quiz.QuestionEntity;
import info.pionas.quiz.infrastructure.database.quiz.QuizEntity;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mapping;

@Mapper(componentModel = "spring")
interface QuizJpaMapper {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package info.pionas.quiz.domain.quiz;

import info.pionas.quiz.domain.quiz.api.*;
import info.pionas.quiz.domain.quiz.api.NewQuestion;
import info.pionas.quiz.domain.quiz.api.NewQuiz;
import info.pionas.quiz.domain.quiz.api.Quiz;
import info.pionas.quiz.domain.quiz.api.UpdateQuestion;
import info.pionas.quiz.domain.shared.UuidGenerator;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.UUID;

@Service
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/info/pionas/quiz/domain/quiz/api/Quiz.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void updateQuestion(UUID questionId, String content, List<Answer> answers
.forEach(question -> question.update(content, answers));
}

private static boolean isEquals(UUID questionId, Question question) {
private boolean isEquals(UUID questionId, Question question) {
return Objects.equals(question.getId(), questionId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void should_throw_not_found_exception_when_try_update_question_and_quiz_by_id_no
.isEqualTo(String.format("Quiz by ID %s not exist", quizId));
}

private static Quiz getQuiz(UUID quizId) {
private Quiz getQuiz(UUID quizId) {
return Quiz.builder()
.id(quizId)
.title("Title")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class UserServiceTest {

private final UserRepository userRepository = Mockito.mock(UserRepository.class);
private final UserValidator userValidator = new UserValidator(List.of(new UsernameValidationRule(userRepository), new UserPasswordMatchedValidationRule()));
private final UserService service = new UserServiceImpl(userRepository, userValidator, passwordEncoder);
private final PasswordEncoder passwordEncoder = Mockito.mock(PasswordEncoder.class);
private final UserService service = new UserServiceImpl(userRepository, userValidator, passwordEncoder);

@Test
void should_create_user() {
Expand Down

0 comments on commit a312b37

Please sign in to comment.