Skip to content

Commit 74eecd4

Browse files
authored
Mark link-related APIs as deprecated pending future removal (#487)
* Mark link-related APIs as deprecated pending future removal See #465 * Update changelog re deprecated links features
1 parent b4d3c99 commit 74eecd4

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88
### Changed
99
- Make Network instances reusable (i.e. work with `@ClassRule`) ([\#469](https://github.com/testcontainers/testcontainers-java/issues/469))
1010
- Added support for explicitly setting file mode when copying file into container ([\#446](https://github.com/testcontainers/testcontainers-java/issues/446), [\#467](https://github.com/testcontainers/testcontainers-java/issues/467))
11+
- Mark all links functionality as deprecated. This is pending removal in a later release. Please see [\#465](https://github.com/testcontainers/testcontainers-java/issues/465). {@link Network} features should be used instead.
1112

1213
## [1.4.3] - 2017-10-14
1314
### Fixed

core/src/main/java/org/testcontainers/containers/Container.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ default void addFileSystemBind(final String hostPath, final String containerPath
104104
*
105105
* @param otherContainer the other container object to link to
106106
* @param alias the alias (for the other container) that this container should be able to use
107+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
107108
*/
109+
@Deprecated
108110
void addLink(LinkableContainer otherContainer, String alias);
109111

110112
/**
@@ -420,6 +422,10 @@ ExecResult execInContainer(Charset outputCharset, String... command)
420422

421423
List<Bind> getBinds();
422424

425+
/**
426+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
427+
*/
428+
@Deprecated
423429
Map<String, LinkableContainer> getLinkedContainers();
424430

425431
DockerClient getDockerClient();
@@ -446,6 +452,10 @@ ExecResult execInContainer(Charset outputCharset, String... command)
446452

447453
void setBinds(List<Bind> binds);
448454

455+
/**
456+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
457+
*/
458+
@Deprecated
449459
void setLinkedContainers(Map<String, LinkableContainer> linkedContainers);
450460

451461
void setWaitStrategy(WaitStrategy waitStrategy);

core/src/main/java/org/testcontainers/containers/GenericContainer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ public class GenericContainer<SELF extends GenericContainer<SELF>>
9999
@NonNull
100100
private List<VolumesFrom> volumesFroms = new ArrayList<>();
101101

102+
/**
103+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
104+
*/
102105
@NonNull
106+
@Deprecated
103107
private Map<String, LinkableContainer> linkedContainers = new HashMap<>();
104108

105109
private StartupCheckStrategy startupCheckStrategy = new IsRunningStartupCheckStrategy();
@@ -522,6 +526,10 @@ private void addVolumesFrom(Container container, BindMode mode) {
522526
volumesFroms.add(new VolumesFrom(container.getContainerName(), mode.accessMode));
523527
}
524528

529+
/**
530+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
531+
*/
532+
@Deprecated
525533
@Override
526534
public void addLink(LinkableContainer otherContainer, String alias) {
527535
this.linkedContainers.put(alias, otherContainer);

core/src/main/java/org/testcontainers/containers/traits/LinkableContainer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
/**
44
* A container which can be linked to by other containers.
5+
*
6+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link org.testcontainers.containers.Network} features instead.
57
*/
8+
@Deprecated
69
public interface LinkableContainer {
710

811
String getContainerName();

modules/selenium/src/main/java/org/testcontainers/containers/BrowserWebDriverContainer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ private void stopAndRetainRecording(Description description) {
229229
* @param otherContainer the container rule to link to
230230
* @param alias the alias (hostname) that this other container should be referred to by
231231
* @return this
232+
*
233+
* @deprecated Links are deprecated (see <a href="https://github.com/testcontainers/testcontainers-java/issues/465">#465</a>). Please use {@link Network} features instead.
232234
*/
235+
@Deprecated
233236
public SELF withLinkToContainer(LinkableContainer otherContainer, String alias) {
234237
addLink(otherContainer, alias);
235238
return self();

0 commit comments

Comments
 (0)