Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible using method references). See gh-9781
This commit is contained in:
committed by
Phillip Webb
parent
d16af43664
commit
2626a3a795
@@ -136,14 +136,7 @@ public class LocalDevToolsAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public FileSystemWatcherFactory fileSystemWatcherFactory() {
|
||||
return new FileSystemWatcherFactory() {
|
||||
|
||||
@Override
|
||||
public FileSystemWatcher getFileSystemWatcher() {
|
||||
return newFileSystemWatcher();
|
||||
}
|
||||
|
||||
};
|
||||
return this::newFileSystemWatcher;
|
||||
}
|
||||
|
||||
private FileSystemWatcher newFileSystemWatcher() {
|
||||
|
||||
@@ -89,14 +89,7 @@ public class LiveReloadServer {
|
||||
* @param port the listen port
|
||||
*/
|
||||
public LiveReloadServer(int port) {
|
||||
this(port, new ThreadFactory() {
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable runnable) {
|
||||
return new Thread(runnable);
|
||||
}
|
||||
|
||||
});
|
||||
this(port, Thread::new);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,14 +114,7 @@ public class LiveReloadServer {
|
||||
logger.debug("Starting live reload server on port " + this.port);
|
||||
this.serverSocket = new ServerSocket(this.port);
|
||||
int localPort = this.serverSocket.getLocalPort();
|
||||
this.listenThread = this.threadFactory.newThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
acceptConnections();
|
||||
}
|
||||
|
||||
});
|
||||
this.listenThread = this.threadFactory.newThread(this::acceptConnections);
|
||||
this.listenThread.setDaemon(true);
|
||||
this.listenThread.setName("Live Reload Server");
|
||||
this.listenThread.start();
|
||||
|
||||
@@ -194,14 +194,7 @@ public class RemoteClientConfiguration {
|
||||
|
||||
@Bean
|
||||
public FileSystemWatcherFactory getFileSystemWatcherFactory() {
|
||||
return new FileSystemWatcherFactory() {
|
||||
|
||||
@Override
|
||||
public FileSystemWatcher getFileSystemWatcher() {
|
||||
return newFileSystemWatcher();
|
||||
}
|
||||
|
||||
};
|
||||
return this::newFileSystemWatcher;
|
||||
}
|
||||
|
||||
private FileSystemWatcher newFileSystemWatcher() {
|
||||
|
||||
@@ -30,14 +30,7 @@ public interface AccessManager {
|
||||
/**
|
||||
* {@link AccessManager} that permits all requests.
|
||||
*/
|
||||
AccessManager PERMIT_ALL = new AccessManager() {
|
||||
|
||||
@Override
|
||||
public boolean isAllowed(ServerHttpRequest request) {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
AccessManager PERMIT_ALL = (request) -> true;
|
||||
|
||||
/**
|
||||
* Determine if the specific request is allowed to be handled by the
|
||||
|
||||
@@ -28,14 +28,7 @@ public interface FailureHandler {
|
||||
/**
|
||||
* {@link FailureHandler} that always aborts.
|
||||
*/
|
||||
FailureHandler NONE = new FailureHandler() {
|
||||
|
||||
@Override
|
||||
public Outcome handle(Throwable failure) {
|
||||
return Outcome.ABORT;
|
||||
}
|
||||
|
||||
};
|
||||
FailureHandler NONE = (failure) -> Outcome.ABORT;
|
||||
|
||||
/**
|
||||
* Handle a run failure. Implementations may block, for example to wait until specific
|
||||
|
||||
@@ -31,14 +31,7 @@ public interface RestartInitializer {
|
||||
/**
|
||||
* {@link RestartInitializer} that doesn't return any URLs.
|
||||
*/
|
||||
RestartInitializer NONE = new RestartInitializer() {
|
||||
|
||||
@Override
|
||||
public URL[] getInitialUrls(Thread thread) {
|
||||
return null;
|
||||
}
|
||||
|
||||
};
|
||||
RestartInitializer NONE = (thread) -> null;
|
||||
|
||||
/**
|
||||
* Return the initial set of URLs for the {@link Restarter} or {@code null} if no
|
||||
|
||||
@@ -167,15 +167,10 @@ public class Restarter {
|
||||
|
||||
private void immediateRestart() {
|
||||
try {
|
||||
getLeakSafeThread().callAndWait(new Callable<Void>() {
|
||||
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
start(FailureHandler.NONE);
|
||||
cleanupCaches();
|
||||
return null;
|
||||
}
|
||||
|
||||
getLeakSafeThread().callAndWait(() -> {
|
||||
start(FailureHandler.NONE);
|
||||
cleanupCaches();
|
||||
return null;
|
||||
});
|
||||
}
|
||||
catch (Exception ex) {
|
||||
@@ -251,15 +246,10 @@ public class Restarter {
|
||||
return;
|
||||
}
|
||||
this.logger.debug("Restarting application");
|
||||
getLeakSafeThread().call(new Callable<Void>() {
|
||||
|
||||
@Override
|
||||
public Void call() throws Exception {
|
||||
Restarter.this.stop();
|
||||
Restarter.this.start(failureHandler);
|
||||
return null;
|
||||
}
|
||||
|
||||
getLeakSafeThread().call(() -> {
|
||||
Restarter.this.stop();
|
||||
Restarter.this.start(failureHandler);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -641,15 +631,10 @@ public class Restarter {
|
||||
|
||||
@Override
|
||||
public Thread newThread(final Runnable runnable) {
|
||||
return getLeakSafeThread().callAndWait(new Callable<Thread>() {
|
||||
|
||||
@Override
|
||||
public Thread call() throws Exception {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setContextClassLoader(Restarter.this.applicationClassLoader);
|
||||
return thread;
|
||||
}
|
||||
|
||||
return getLeakSafeThread().callAndWait(() -> {
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.setContextClassLoader(Restarter.this.applicationClassLoader);
|
||||
return thread;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,7 @@ public interface ClassLoaderFileRepository {
|
||||
/**
|
||||
* Empty {@link ClassLoaderFileRepository} implementation.
|
||||
*/
|
||||
ClassLoaderFileRepository NONE = new ClassLoaderFileRepository() {
|
||||
|
||||
@Override
|
||||
public ClassLoaderFile getFile(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
};
|
||||
ClassLoaderFileRepository NONE = (name) -> null;
|
||||
|
||||
/**
|
||||
* Return a {@link ClassLoaderFile} for the given name or {@code null} if no file is
|
||||
|
||||
@@ -126,12 +126,8 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
|
||||
if (file.getKind() == Kind.DELETED) {
|
||||
return null;
|
||||
}
|
||||
return AccessController.doPrivileged(new PrivilegedAction<URL>() {
|
||||
@Override
|
||||
public URL run() {
|
||||
return createFileUrl(name, file);
|
||||
}
|
||||
});
|
||||
return AccessController
|
||||
.doPrivileged((PrivilegedAction<URL>) () -> createFileUrl(name, file));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,12 +163,9 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
|
||||
if (file.getKind() == Kind.DELETED) {
|
||||
throw new ClassNotFoundException(name);
|
||||
}
|
||||
return AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
|
||||
@Override
|
||||
public Class<?> run() {
|
||||
byte[] bytes = file.getContents();
|
||||
return defineClass(name, bytes, 0, bytes.length);
|
||||
}
|
||||
return AccessController.doPrivileged((PrivilegedAction<Class<?>>) () -> {
|
||||
byte[] bytes = file.getContents();
|
||||
return defineClass(name, bytes, 0, bytes.length);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import org.springframework.boot.devtools.filewatch.ChangedFile;
|
||||
import org.springframework.boot.devtools.filewatch.FileSystemWatcher;
|
||||
import org.springframework.boot.devtools.filewatch.FileSystemWatcherFactory;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@@ -113,14 +112,7 @@ public class ClassPathFileSystemWatcherTests {
|
||||
|
||||
@Bean
|
||||
public ClassPathRestartStrategy restartStrategy() {
|
||||
return new ClassPathRestartStrategy() {
|
||||
|
||||
@Override
|
||||
public boolean isRestartRequired(ChangedFile file) {
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
return (file) -> false;
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package org.springframework.boot.devtools.filewatch;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -221,12 +220,7 @@ public class FileSystemWatcherTests {
|
||||
File folder = this.temp.newFolder();
|
||||
final Set<ChangedFiles> listener2Changes = new LinkedHashSet<>();
|
||||
this.watcher.addSourceFolder(folder);
|
||||
this.watcher.addListener(new FileChangeListener() {
|
||||
@Override
|
||||
public void onChange(Set<ChangedFiles> changeSet) {
|
||||
listener2Changes.addAll(changeSet);
|
||||
}
|
||||
});
|
||||
this.watcher.addListener(listener2Changes::addAll);
|
||||
this.watcher.start();
|
||||
File file = touch(new File(folder, "test.txt"));
|
||||
this.watcher.stopAfter(1);
|
||||
@@ -262,14 +256,8 @@ public class FileSystemWatcherTests {
|
||||
File file = touch(new File(folder, "file.txt"));
|
||||
File trigger = touch(new File(folder, "trigger.txt"));
|
||||
this.watcher.addSourceFolder(folder);
|
||||
this.watcher.setTriggerFilter(new FileFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File file) {
|
||||
return file.getName().equals("trigger.txt");
|
||||
}
|
||||
|
||||
});
|
||||
this.watcher.setTriggerFilter(
|
||||
(candidate) -> candidate.getName().equals("trigger.txt"));
|
||||
this.watcher.start();
|
||||
FileCopyUtils.copy("abc".getBytes(), file);
|
||||
Thread.sleep(100);
|
||||
@@ -285,12 +273,8 @@ public class FileSystemWatcherTests {
|
||||
|
||||
private void setupWatcher(long pollingInterval, long quietPeriod) {
|
||||
this.watcher = new FileSystemWatcher(false, pollingInterval, quietPeriod);
|
||||
this.watcher.addListener(new FileChangeListener() {
|
||||
@Override
|
||||
public void onChange(Set<ChangedFiles> changeSet) {
|
||||
FileSystemWatcherTests.this.changes.add(changeSet);
|
||||
}
|
||||
});
|
||||
this.watcher.addListener(
|
||||
(changeSet) -> FileSystemWatcherTests.this.changes.add(changeSet));
|
||||
}
|
||||
|
||||
private File startWithNewFolder() throws IOException {
|
||||
|
||||
@@ -55,12 +55,7 @@ public class MainMethodTests {
|
||||
|
||||
@Test
|
||||
public void validMainMethod() throws Exception {
|
||||
MainMethod method = new TestThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Valid.main();
|
||||
}
|
||||
}).test();
|
||||
MainMethod method = new TestThread(Valid::main).test();
|
||||
assertThat(method.getMethod()).isEqualTo(this.actualMain);
|
||||
assertThat(method.getDeclaringClassName())
|
||||
.isEqualTo(this.actualMain.getDeclaringClass().getName());
|
||||
@@ -70,24 +65,14 @@ public class MainMethodTests {
|
||||
public void missingArgsMainMethod() throws Exception {
|
||||
this.thrown.expect(IllegalStateException.class);
|
||||
this.thrown.expectMessage("Unable to find main method");
|
||||
new TestThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MissingArgs.main();
|
||||
}
|
||||
}).test();
|
||||
new TestThread(MissingArgs::main).test();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nonStatic() throws Exception {
|
||||
this.thrown.expect(IllegalStateException.class);
|
||||
this.thrown.expectMessage("Unable to find main method");
|
||||
new TestThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new NonStaticMain().main();
|
||||
}
|
||||
}).test();
|
||||
new TestThread(() -> new NonStaticMain().main()).test();
|
||||
}
|
||||
|
||||
private static class TestThread extends Thread {
|
||||
|
||||
@@ -19,13 +19,10 @@ package org.springframework.boot.devtools.restart;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runners.model.Statement;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
|
||||
@@ -64,30 +61,17 @@ public class MockRestarter implements TestRule {
|
||||
Restarter.setInstance(this.mock);
|
||||
given(this.mock.getInitialUrls()).willReturn(new URL[] {});
|
||||
given(this.mock.getOrAddAttribute(anyString(), (ObjectFactory) any()))
|
||||
.willAnswer(new Answer<Object>() {
|
||||
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
String name = (String) invocation.getArguments()[0];
|
||||
ObjectFactory factory = (ObjectFactory) invocation
|
||||
.getArguments()[1];
|
||||
Object attribute = MockRestarter.this.attributes.get(name);
|
||||
if (attribute == null) {
|
||||
attribute = factory.getObject();
|
||||
MockRestarter.this.attributes.put(name, attribute);
|
||||
}
|
||||
return attribute;
|
||||
.willAnswer((invocation) -> {
|
||||
String name = (String) invocation.getArguments()[0];
|
||||
ObjectFactory factory = (ObjectFactory) invocation.getArguments()[1];
|
||||
Object attribute = MockRestarter.this.attributes.get(name);
|
||||
if (attribute == null) {
|
||||
attribute = factory.getObject();
|
||||
MockRestarter.this.attributes.put(name, attribute);
|
||||
}
|
||||
|
||||
return attribute;
|
||||
});
|
||||
given(this.mock.getThreadFactory()).willReturn(new ThreadFactory() {
|
||||
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
return new Thread(r);
|
||||
}
|
||||
|
||||
});
|
||||
given(this.mock.getThreadFactory()).willReturn(Thread::new);
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
|
||||
@@ -67,14 +67,7 @@ public class OnInitializedRestarterConditionTests {
|
||||
|
||||
@Test
|
||||
public void initialized() throws Exception {
|
||||
Thread thread = new Thread() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
TestInitialized.main();
|
||||
};
|
||||
|
||||
};
|
||||
Thread thread = new Thread(TestInitialized::main);
|
||||
thread.start();
|
||||
synchronized (wait) {
|
||||
wait.wait();
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile.Kind;
|
||||
@@ -84,14 +83,7 @@ public class RestarterTests {
|
||||
@Test
|
||||
public void testRestart() throws Exception {
|
||||
Restarter.clearInstance();
|
||||
Thread thread = new Thread() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
SampleApplication.main();
|
||||
};
|
||||
|
||||
};
|
||||
Thread thread = new Thread(SampleApplication::main);
|
||||
thread.start();
|
||||
Thread.sleep(2600);
|
||||
String output = this.out.toString();
|
||||
@@ -150,12 +142,7 @@ public class RestarterTests {
|
||||
@Test
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void getOrAddAttributeWithExistingAttribute() throws Exception {
|
||||
Restarter.getInstance().getOrAddAttribute("x", new ObjectFactory<String>() {
|
||||
@Override
|
||||
public String getObject() throws BeansException {
|
||||
return "abc";
|
||||
}
|
||||
});
|
||||
Restarter.getInstance().getOrAddAttribute("x", () -> "abc");
|
||||
ObjectFactory objectFactory = mock(ObjectFactory.class);
|
||||
Object attribute = Restarter.getInstance().getOrAddAttribute("x", objectFactory);
|
||||
assertThat(attribute).isEqualTo("abc");
|
||||
@@ -166,19 +153,16 @@ public class RestarterTests {
|
||||
public void getThreadFactory() throws Exception {
|
||||
final ClassLoader parentLoader = Thread.currentThread().getContextClassLoader();
|
||||
final ClassLoader contextClassLoader = new URLClassLoader(new URL[0]);
|
||||
Thread thread = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
Runnable runnable = mock(Runnable.class);
|
||||
Thread regular = new Thread();
|
||||
ThreadFactory factory = Restarter.getInstance().getThreadFactory();
|
||||
Thread viaFactory = factory.newThread(runnable);
|
||||
// Regular threads will inherit the current thread
|
||||
assertThat(regular.getContextClassLoader()).isEqualTo(contextClassLoader);
|
||||
// Factory threads should inherit from the initial thread
|
||||
assertThat(viaFactory.getContextClassLoader()).isEqualTo(parentLoader);
|
||||
};
|
||||
};
|
||||
Thread thread = new Thread(() -> {
|
||||
Runnable runnable = mock(Runnable.class);
|
||||
Thread regular = new Thread();
|
||||
ThreadFactory factory = Restarter.getInstance().getThreadFactory();
|
||||
Thread viaFactory = factory.newThread(runnable);
|
||||
// Regular threads will inherit the current thread
|
||||
assertThat(regular.getContextClassLoader()).isEqualTo(contextClassLoader);
|
||||
// Factory threads should inherit from the initial thread
|
||||
assertThat(viaFactory.getContextClassLoader()).isEqualTo(parentLoader);
|
||||
});
|
||||
thread.setContextClassLoader(contextClassLoader);
|
||||
thread.start();
|
||||
thread.join();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -81,12 +81,8 @@ public class SilentExitExceptionHandlerTests {
|
||||
private Throwable thrown;
|
||||
|
||||
TestThread() {
|
||||
setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
|
||||
@Override
|
||||
public void uncaughtException(Thread t, Throwable e) {
|
||||
TestThread.this.thrown = e;
|
||||
}
|
||||
});
|
||||
setUncaughtExceptionHandler(
|
||||
(thread, exception) -> TestThread.this.thrown = exception);
|
||||
}
|
||||
|
||||
public Throwable getThrown() {
|
||||
@@ -119,21 +115,16 @@ public class SilentExitExceptionHandlerTests {
|
||||
@Override
|
||||
protected Thread[] getAllThreads() {
|
||||
final CountDownLatch threadRunning = new CountDownLatch(1);
|
||||
Thread daemonThread = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (TestSilentExitExceptionHandler.this.monitor) {
|
||||
threadRunning.countDown();
|
||||
try {
|
||||
TestSilentExitExceptionHandler.this.monitor.wait();
|
||||
}
|
||||
catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
Thread daemonThread = new Thread(() -> {
|
||||
synchronized (TestSilentExitExceptionHandler.this.monitor) {
|
||||
threadRunning.countDown();
|
||||
try {
|
||||
TestSilentExitExceptionHandler.this.monitor.wait();
|
||||
}
|
||||
catch (InterruptedException ex) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
daemonThread.setDaemon(true);
|
||||
daemonThread.start();
|
||||
|
||||
@@ -33,8 +33,6 @@ import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload;
|
||||
import org.springframework.boot.devtools.tunnel.server.HttpTunnelServer.HttpConnection;
|
||||
@@ -90,13 +88,10 @@ public class HttpTunnelServerTests {
|
||||
public void setup() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
this.server = new HttpTunnelServer(this.serverConnection);
|
||||
given(this.serverConnection.open(anyInt())).willAnswer(new Answer<ByteChannel>() {
|
||||
@Override
|
||||
public ByteChannel answer(InvocationOnMock invocation) throws Throwable {
|
||||
MockServerChannel channel = HttpTunnelServerTests.this.serverChannel;
|
||||
channel.setTimeout((Integer) invocation.getArguments()[0]);
|
||||
return channel;
|
||||
}
|
||||
given(this.serverConnection.open(anyInt())).willAnswer((invocation) -> {
|
||||
MockServerChannel channel = HttpTunnelServerTests.this.serverChannel;
|
||||
channel.setTimeout((Integer) invocation.getArguments()[0]);
|
||||
return channel;
|
||||
});
|
||||
this.servletRequest = new MockHttpServletRequest();
|
||||
this.servletRequest.setAsyncSupported(true);
|
||||
@@ -311,15 +306,10 @@ public class HttpTunnelServerTests {
|
||||
.willThrow(new IllegalArgumentException());
|
||||
final HttpConnection connection = new HttpConnection(request, this.response);
|
||||
final AtomicBoolean responded = new AtomicBoolean();
|
||||
Thread connectionThread = new Thread() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
connection.waitForResponse();
|
||||
responded.set(true);
|
||||
}
|
||||
|
||||
};
|
||||
Thread connectionThread = new Thread(() -> {
|
||||
connection.waitForResponse();
|
||||
responded.set(true);
|
||||
});
|
||||
connectionThread.start();
|
||||
assertThat(responded.get()).isFalse();
|
||||
Thread.sleep(sleepBeforeResponse);
|
||||
|
||||
Reference in New Issue
Block a user