7
7
import lombok .NonNull ;
8
8
import lombok .Value ;
9
9
import org .testcontainers .DockerClientFactory ;
10
- import org .testcontainers .images .ImagePullPolicy ;
11
10
import org .testcontainers .containers .output .OutputFrame ;
12
11
import org .testcontainers .containers .startupcheck .StartupCheckStrategy ;
13
12
import org .testcontainers .containers .traits .LinkableContainer ;
14
13
import org .testcontainers .containers .wait .strategy .WaitStrategy ;
14
+ import org .testcontainers .images .ImagePullPolicy ;
15
15
import org .testcontainers .utility .LogUtils ;
16
16
import org .testcontainers .utility .MountableFile ;
17
17
18
18
import java .time .Duration ;
19
19
import java .util .List ;
20
20
import java .util .Map ;
21
21
import java .util .Optional ;
22
+ import java .util .Set ;
22
23
import java .util .concurrent .Future ;
23
24
import java .util .function .Consumer ;
24
25
import java .util .function .Function ;
@@ -85,9 +86,9 @@ default void addFileSystemBind(final String hostPath, final String containerPath
85
86
* Adds a file system binding. Consider using {@link #withFileSystemBind(String, String, BindMode)}
86
87
* for building a container in a fluent style.
87
88
*
88
- * @param hostPath the file system path on the host
89
- * @param containerPath the file system path inside the container
90
- * @param mode the bind mode
89
+ * @param hostPath the file system path on the host
90
+ * @param containerPath the file system path inside the container
91
+ * @param mode the bind mode
91
92
* @param selinuxContext selinux context argument to use for this file
92
93
*/
93
94
void addFileSystemBind (String hostPath , String containerPath , BindMode mode , SelinuxContext selinuxContext );
@@ -96,7 +97,7 @@ default void addFileSystemBind(final String hostPath, final String containerPath
96
97
* Add a link to another container.
97
98
*
98
99
* @param otherContainer the other container object to link to
99
- * @param alias the alias (for the other container) that this container should be able to use
100
+ * @param alias the alias (for the other container) that this container should be able to use
100
101
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
101
102
*/
102
103
@ Deprecated
@@ -110,6 +111,8 @@ default void addFileSystemBind(final String hostPath, final String containerPath
110
111
*/
111
112
void addExposedPort (Integer port );
112
113
114
+ void addExposedPort (Integer port , InternetProtocol internetProtocol );
115
+
113
116
/**
114
117
* Add exposed ports. Consider using {@link #withExposedPorts(Integer...)}
115
118
* for building a container in a fluent style.
@@ -118,19 +121,21 @@ default void addFileSystemBind(final String hostPath, final String containerPath
118
121
*/
119
122
void addExposedPorts (int ... ports );
120
123
124
+ void addExposedPorts (Set <Integer > ports , InternetProtocol internetProtocol );
125
+
121
126
/**
122
127
* Specify the {@link WaitStrategy} to use to determine if the container is ready.
123
128
*
124
- * @see org.testcontainers.containers.wait.strategy.Wait#defaultWaitStrategy()
125
129
* @param waitStrategy the WaitStrategy to use
126
130
* @return this
131
+ * @see org.testcontainers.containers.wait.strategy.Wait#defaultWaitStrategy()
127
132
*/
128
133
SELF waitingFor (@ NonNull WaitStrategy waitStrategy );
129
134
130
135
/**
131
136
* Adds a file system binding.
132
137
*
133
- * @param hostPath the file system path on the host
138
+ * @param hostPath the file system path on the host
134
139
* @param containerPath the file system path inside the container
135
140
* @return this
136
141
*/
@@ -141,9 +146,9 @@ default SELF withFileSystemBind(String hostPath, String containerPath) {
141
146
/**
142
147
* Adds a file system binding.
143
148
*
144
- * @param hostPath the file system path on the host
149
+ * @param hostPath the file system path on the host
145
150
* @param containerPath the file system path inside the container
146
- * @param mode the bind mode
151
+ * @param mode the bind mode
147
152
* @return this
148
153
*/
149
154
SELF withFileSystemBind (String hostPath , String containerPath , BindMode mode );
@@ -152,7 +157,7 @@ default SELF withFileSystemBind(String hostPath, String containerPath) {
152
157
* Adds container volumes.
153
158
*
154
159
* @param container the container to add volumes from
155
- * @param mode the bind mode
160
+ * @param mode the bind mode
156
161
* @return this
157
162
*/
158
163
SELF withVolumesFrom (Container container , BindMode mode );
@@ -165,6 +170,8 @@ default SELF withFileSystemBind(String hostPath, String containerPath) {
165
170
*/
166
171
SELF withExposedPorts (Integer ... ports );
167
172
173
+ SELF withExposedPorts (Set <Integer > ports , InternetProtocol internetProtocol );
174
+
168
175
/**
169
176
* Set the file to be copied before starting a created container
170
177
*
@@ -186,7 +193,7 @@ default SELF withFileSystemBind(String hostPath, String containerPath) {
186
193
/**
187
194
* Add an environment variable to be passed to the container.
188
195
*
189
- * @param key environment variable key
196
+ * @param key environment variable key
190
197
* @param mapper environment variable value mapper, accepts old value as an argument
191
198
* @return this
192
199
*/
@@ -214,6 +221,7 @@ default SELF withEnv(String key, Function<Optional<String>, String> mapper) {
214
221
215
222
/**
216
223
* Add labels to the container.
224
+ *
217
225
* @param labels map of labels
218
226
* @return this
219
227
*/
@@ -237,7 +245,8 @@ default SELF withEnv(String key, Function<Optional<String>, String> mapper) {
237
245
238
246
/**
239
247
* Add an extra host entry to be passed to the container
240
- * @param hostname hostname to use for this hosts file entry
248
+ *
249
+ * @param hostname hostname to use for this hosts file entry
241
250
* @param ipAddress IP address to use for this hosts file entry
242
251
* @return this
243
252
*/
@@ -272,6 +281,7 @@ default SELF withEnv(String key, Function<Optional<String>, String> mapper) {
272
281
273
282
/**
274
283
* Set the image pull policy of the container
284
+ *
275
285
* @return
276
286
*/
277
287
SELF withImagePullPolicy (ImagePullPolicy policy );
@@ -304,15 +314,16 @@ default SELF withClasspathResourceMapping(final String resourcePath, final Strin
304
314
305
315
/**
306
316
* Set the duration of waiting time until container treated as started.
307
- * @see WaitStrategy#waitUntilReady(org.testcontainers.containers.wait.strategy.WaitStrategyTarget)
308
317
*
309
318
* @param startupTimeout timeout
310
319
* @return this
320
+ * @see WaitStrategy#waitUntilReady(org.testcontainers.containers.wait.strategy.WaitStrategyTarget)
311
321
*/
312
322
SELF withStartupTimeout (Duration startupTimeout );
313
323
314
324
/**
315
325
* Set the privilegedMode mode for the container
326
+ *
316
327
* @param mode boolean
317
328
* @return this
318
329
*/
@@ -406,7 +417,6 @@ default void followOutput(Consumer<OutputFrame> consumer, OutputFrame.OutputType
406
417
Future <String > getImage ();
407
418
408
419
/**
409
- *
410
420
* @deprecated use getEnvMap
411
421
*/
412
422
@ Deprecated
@@ -428,6 +438,8 @@ default void followOutput(Consumer<OutputFrame> consumer, OutputFrame.OutputType
428
438
429
439
void setExposedPorts (List <Integer > exposedPorts );
430
440
441
+ void setExposedPorts (Set <Port > exposedPorts );
442
+
431
443
void setPortBindings (List <String > portBindings );
432
444
433
445
void setExtraHosts (List <String > extraHosts );
0 commit comments