Skip to content

Commit 66e6a2f

Browse files
Thomas SchmidtThomas Schmidtrnorth
authored
Adapt docs to non deprecated way of setting --memory and --memory-swap (#2511)
Co-authored-by: Thomas Schmidt <[email protected]> Co-authored-by: Richard North <[email protected]>
1 parent 7eb504a commit 66e6a2f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/examples/junit4/generic/src/test/java/generic/CmdModifierTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ public class CmdModifierTest {
1818
// }
1919

2020
// memory {
21+
private long memoryInBytes = 8 * 1024 * 1024;
22+
private long memorySwapInBytes = 12 * 1024 * 1024;
23+
2124
@Rule
2225
public GenericContainer memoryLimitedRedis = new GenericContainer<>("redis:3.0.2")
23-
.withCreateContainerCmdModifier(cmd -> cmd.withMemory((long) 8 * 1024 * 1024))
24-
.withCreateContainerCmdModifier(cmd -> cmd.withMemorySwap((long) 12 * 1024 * 1024));
26+
.withCreateContainerCmdModifier(cmd -> cmd.getHostConfig()
27+
.withMemory(memoryInBytes)
28+
.withMemorySwap(memorySwapInBytes)
29+
);
2530
// }
2631

2732

0 commit comments

Comments
 (0)