Search in sources :

Example 6 with LiveReloadServer

use of org.springframework.boot.devtools.livereload.LiveReloadServer in project spring-boot by spring-projects.

the class OptionalLiveReloadServerTests method serverWontStart.

@Test
public void serverWontStart() throws Exception {
    LiveReloadServer delegate = mock(LiveReloadServer.class);
    OptionalLiveReloadServer server = new OptionalLiveReloadServer(delegate);
    willThrow(new RuntimeException("Error")).given(delegate).start();
    server.startServer();
    server.triggerReload();
    verify(delegate, never()).triggerReload();
}
Also used : LiveReloadServer(org.springframework.boot.devtools.livereload.LiveReloadServer) Test(org.junit.Test)

Aggregations

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