I was able to get the repo to run the tests correctly past this
particular issue.  All the changes I made to get it to work are in
this commit

https://github.com/lucidguppy/learning-quarkus-camel-testing/commit/3200e96ad46e9579ba4c085e2a8bba4c090f3d8e

What tipped me off was debugging and seeing everything get initiated
in the correct way, but the injection test kept saying the field in
question didn't have the injection notation I created.

The link that tipped me off on how to annotate the annotation in
kotlin so it would work is here:
https://discuss.kotlinlang.org/t/confusion-about-field-annotation/26272/5

Phew - that was a challenge.

On Sat, Nov 18, 2023 at 11:03 AM Matthew Karas
<matthew.james.ka...@gmail.com> wrote:
>
> Hello,
>
> I am learning how to properly test camel code using test containers
> and I am finding difficulty with lateinit items in my test when trying
> to inject items created in QuarkusTestResourceLifecycleManager that
> are injected into the test.  Ultimately - I would like to be able to
> set up resources in localstack before the test runs and tear them down
> afterwards.
>
> My code you can find here:
> https://github.com/lucidguppy/learning-quarkus-camel-testing/blob/main/src/test/kotlin/com/example/PlanetaryConduitRouteTest.kt
>
> My intent is to use the technique as described in "Injection into tests"
> https://quarkus.io/guides/getting-started-testing#injection-into-tests
>
> I then added a commit to attempt the technique as described here
> https://quarkus.io/guides/getting-started-testing#altering-the-test-class
>
> I'm getting the following error message.
>
> kotlin.UninitializedPropertyAccessException: lateinit property s3 has
> not been initialized
>     at 
> com.example.PlanetaryConduitRouteTest.getS3(PlanetaryConduitRouteTest.kt:82)
>
> At this point I'm not even testing the routes - all I'm trying to do
> is set up and tear down s3 buckets in the setUp and tearDown.
>
> Any help would be greatly appreciated.

Reply via email to