blob: c9e714a11a3c4fc673c21e4a520bc008f708ecb7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.proxy;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* @author hmusum
*/
public class DelayedResponsesTest {
@Test
public void basic() throws InterruptedException {
ConfigTester tester = new ConfigTester();
DelayedResponses responses = new DelayedResponses();
DelayedResponse delayedResponse = new DelayedResponse(tester.createRequest("foo", "id", "bar", 10));
responses.add(delayedResponse);
assertEquals(1, responses.size());
assertEquals(delayedResponse, responses.responses().take());
assertEquals(0, responses.size());
responses.add(delayedResponse);
assertEquals(1, responses.size());
responses.remove(delayedResponse);
assertEquals(0, responses.size());
}
}
|