From 0460d422b246ab80afb2d6e5279d609c45779c3a Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sun, 8 Jan 2023 15:17:02 +0400 Subject: [PATCH] fix tests --- build.gradle | 24 ++++++++++++------- .../{ => ru/ulstu}/StatisticServiceTest.java | 4 +++- 2 files changed, 18 insertions(+), 10 deletions(-) rename src/test/java/{ => ru/ulstu}/StatisticServiceTest.java (97%) diff --git a/build.gradle b/build.gradle index a92d81f..96922ab 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,12 @@ plugins { } jar { - archivesBaseName='time-series-smoothing' + archivesBaseName = 'time-series-smoothing' } +group 'ru.ulstu' +version '1.0-SNAPSHOT' + repositories { maven { url "https://repo.athene.tech/repository/maven-central/" @@ -17,8 +20,9 @@ repositories { } } -sourceCompatibility = '11' -targetCompatibility = '11' +test { + useJUnitPlatform() +} dependencies { ext { @@ -29,14 +33,15 @@ dependencies { implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jetty' implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf' - implementation group: 'org.slf4j', name: 'slf4j-api', version: versionSLF4J + 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.0.0' implementation group: 'org.javassist', name: 'javassist', version: '3.25.0-GA' - implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: versionJetty + implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: versionJetty - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind' - implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations' - implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind' + implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations' + implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310' implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.5' @@ -46,7 +51,8 @@ dependencies { implementation group: 'org.webjars', name: 'font-awesome', version: '4.7.0' implementation group: 'org.webjars', name: 'highcharts', version: '7.0.0' - testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' } diff --git a/src/test/java/StatisticServiceTest.java b/src/test/java/ru/ulstu/StatisticServiceTest.java similarity index 97% rename from src/test/java/StatisticServiceTest.java rename to src/test/java/ru/ulstu/StatisticServiceTest.java index 09835ed..f7fb030 100644 --- a/src/test/java/StatisticServiceTest.java +++ b/src/test/java/ru/ulstu/StatisticServiceTest.java @@ -1,6 +1,7 @@ +package ru.ulstu; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import ru.ulstu.TimeSeriesUtils; import ru.ulstu.datamodel.ts.TimeSeries; import ru.ulstu.datamodel.ts.TimeSeriesValue; import ru.ulstu.statistic.StatisticService; @@ -8,6 +9,7 @@ import ru.ulstu.statistic.StatisticService; import java.time.LocalDateTime; public class StatisticServiceTest { + private TimeSeries getTimeSeries() { TimeSeries ts = new TimeSeries(); for (int i = 0; i < 11; i++) {