fix tests

This commit is contained in:
Anton Romanov 2022-06-07 23:40:31 +04:00
parent af34fc9258
commit 0c92564bdb
5 changed files with 19 additions and 10 deletions

View File

@ -31,16 +31,12 @@ dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J
implementation group: 'nz.net.ultraq.thymeleaf', name: 'thymeleaf-layout-dialect', version: '3.1.0'
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.4'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'
testImplementation group: 'org.powermock', name: 'powermock-api-mockito-common', version: '1.7.4'
testImplementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
}
test {
useJUnitPlatform()
implementation group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.4'
implementation group: 'org.powermock', name: 'powermock-api-mockito', version: '1.7.4'
implementation group: 'org.powermock', name: 'powermock-api-mockito-common', version: '1.7.4'
implementation group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}

View File

@ -0,0 +1,8 @@
# Possible values: file or db
targetStorage=file
fileStorage=test-users.json
dbHost=localhost
dbName=unit-test
dbPort=5432
dbUser=postgres
dbPassword=postgres

View File

@ -1,3 +1,5 @@
package ru.ulstu;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

View File

@ -1,3 +1,5 @@
package ru.ulstu;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;

View File

@ -1,8 +1,9 @@
package ru.ulstu;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import ru.ulstu.UserService;
import ru.ulstu.entity.User;
import ru.ulstu.exception.UserNotValidException;
import ru.ulstu.persistence.FileStore;