@@ -14,12 +14,8 @@ import (
1414)
1515
1616const (
17-
18- // NATS configuration.
19-
2017 NatsImage = "nats:latest"
2118
22- NatsPort = "4222"
2319 NatsUser = "frame"
2420 NatsPass = "fr@m3"
2521 NatsCluster = "frame_test"
@@ -44,7 +40,7 @@ func NewWithOpts(cluster string, containerOpts ...definition.ContainerOption) de
4440 ImageName : NatsImage ,
4541 UserName : NatsUser ,
4642 Password : NatsPass ,
47- Ports : []string {NatsPort },
43+ Ports : []string {"4222/tcp" , "6222/tcp" , "8222/tcp" },
4844 NetworkAliases : []string {"nats" , "queue-nats" },
4945 }
5046 opts .Setup (containerOpts ... )
@@ -70,21 +66,21 @@ func (d *natsDependancy) Setup(ctx context.Context, ntwk *testcontainers.DockerN
7066 tcNats .WithPassword (d .opts .Password ),
7167 }... )
7268
73- natsqContainer , err := tcNats .Run (ctx , d .opts .ImageName , containerCustomize ... )
69+ natsContainer , err := tcNats .Run (ctx , d .opts .ImageName , containerCustomize ... )
7470 if err != nil {
7571 return fmt .Errorf ("failed to start nats container: %w" , err )
7672 }
7773
78- d .container = natsqContainer
74+ d .container = natsContainer
7975
80- conn , err := natsqContainer .ConnectionString (ctx )
76+ conn , err := natsContainer .ConnectionString (ctx )
8177 if err != nil {
8278 return fmt .Errorf ("failed to get connection string for container: %w" , err )
8379 }
8480
8581 d .conn = frame .DataSource (conn )
8682
87- internalIP , err := natsqContainer .ContainerIP (ctx )
83+ internalIP , err := natsContainer .ContainerIP (ctx )
8884 if err != nil {
8985 return fmt .Errorf ("failed to get internal host ip for container: %w" , err )
9086 }
0 commit comments