Skip to content

Commit

Permalink
Fix null check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ozsie committed Sep 9, 2024
1 parent 2a91a2c commit 681d8de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ object CheckWithTypeResolutionMojoTestFactory {

private val invalidPackageNamingDirectoryPath by lazy {
val uri = CheckWithTypeResolutionMojoTest::class.java.classLoader
.getResource("code-samples/invalid-package-naming")!!.toURI()
.getResource("code-samples/invalid-package-naming")?.toURI() ?: error("Failed to load resource")
Paths.get(uri).toString()
}

private val validPackageNamingDirectoryPath by lazy {
val uri = CheckWithTypeResolutionMojoTest::class.java.classLoader
.getResource("code-samples/valid")!!.toURI()
.getResource("code-samples/valid")?.toURI() ?: error("Failed to load resource")
Paths.get(uri).toString()
}

fun create(block: CTRMojo.() -> Unit = {}): CTRMojo {
private fun create(block: CTRMojo.() -> Unit = {}): CTRMojo {
return CTRMojo().apply {
input = validPackageNamingDirectoryPath
mavenProject = createMockMavenProject()
Expand Down

0 comments on commit 681d8de

Please sign in to comment.