3434 * @deprecated use {@link org.testcontainers.neo4j.Neo4jContainer} instead.
3535 */
3636@ Deprecated
37- public class Neo4jContainer extends GenericContainer <Neo4jContainer > {
37+ public class Neo4jContainer < S extends Neo4jContainer < S >> extends GenericContainer <S > {
3838
3939 /**
4040 * The image defaults to the official Neo4j image: <a href="https://hub.docker.com/_/neo4j/">Neo4j</a>.
@@ -217,7 +217,7 @@ public String getHttpsUrl() {
217217 *
218218 * @return This container.
219219 */
220- public Neo4jContainer withEnterpriseEdition () {
220+ public S withEnterpriseEdition () {
221221 if (!standardImage ) {
222222 throw new IllegalStateException (
223223 String .format ("Cannot use enterprise version with alternative image %s." , getDockerImageName ())
@@ -239,7 +239,7 @@ public Neo4jContainer withEnterpriseEdition() {
239239 * @param adminPassword The admin password for the default database account.
240240 * @return This container.
241241 */
242- public Neo4jContainer withAdminPassword (final String adminPassword ) {
242+ public S withAdminPassword (final String adminPassword ) {
243243 if (adminPassword != null && adminPassword .length () < 8 ) {
244244 logger ().warn ("Your provided admin password is too short and will not work with Neo4j 5.3+." );
245245 }
@@ -252,7 +252,7 @@ public Neo4jContainer withAdminPassword(final String adminPassword) {
252252 *
253253 * @return This container.
254254 */
255- public Neo4jContainer withoutAuthentication () {
255+ public S withoutAuthentication () {
256256 return withAdminPassword (null );
257257 }
258258
@@ -276,7 +276,7 @@ public Neo4jContainer withoutAuthentication() {
276276 * @throws IllegalArgumentException If the database version is not 3.5.
277277 * @return This container.
278278 */
279- public Neo4jContainer withDatabase (MountableFile graphDb ) {
279+ public S withDatabase (MountableFile graphDb ) {
280280 if (!isNeo4jDatabaseVersionSupportingDbCopy ()) {
281281 throw new IllegalArgumentException (
282282 "Copying database folder is not supported for Neo4j instances with version 4.0 or higher."
@@ -295,7 +295,7 @@ public Neo4jContainer withDatabase(MountableFile graphDb) {
295295 * @param plugins
296296 * @return This container.
297297 */
298- public Neo4jContainer withPlugins (MountableFile plugins ) {
298+ public S withPlugins (MountableFile plugins ) {
299299 return withCopyFileToContainer (plugins , "/var/lib/neo4j/plugins/" );
300300 }
301301
@@ -307,7 +307,7 @@ public Neo4jContainer withPlugins(MountableFile plugins) {
307307 * @param value The value to set
308308 * @return This container.
309309 */
310- public Neo4jContainer withNeo4jConfig (String key , String value ) {
310+ public S withNeo4jConfig (String key , String value ) {
311311 addEnv (formatConfigurationKey (key ), value );
312312 return self ();
313313 }
@@ -330,7 +330,7 @@ public String getAdminPassword() {
330330 * @param plugins The Neo4j plugins that should get started with the server.
331331 * @return This container.
332332 */
333- public Neo4jContainer withPlugins (String ... plugins ) {
333+ public S withPlugins (String ... plugins ) {
334334 this .labsPlugins .addAll (Arrays .asList (plugins ));
335335 return self ();
336336 }
@@ -363,7 +363,7 @@ private boolean isNeo4jDatabaseVersionSupportingDbCopy() {
363363 return false ;
364364 }
365365
366- public Neo4jContainer withRandomPassword () {
366+ public S withRandomPassword () {
367367 return withAdminPassword (UUID .randomUUID ().toString ());
368368 }
369369}
0 commit comments