assertEquals(recorder.getRecordedValue(), false);
}
@Test(timeOut = 1000 * 30)
public void threadShouldSeeLocalContextValue() throws Exception {
final LocalContext localContext = new LocalContext();
InterruptedStatusRecorder recorder = new InterruptedStatusRecorder() {
@Override
public void run() {
componentInvocationContext.setLocalContext(localContext);
while (!componentInvocationContext.isInterrupted()) {
try {
Thread.sleep(SECONDS.toMillis(1));
} catch (InterruptedException e) {
break;
}
}
value = componentInvocationContext.isInterrupted();
}
};
Thread thread = startRecorderThread(recorder);
localContext.markInterrupted();
thread.join();
assertEquals(recorder.getRecordedValue(), true);
}