Class RestStubFieldsSupport

  • All Implemented Interfaces:
    GuiceyConfigurationHook, TestExecutionListener, TestEnvironmentSetup

    public class RestStubFieldsSupport
    extends AnnotatedTestFieldSetup<StubRest,​RestClient>
    implements GuiceyConfigurationHook
    StubRest field support implementation.

    Only one annotated field is supported. Ready to use rest client injected as field value.

    By default, all rest resources and jersey extensions registered in application are started. Dropwizard default extensions are also registered - so "stub" completely reproduce application state.

    As rest stub ignores web extensions (servlets, filters) then guicey disables all web extensions to avoid confusion (by logged installed extensions).

    Jersey container is started just after guicey bundle processing (and not in junit beforeAll) to support guicey jersey report, which is reported just after application initialization (before beforeAll call).

    AnnotatedTestFieldSetup used because of implemented Nested classes workflow (so nested class could see a rest client declared in root).

    Since:
    20.02.2025