@DataProvider(value = { "true", "false" }) @Test public void postServerStartupHooks_works_as_expected(boolean eurekaStartupHookIsNull) { PostServerStartupHook eurekaStartupHook = (eurekaStartupHookIsNull) ? null : mock(PostServerStartupHook.class); Whitebox.setInternalState( appServerConfig.guiceValues.eurekaServerHooks, "eurekaStartupHook", eurekaStartupHook ); List<PostServerStartupHook> result = appServerConfig.postServerStartupHooks(); if (eurekaStartupHookIsNull) { assertThat(result).isNull(); } else { assertThat(result) .isNotNull() .containsExactly(eurekaStartupHook); } }
@Override public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() { PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook; return (eurekaStartupHook == null) ? null : Collections.singletonList(eurekaStartupHook); }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() { PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook; return (eurekaStartupHook == null) ? null : Collections.singletonList(eurekaStartupHook); } }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() { PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook; return (eurekaStartupHook == null) ? null : Collections.singletonList(eurekaStartupHook); } protected  AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule);  AppServerConfig(Config appConfig); }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() { PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook; return (eurekaStartupHook == null) ? null : Collections.singletonList(eurekaStartupHook); } protected  AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule);  AppServerConfig(Config appConfig); @Override @Nullable AccessLogger accessLogger(); @Override @Nullable CompletableFuture<@Nullable AppInfo> appInfo(); @Override @Nullable MetricsListener metricsListener(); @Override @Nullable RequestSecurityValidator requestSecurityValidator(); @Override @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks(); @Override @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks(); @Override @NotNull Collection<@NotNull Endpoint<?>> appEndpoints(); @Override @NotNull RiposteErrorHandler riposteErrorHandler(); @Override @NotNull RiposteUnhandledErrorHandler riposteUnhandledErrorHandler(); @Override @Nullable RequestValidator requestContentValidationService(); @Override boolean isDebugActionsEnabled(); @Override boolean isDebugChannelLifecycleLoggingEnabled(); @Override int endpointsPort(); @Override int endpointsSslPort(); @Override boolean isEndpointsUseSsl(); @Override int numBossThreads(); @Override int numWorkerThreads(); @Override int maxRequestSizeInBytes(); }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks() { PostServerStartupHook eurekaStartupHook = guiceValues.eurekaServerHooks.eurekaStartupHook; return (eurekaStartupHook == null) ? null : Collections.singletonList(eurekaStartupHook); } protected  AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule);  AppServerConfig(Config appConfig); @Override @Nullable AccessLogger accessLogger(); @Override @Nullable CompletableFuture<@Nullable AppInfo> appInfo(); @Override @Nullable MetricsListener metricsListener(); @Override @Nullable RequestSecurityValidator requestSecurityValidator(); @Override @Nullable List<@NotNull PostServerStartupHook> postServerStartupHooks(); @Override @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks(); @Override @NotNull Collection<@NotNull Endpoint<?>> appEndpoints(); @Override @NotNull RiposteErrorHandler riposteErrorHandler(); @Override @NotNull RiposteUnhandledErrorHandler riposteUnhandledErrorHandler(); @Override @Nullable RequestValidator requestContentValidationService(); @Override boolean isDebugActionsEnabled(); @Override boolean isDebugChannelLifecycleLoggingEnabled(); @Override int endpointsPort(); @Override int endpointsSslPort(); @Override boolean isEndpointsUseSsl(); @Override int numBossThreads(); @Override int numWorkerThreads(); @Override int maxRequestSizeInBytes();  }