Search in sources :

Example 1 with LiveReloadConfiguration

use of org.springframework.boot.devtools.remote.client.RemoteClientConfiguration.LiveReloadConfiguration in project spring-boot by spring-projects.

the class RemoteClientConfigurationTests method liveReloadOnClassPathChanged.

@Test
public void liveReloadOnClassPathChanged() throws Exception {
    configure();
    Set<ChangedFiles> changeSet = new HashSet<>();
    ClassPathChangedEvent event = new ClassPathChangedEvent(this, changeSet, false);
    this.context.publishEvent(event);
    LiveReloadConfiguration configuration = this.context.getBean(LiveReloadConfiguration.class);
    configuration.getExecutor().shutdown();
    configuration.getExecutor().awaitTermination(2, TimeUnit.SECONDS);
    LiveReloadServer server = this.context.getBean(LiveReloadServer.class);
    verify(server).triggerReload();
}
Also used : LiveReloadConfiguration(org.springframework.boot.devtools.remote.client.RemoteClientConfiguration.LiveReloadConfiguration) ChangedFiles(org.springframework.boot.devtools.filewatch.ChangedFiles) OptionalLiveReloadServer(org.springframework.boot.devtools.autoconfigure.OptionalLiveReloadServer) LiveReloadServer(org.springframework.boot.devtools.livereload.LiveReloadServer) ClassPathChangedEvent(org.springframework.boot.devtools.classpath.ClassPathChangedEvent) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

HashSet (java.util.HashSet)1 Test (org.junit.Test)1 OptionalLiveReloadServer (org.springframework.boot.devtools.autoconfigure.OptionalLiveReloadServer)1 ClassPathChangedEvent (org.springframework.boot.devtools.classpath.ClassPathChangedEvent)1 ChangedFiles (org.springframework.boot.devtools.filewatch.ChangedFiles)1 LiveReloadServer (org.springframework.boot.devtools.livereload.LiveReloadServer)1 LiveReloadConfiguration (org.springframework.boot.devtools.remote.client.RemoteClientConfiguration.LiveReloadConfiguration)1