Metro 0.10.0: Classes annotated with ContributesIntoSet do not need to be annotated with Inject.
This commit is contained in:
parent
e3a3691415
commit
c901772145
24 changed files with 25 additions and 46 deletions
|
|
@ -15,6 +15,8 @@ import com.lemonappdev.konsist.api.verify.assertFalse
|
|||
import com.lemonappdev.konsist.api.verify.assertTrue
|
||||
import dev.zacsweers.metro.Assisted
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import dev.zacsweers.metro.ContributesIntoMap
|
||||
import dev.zacsweers.metro.ContributesIntoSet
|
||||
import dev.zacsweers.metro.Inject
|
||||
import org.junit.Test
|
||||
|
||||
|
|
@ -46,4 +48,26 @@ class KonsistDiTest {
|
|||
classDeclaration.hasAnnotationOf(Inject::class)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `class annotated with @ContributesIntoSet does not need to be annotated with @Inject anymore`() {
|
||||
Konsist
|
||||
.scopeFromProject()
|
||||
.classes()
|
||||
.withAnnotationOf(ContributesIntoSet::class)
|
||||
.assertFalse { classDeclaration ->
|
||||
classDeclaration.hasAnnotationOf(Inject::class)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `class annotated with @ContributesIntoMap does not need to be annotated with @Inject anymore`() {
|
||||
Konsist
|
||||
.scopeFromProject()
|
||||
.classes()
|
||||
.withAnnotationOf(ContributesIntoMap::class)
|
||||
.assertFalse { classDeclaration ->
|
||||
classDeclaration.hasAnnotationOf(Inject::class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue