Added ConfiguratorTest.java. Updated pom.xml

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-09-03 16:30:42 +02:00
parent b65c56078b
commit 9ea2912e98
2 changed files with 44 additions and 2 deletions

View File

@ -28,8 +28,17 @@
<version>4.11</version> <version>4.11</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>javax.xml.bind</groupId> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <artifactId>jaxb-api</artifactId>

View File

@ -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);
}
}