Похоже, что моя IDE (IntellIj Idea) разрешает аннотации JUnit 5. Все они доступны и функциональны.
Но когда я пытаюсь аннотировать OwnerSDJpaServiceTest с помощью @ExtendWith(MockitoExtension.class), IntelIj продолжает сообщать мне, что он
"не может разрешить символ "MockitoExtension".
Мне кажется, что мне не хватает некоторых зависимостей, но я посмотрел
видео на YouTube и некоторую документацию, и мне кажется, что все в порядке. Так что я не знаю, в чем может быть реальная проблема.
Возможно, мне не хватает зависимости или у меня неправильно настроены файлы POM.
Если вам нужно просмотреть все приложение, воспользуйтесь этой ссылкой на мой репозиторий GitHub.
Вот мой корневой pom. файл:
Код: Выделить всё
4.0.0
guru.springframework
sfg-pet-clinic
0.0.5-SNAPSHOT
pet-clinic-data
pet-clinic-web
pom
sfg-pet-clinic
SFG Pet Clinic Project
org.springframework.boot
spring-boot-starter-parent
2.0.3.RELEASE
3.3.6
1.11.4
2.2.4
1.8.0
pet-clinic-data
guru.springframework
0.0.5-SNAPSHOT
org.springframework.boot
spring-boot-starter-actuator
org.springframework.boot
spring-boot-starter-thymeleaf
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-devtools
runtime
org.webjars
webjars-locator-core
org.webjars
jquery
${webjars-jquery.version}
org.webjars
jquery-ui
${webjars-jquery-ui.version}
org.webjars
bootstrap
${webjars-bootstrap.version}
org.springframework.boot
spring-boot-starter-test
test
junit
junit
org.junit.jupiter
junit-jupiter-api
test
org.junit.jupiter
junit-jupiter-engine
test
ro.isdc.wro4j
wro4j-maven-plugin
${wro4j.version}
generate-resources
run
ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory
${project.build.directory}/classes/static/resources/css
${basedir}/src/main/wro/wro.xml
${basedir}/src/main/wro/wro.properties
${basedir}/src/main/less
org.webjars
bootstrap
${webjars-bootstrap.version}
org.mockito
mockito-core
2.23.4
maven-surefire-plugin
2.22.0
org.mockito
mockito-junit-jupiter
2.27.0
runtime
Код: Выделить всё
package guru.springframework.sfgpetclinic.services.springdatajpa;
import guru.springframework.sfgpetclinic.repositories.OwnerRepository;
import guru.springframework.sfgpetclinic.repositories.PetRepository;
import guru.springframework.sfgpetclinic.repositories.PetTypeRepository;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import static org.junit.jupiter.api.Assertions.*;
@ExtendWith(MockitoExtension.class)
class OwnerSDJpaServiceTest {
OwnerRepository ownerRepository;
PetRepository petRepository;
PetTypeRepository petTypeRepository;
OwnerSDJpaService service;
@BeforeEach
void setUp() {
}
@Test
void findByLastName() {
}
@Test
void findAll() {
}
@Test
void findById() {
}
@Test
void save() {
}
@Test
void delete() {
}
@Test
void deleteById() {
}
}
Подробнее здесь: https://stackoverflow.com/questions/557 ... lved-error
Мобильная версия