|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2020 the original author or authors. |
| 2 | + * Copyright 2012-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
17 | 17 | package org.springframework.boot.devtools.remote.client;
|
18 | 18 |
|
19 | 19 | import java.io.IOException;
|
| 20 | +import java.time.Duration; |
20 | 21 | import java.util.HashSet;
|
21 | 22 | import java.util.Set;
|
22 |
| -import java.util.concurrent.TimeUnit; |
23 | 23 |
|
| 24 | +import org.awaitility.Awaitility; |
24 | 25 | import org.junit.jupiter.api.AfterEach;
|
25 | 26 | import org.junit.jupiter.api.Test;
|
26 | 27 | import org.junit.jupiter.api.extension.ExtendWith;
|
|
32 | 33 | import org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher;
|
33 | 34 | import org.springframework.boot.devtools.filewatch.ChangedFiles;
|
34 | 35 | import org.springframework.boot.devtools.livereload.LiveReloadServer;
|
35 |
| -import org.springframework.boot.devtools.remote.client.RemoteClientConfiguration.LiveReloadConfiguration; |
36 | 36 | import org.springframework.boot.devtools.remote.server.Dispatcher;
|
37 | 37 | import org.springframework.boot.devtools.remote.server.DispatcherFilter;
|
38 | 38 | import org.springframework.boot.devtools.restart.MockRestarter;
|
@@ -107,11 +107,8 @@ void liveReloadOnClassPathChanged() throws Exception {
|
107 | 107 | Set<ChangedFiles> changeSet = new HashSet<>();
|
108 | 108 | ClassPathChangedEvent event = new ClassPathChangedEvent(this, changeSet, false);
|
109 | 109 | this.clientContext.publishEvent(event);
|
110 |
| - LiveReloadConfiguration configuration = this.clientContext.getBean(LiveReloadConfiguration.class); |
111 |
| - configuration.getExecutor().shutdown(); |
112 |
| - configuration.getExecutor().awaitTermination(2, TimeUnit.SECONDS); |
113 | 110 | LiveReloadServer server = this.clientContext.getBean(LiveReloadServer.class);
|
114 |
| - verify(server).triggerReload(); |
| 111 | + Awaitility.await().atMost(Duration.ofMinutes(1)).untilAsserted(() -> verify(server).triggerReload()); |
115 | 112 | }
|
116 | 113 |
|
117 | 114 | @Test
|
|
0 commit comments