Skip to content

Commit

Permalink
fix javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mvysny committed Aug 8, 2024
1 parent 38ec17d commit d65e090
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,28 @@
* @author mavi
*/
public class MockSpringServlet extends SpringServlet {
/**
* The routes registered to the application.
*/
@NotNull
public final Routes routes;
/**
* The application context.
*/
@NotNull
public final ApplicationContext ctx;
/**
* Creates new UIs.
*/
@NotNull
public final Function0<UI> uiFactory;

/**
* Creates new servlet.
* @param routes The routes registered to the application.
* @param ctx The application context.
* @param uiFactory Creates new UIs.
*/
public MockSpringServlet(@NotNull Routes routes, @NotNull ApplicationContext ctx, @NotNull Function0<UI> uiFactory) {
super(ctx, false);
this.ctx = ctx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@
* A mocking service that performs three very important tasks:
* <ul>
* <li>Overrides {@link #isAtmosphereAvailable} to tell Vaadin that we don't have Atmosphere (otherwise Vaadin will crash)</li>
* <li>Provides some dummy value as a root ID via {@link #getMainDivId} (otherwise the mocked servlet env will crash).</li>
* <li>Provides a {@link MockSpringVaadinSession} instead of {@link com.vaadin.flow.spring.SpringVaadinSession}.</li>
* <li>Provides some dummy value as a root ID via {@link #getMainDivId} (otherwise the mocked servlet env will crash).</li>
* <li>Provides a {@link MockSpringVaadinSession} instead of {@link com.vaadin.flow.spring.SpringVaadinSession}.</li>
* </ul>
* The class is intentionally opened, to be extensible in user's library.
*/
public class MockSpringServletService extends SpringVaadinServletService {
/**
* Creates new UIs.
*/
@NotNull
private final Function0<UI> uiFactory;

/**
* Creates new testing service.
* @param servlet the testing servlet
* @param deploymentConfiguration the configuration to use
* @param ctx the Spring application context
* @param uiFactory Creates new UIs.
*/
public MockSpringServletService(@NotNull MockSpringServlet servlet,
@NotNull DeploymentConfiguration deploymentConfiguration,
@NotNull ApplicationContext ctx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@
* </ul>
*/
public class MockSpringVaadinSession extends SpringVaadinSession {
/**
* Creates new UIs.
*/
@NotNull
private final Function0<UI> uiFactory;

/**
* Creates a new testing VaadinSession tied to a VaadinService.
*
* @param service
* the Vaadin service for the new session
* @param uiFactory creates new UIs.
*/
public MockSpringVaadinSession(@NotNull VaadinService service, @NotNull Function0<UI> uiFactory) {
super(service);
this.uiFactory = uiFactory;
Expand Down

0 comments on commit d65e090

Please sign in to comment.