From 9ea2912e98a62fd79bf909a95c8e650e625eacc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Thu, 3 Sep 2020 16:30:42 +0200 Subject: [PATCH] Added ConfiguratorTest.java. Updated pom.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- buisnesslogic/pom.xml | 13 ++++++-- .../configutils/ConfiguratorTest.java | 33 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 buisnesslogic/src/test/java/com/plannaplan/configutils/ConfiguratorTest.java diff --git a/buisnesslogic/pom.xml b/buisnesslogic/pom.xml index 77e0dd0..52928ba 100644 --- a/buisnesslogic/pom.xml +++ b/buisnesslogic/pom.xml @@ -28,8 +28,17 @@ 4.11 test - - + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + javax.xml.bind jaxb-api diff --git a/buisnesslogic/src/test/java/com/plannaplan/configutils/ConfiguratorTest.java b/buisnesslogic/src/test/java/com/plannaplan/configutils/ConfiguratorTest.java new file mode 100644 index 0000000..446c2d8 --- /dev/null +++ b/buisnesslogic/src/test/java/com/plannaplan/configutils/ConfiguratorTest.java @@ -0,0 +1,33 @@ +package com.plannaplan.configutils; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; + +import java.io.InputStream; + +import com.plannaplan.Configurator; +import com.plannaplan.models.ConfigData; + +import org.junit.Test; + +@SpringBootTest +public class ConfiguratorTest { + + @Autowired + private Configurator restTemplate; + + @Test + public void greetingShouldReturnDefaultMessage() throws Exception { + InputStream inputStream = getClass().getClassLoader().getResourceAsStream("Zajecia.xlsx"); + ConfigData data = new ConfigData(null,null,inputStream); + this.restTemplate.config(data); + assertTrue(true); + + } +} \ No newline at end of file