1313import org .apache .kafka .common .errors .TopicAuthorizationException ;
1414import org .awaitility .Awaitility ;
1515import org .junit .Test ;
16- import org .testcontainers .containers .GenericContainer ;
1716import org .testcontainers .containers .Network ;
1817import org .testcontainers .containers .SocatContainer ;
19- import org .testcontainers .images .builder .Transferable ;
2018import org .testcontainers .utility .DockerImageName ;
2119
2220import java .util .Collection ;
@@ -111,13 +109,7 @@ public void testUsageWithListener() throws Exception {
111109 RedpandaContainer redpanda = new RedpandaContainer ("docker.redpanda.com/redpandadata/redpanda:v23.1.7" )
112110 .withListener (() -> "redpanda:19092" )
113111 .withNetwork (network );
114- GenericContainer <?> kcat = new GenericContainer <>("confluentinc/cp-kcat:7.9.0" )
115- .withCreateContainerCmdModifier (cmd -> {
116- cmd .withEntrypoint ("sh" );
117- })
118- .withCopyToContainer (Transferable .of ("Message produced by kcat" ), "/data/msgs.txt" )
119- .withNetwork (network )
120- .withCommand ("-c" , "tail -f /dev/null" )
112+ KCatContainer kcat = new KCatContainer ().withNetwork (network )
121113 ) {
122114 redpanda .start ();
123115 kcat .start ();
@@ -141,13 +133,7 @@ public void testUsageWithListenerInTheSameNetwork() throws Exception {
141133 .withNetwork (network );
142134 // }
143135 // createKCatContainer {
144- GenericContainer <?> kcat = new GenericContainer <>("confluentinc/cp-kcat:7.9.0" )
145- .withCreateContainerCmdModifier (cmd -> {
146- cmd .withEntrypoint ("sh" );
147- })
148- .withCopyToContainer (Transferable .of ("Message produced by kcat" ), "/data/msgs.txt" )
149- .withNetwork (network )
150- .withCommand ("-c" , "tail -f /dev/null" )
136+ KCatContainer kcat = new KCatContainer ().withNetwork (network )
151137 // }
152138 ) {
153139 kafka .start ();
@@ -200,13 +186,7 @@ public void testUsageWithListenerAndSasl() throws Exception {
200186 .withSuperuser ("panda" )
201187 .withListener ("my-panda:29092" )
202188 .withNetwork (network );
203- GenericContainer <?> kcat = new GenericContainer <>("confluentinc/cp-kcat:7.9.0" )
204- .withCreateContainerCmdModifier (cmd -> {
205- cmd .withEntrypoint ("sh" );
206- })
207- .withCopyToContainer (Transferable .of ("Message produced by kcat" ), "/data/msgs.txt" )
208- .withNetwork (network )
209- .withCommand ("-c" , "tail -f /dev/null" )
189+ KCatContainer kcat = new KCatContainer ().withNetwork (network )
210190 ) {
211191 redpanda .start ();
212192
0 commit comments