11package cloud .localstack .docker ;
22
3+ import cloud .localstack .Localstack ;
4+ import cloud .localstack .docker .annotation .LocalstackDockerProperties ;
35import org .junit .Test ;
6+ import org .junit .jupiter .api .extension .ExtendWith ;
47
58import java .util .ArrayList ;
9+ import java .util .Arrays ;
610import java .util .HashMap ;
711
812import static org .junit .Assert .assertEquals ;
@@ -22,7 +26,7 @@ public void createLocalstackContainer() throws Exception {
2226 HashMap <String , String > environmentVariables = new HashMap <>();
2327 environmentVariables .put (MY_PROPERTY , MY_VALUE );
2428 Container localStackContainer = Container .createLocalstackContainer (
25- EXTERNAL_HOST_NAME , pullNewImage , false , null , null , null , environmentVariables , null );
29+ EXTERNAL_HOST_NAME , pullNewImage , false , null , null , null , null , environmentVariables , null );
2630
2731 try {
2832 localStackContainer .waitForAllPorts (EXTERNAL_HOST_NAME );
@@ -44,10 +48,43 @@ public void createLocalstackContainer() throws Exception {
4448 }
4549 }
4650
51+ @ Test
52+ public void createLocalstackContainerWithFullImage () {
53+
54+ String customImageName = "localstack/localstack-full" ;
55+ Container localStackContainer = Container .createLocalstackContainer (
56+ EXTERNAL_HOST_NAME , pullNewImage , false , customImageName , null , null , null , null , null );
57+
58+ try {
59+ localStackContainer .waitForAllPorts (EXTERNAL_HOST_NAME );
60+
61+ String imageName = new DockerExe ()
62+ .execute (Arrays .asList ("container" , "inspect" ,
63+ localStackContainer .getContainerId (), "--format" , "{{.Config.Image}}" ));
64+ assertEquals (customImageName , imageName );
65+ }
66+ finally {
67+ localStackContainer .stop ();
68+ }
69+ }
70+
71+ @ ExtendWith (LocalstackDockerExtension .class )
72+ @ LocalstackDockerProperties (imageName = "localstack/localstack-full" )
73+ public static class ContainerTest1 {
74+ @ org .junit .jupiter .api .Test
75+ public void imageName () {
76+ String imageName = new DockerExe ()
77+ .execute (Arrays .asList ("container" , "inspect" ,
78+ Localstack .INSTANCE .getLocalStackContainer ().getContainerId (),
79+ "--format" , "{{.Config.Image}}" ));
80+ assertEquals ("localstack/localstack-full" , imageName );
81+ }
82+ }
83+
4784 @ Test
4885 public void createLocalstackContainerWithCustomPorts () throws Exception {
4986 Container localStackContainer = Container .createLocalstackContainer (
50- EXTERNAL_HOST_NAME , pullNewImage , false , null , "45660" , "45710" , null , null );
87+ EXTERNAL_HOST_NAME , pullNewImage , false , null , null , "45660" , "45710" , null , null );
5188
5289 try {
5390 localStackContainer .waitForAllPorts (EXTERNAL_HOST_NAME );
@@ -63,7 +100,7 @@ public void createLocalstackContainerWithCustomPorts() throws Exception {
63100 @ Test
64101 public void createLocalstackContainerWithRandomPorts () throws Exception {
65102 Container localStackContainer = Container .createLocalstackContainer (
66- EXTERNAL_HOST_NAME , pullNewImage , false , null , ":4566" , ":4571" , null , null );
103+ EXTERNAL_HOST_NAME , pullNewImage , false , null , null , ":4566" , ":4571" , null , null );
67104
68105 try {
69106 localStackContainer .waitForAllPorts (EXTERNAL_HOST_NAME );
0 commit comments