Skip to content

NullPointerException when executing all test #1495

@ccudennec-otto

Description

@ccudennec-otto

Describe the bug
I use a standalone test to generate my AsyncAPI documentation. When I execute the test standalone, everything works fine. But if I run all my tests, I get a NullPointerException when the proper type of a property is identified:

This error was probably caused by the recent code changes: #1416

Dependencies and versions used

  • springwolf-kafka version 1.19.0

Code example
I can grant you code access company internally if it helps.

Stack trace and error logs

2025-11-03 07:15:22,307 ERROR logger="io.github.springwolf.core.asyncapi.channels.DefaultChannelsService" message="An error was encountered during channel scanning with io.github.springwolf.core.asyncapi.scanners.channels.ChannelsInClassScannerAdapter@2d0c1399: null" thread="Test worker"  
java.lang.NullPointerException: null
  at java.base/java.util.Objects.requireNonNull(Objects.java:233)
  at java.base/java.util.ImmutableCollections$Set12.<init>(ImmutableCollections.java:790)
  at java.base/java.util.Set.of(Set.java:470)
  at io.github.springwolf.asyncapi.v3.model.schema.SchemaObject$SchemaObjectBuilder.type(SchemaObject.java:165)
  at io.github.springwolf.core.asyncapi.schemas.SwaggerSchemaUtil.assignType(SwaggerSchemaUtil.java:189)
  at io.github.springwolf.core.asyncapi.schemas.SwaggerSchemaUtil.mapSchema(SwaggerSchemaUtil.java:75)

I can see that this error is also shown in the test output when the documentation generation is triggered by SpringwolfInitApplicationListener. Does this point to some kind of race condition?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions