Added linting to build.

This commit is contained in:
neviyn 2018-10-09 16:43:32 +01:00
parent 185f258b6f
commit a52da46f52
4 changed files with 34 additions and 25 deletions

View File

@ -161,6 +161,20 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>com.github.gantsign.maven</groupId>
<artifactId>ktlint-maven-plugin</artifactId>
<version>0.9.14</version>
<executions>
<execution>
<id>format-and-check</id>
<goals>
<goal>format</goal>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>

View File

@ -133,8 +133,7 @@ class ControllerTest {
}
@Test
fun testGetObservationsForTutor_NoTutor()
{
fun testGetObservationsForTutor_NoTutor() {
doReturn(Optional.ofNullable(null)).`when`(tutorRepository).findById(1)
val result = controller.getObservationsForTutor(1)
assertTrue(result.isEmpty())
@ -152,5 +151,4 @@ class ControllerTest {
val result = controller.addObservation(newData)
assertEquals(1L, result)
}
}

View File

@ -18,5 +18,4 @@ class ObservationDatabaseApplicationTests {
fun contextLoads() {
assertNotNull(controller)
}
}

View File

@ -9,8 +9,6 @@ import org.springframework.test.context.junit4.SpringRunner
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager
import org.springframework.beans.factory.annotation.Autowired
@RunWith(SpringRunner::class)
@DataJpaTest
class RepositoryTest {