diff --git a/docs/src/main/asciidoc/writing-extensions.adoc b/docs/src/main/asciidoc/writing-extensions.adoc index bac8aab0544353..c15f675f251e29 100644 --- a/docs/src/main/asciidoc/writing-extensions.adoc +++ b/docs/src/main/asciidoc/writing-extensions.adoc @@ -310,6 +310,25 @@ SyntheticBeanBuildItem syntheticBean(TestRecorder recorder) { ---- <1> The "real" components can inject the `TestContext` directly. + +It is also possible to create a generic synthetic bean `Foo<Bar>`. + +[source%nowrap,java] +---- +@BuildStep +@Record(STATIC_INIT) +SyntheticBeanBuildItem syntheticBean(TestRecorder recorder) { + return SyntheticBeanBuildItem.configure(Foo.class) + .types(ParameterizedType.create(Foo.class, ClassType.create(Bar.class)))) <1> + .scope(Singleton.class) + .runtimeValue(recorder.createFooBar()) + .done(); +} +---- + +<1> types must be used to specify the generic type. + + === Some types of extensions There exist multiple stereotypes of extension, let's list a few.