Conversation
- Добавление исключения QuestionsFileLoadingException. - Работа с консолью вынесена в сервис ConsoleService. - Тесты для QuestionsDAO.
- Добавлены тесты.
- Изменения в структуре файлов.
- Использование библиотеки lombok.
- Файл настроек. - Java + Annotation-based конфигурация.
- Добавление своего баннера.
pom.xml
Outdated
| <properties> | ||
| <java.version>11</java.version> | ||
| <maven.compiler.source>${java.version}</maven.compiler.source> | ||
| <maven.compiler.target>${java.version}</maven.compiler.target> |
There was a problem hiding this comment.
Вах, как красиво) Но эо не обязательно добавлять со Spring Boot. Spring Boot parent содержит именно эти строчки от java.version
pom.xml
Outdated
| <artifactId>junit</artifactId> | ||
| <version>4.12</version> | ||
| <scope>test</scope> | ||
| </dependency> |
There was a problem hiding this comment.
Если Вы используете jupiter (junit5), то junit4 в идеале быть не должно (только для легаси кода)
| <target>${java.version}</target> | ||
| <encoding>${encoding}</encoding> | ||
| </configuration> | ||
| </plugin> |
There was a problem hiding this comment.
Вот это как раз уже есть в parent-e
|
|
||
| @SpringBootApplication | ||
| @PropertySource("classpath:application.yml") | ||
| @EnableConfigurationProperties({LocaleProperties.class, QuetionsProperties.class}) |
There was a problem hiding this comment.
А этотне обязательно добавлять, если Вы LocaleProperties делаете компонентом
| @Data | ||
| public class Question implements Serializable { | ||
|
|
||
| public static final String c_id = "id"; |
There was a problem hiding this comment.
- Так, для static-final переменных название должно быть C_ID
- Без этой константы прекрасно можно обойтись
| String answer = null; | ||
| boolean okAnswer = false; | ||
| int i = 0; | ||
| while (!okAnswer && i < 4) { |
| Question.c_answer3, | ||
| Question.c_answer4, | ||
| Question.c_trueAnswer | ||
| }); |
There was a problem hiding this comment.
Вот это можно аак раз переписать)
| \:\ /:/ / \:\ /:/ / \:\ \ \:\ \:\__\ \:\ \:\__\ | ||
| \:\/:/ / \:\/:/ / \:\ \ \:\ \/__/ \:\/:/ / | ||
| \::/ / \::/ / \:\__\ \:\__\ \::/ / | ||
| \/__/ \/__/ \/__/ \/__/ \/__/ No newline at end of file |
| @DisplayName("Класс LocalisationServiceImpl") | ||
| @RunWith(SpringRunner.class) | ||
| @SpringBootTest | ||
| @ActiveProfiles("ru") |
There was a problem hiding this comment.
Вот лучше проще профилями совсем ее пользоваться)
| () -> assertNotNull(value), | ||
| () -> assertEquals("При и вет - Привет", value) | ||
| ); | ||
| } |
There was a problem hiding this comment.
А вот логику тестирования, по-хорошему, надо проверить.
No description provided.