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> </dependency>
</dependencies> </dependencies>
</plugin> </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> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version> <version>3.1.0</version>

View File

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

View File

@ -18,5 +18,4 @@ class ObservationDatabaseApplicationTests {
fun contextLoads() { fun contextLoads() {
assertNotNull(controller) 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.boot.test.autoconfigure.orm.jpa.TestEntityManager
import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Autowired
@RunWith(SpringRunner::class) @RunWith(SpringRunner::class)
@DataJpaTest @DataJpaTest
class RepositoryTest { class RepositoryTest {