Added some initialisation tests
This commit is contained in:
parent
96104c3899
commit
bd09ba1fe0
@ -1,6 +1,9 @@
|
|||||||
package uk.co.neviyn.booru
|
package uk.co.neviyn.booru
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Assertions.assertNotNull
|
||||||
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
import org.springframework.boot.test.context.SpringBootTest
|
import org.springframework.boot.test.context.SpringBootTest
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@ -10,4 +13,39 @@ class BooruApplicationTests {
|
|||||||
fun contextLoads() {
|
fun contextLoads() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun repositoriesLoad(
|
||||||
|
@Autowired memberRepository: MemberRepository?,
|
||||||
|
@Autowired imageRepository: ImageRepository?,
|
||||||
|
@Autowired tagRepository: TagRepository?,
|
||||||
|
@Autowired roleRepository: RoleRepository?
|
||||||
|
) {
|
||||||
|
assertNotNull(memberRepository)
|
||||||
|
assertNotNull(imageRepository)
|
||||||
|
assertNotNull(tagRepository)
|
||||||
|
assertNotNull(roleRepository)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun servicesLoad(
|
||||||
|
@Autowired fileSystemStorageService: FileSystemStorageService?,
|
||||||
|
@Autowired customUserDetailsService: CustomUserDetailsService?
|
||||||
|
) {
|
||||||
|
assertNotNull(fileSystemStorageService)
|
||||||
|
assertNotNull(customUserDetailsService)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun configurationPropertiesLoad(
|
||||||
|
@Autowired imageConfigurationProperties: ImageConfigurationProperties?
|
||||||
|
) {
|
||||||
|
assertNotNull(imageConfigurationProperties)
|
||||||
|
assertNotNull(imageConfigurationProperties!!.directory)
|
||||||
|
assertNotNull(imageConfigurationProperties.types)
|
||||||
|
assertTrue(imageConfigurationProperties.types.isNotEmpty())
|
||||||
|
assertTrue(imageConfigurationProperties.directory.exists())
|
||||||
|
assertTrue(imageConfigurationProperties.directory.canRead())
|
||||||
|
assertTrue(imageConfigurationProperties.directory.canWrite())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user