forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebTargetTest.java
More file actions
39 lines (29 loc) · 1.29 KB
/
Copy pathWebTargetTest.java
File metadata and controls
39 lines (29 loc) · 1.29 KB
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
31
32
33
34
35
36
37
38
39
package com.github.dockerjava.netty;
import static org.testng.Assert.assertEquals;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
* @author Alexander Koshevoy
*/
public class WebTargetTest {
@Mock private ChannelProvider channelProvider;
@BeforeMethod
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
}
@Test
public void verifyImmutability() throws Exception {
WebTarget emptyWebTarget = new WebTarget(channelProvider);
WebTarget initWebTarget = emptyWebTarget.path("/containers/{id}/attach").resolveTemplate("id", "d03da378b592")
.queryParam("logs", "true");
WebTarget anotherWebTarget = emptyWebTarget.path("/containers/{id}/attach")
.resolveTemplate("id", "2cfada4e3c07").queryParam("stdin", "true");
assertEquals(new WebTarget(channelProvider), emptyWebTarget);
assertEquals(new WebTarget(channelProvider).path("/containers/d03da378b592/attach")
.queryParam("logs", "true"), initWebTarget);
assertEquals(new WebTarget(channelProvider).path("/containers/2cfada4e3c07/attach")
.queryParam("stdin", "true"), anotherWebTarget);
}
}