Package guru.zoroark.tegral.di.test

Contains the test utilities.

Types

Link copied to clipboard
class NotAvailableInTestEnvironmentException(message: String) : TegralDiException

Error thrown when a feature that does not exist in controlled test environments (e.g. environments internally used by tegralDiCheck checks) is accessed. If you did not initiate the missing feature yourself:

Link copied to clipboard

Abstract class for tests that aim to test a "subject". This means tests that are based around testing features from a single component, with additional supporting modules/components added to the mix.

Link copied to clipboard
abstract class TegralDiBaseTest<TTestContext : TestMutableInjectionEnvironment>

Common base class for tests that use Tegral DI. This is mostly here to set the basic syntax of tests.

Link copied to clipboard
abstract class TegralSubjectTest<TSubject : Any>(subjectClass: KClass<TSubject>, baseModule: InjectableModule) : TegralAbstractSubjectTest<TSubject, UnsafeMutableEnvironment>

Base class for testing Tegral DI-applications.

Link copied to clipboard

Interface for common utilities in test Tegral DI environments, such as UnsafeMutableEnvironment. This is mostly intended to ease writing interfaces that combine further DSLs into a single interface (such as ControllerTestContext from Tegral Web Controllers).

Link copied to clipboard

A fully mutable extensible environment implementation with very little safety.

Functions

Link copied to clipboard
fun <T : Any> entryOf(declaration: Declaration<T>): Pair<Identifier<T>, Declaration<T>>

Creates an entry directly from a declaration instead of from a qualifier + supplier.

inline fun <T : Any> entryOf(qualifier: Qualifier = EmptyQualifier, noinline supplier: ScopedSupplier<T>): Pair<Identifier<T>, ScopedSupplierDeclaration<T>>

Creates a Declaration, automatically creating the identifier from T and qualifier and using the given supplier. Returns a pair with the identifier and the declaration.