@DataProvider(value = { "true", "false" }) @Test public void serverShutdownHooks_works_as_expected(boolean eurekaShutdownHookIsNull) { ServerShutdownHook eurekaShutdownHook = (eurekaShutdownHookIsNull) ? null : mock(ServerShutdownHook.class); Whitebox.setInternalState( appServerConfig.guiceValues.eurekaServerHooks, "eurekaShutdownHook", eurekaShutdownHook ); List<ServerShutdownHook> result = appServerConfig.serverShutdownHooks(); if (eurekaShutdownHookIsNull) { assertThat(result).isNull(); } else { assertThat(result) .isNotNull() .containsExactly(eurekaShutdownHook); } }
@Override public @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks() { ServerShutdownHook eurekaShutdownHook = guiceValues.eurekaServerHooks.eurekaShutdownHook; return (eurekaShutdownHook == null) ? null : Collections.singletonList(eurekaShutdownHook); }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks() { ServerShutdownHook eurekaShutdownHook = guiceValues.eurekaServerHooks.eurekaShutdownHook; return (eurekaShutdownHook == null) ? null : Collections.singletonList(eurekaShutdownHook); } }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks() { ServerShutdownHook eurekaShutdownHook = guiceValues.eurekaServerHooks.eurekaShutdownHook; return (eurekaShutdownHook == null) ? null : Collections.singletonList(eurekaShutdownHook); } protected  AppServerConfig(Config appConfig, PropertiesRegistrationGuiceModule propertiesRegistrationGuiceModule);  AppServerConfig(Config appConfig); }
AppServerConfig implements ServerConfig { @Override public @Nullable List<@NotNull ServerShutdownHook> serverShutdownHooks() { ServerShutdownHook eurekaShutdownHook = guiceValues.eurekaServerHooks.eurekaShutdownHook; return (eurekaShutdownHook == null) ? null : Collections.singletonList(eurekaShutdownHook); } 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 ServerShutdownHook> serverShutdownHooks() { ServerShutdownHook eurekaShutdownHook = guiceValues.eurekaServerHooks.eurekaShutdownHook; return (eurekaShutdownHook == null) ? null : Collections.singletonList(eurekaShutdownHook); } 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();  }