31
31
* <li>HTTPS: 7473</li>
32
32
* </ul>
33
33
*/
34
- public class Neo4jContainer < S extends Neo4jContainer < S >> extends GenericContainer <S > {
34
+ public class Neo4jContainer extends GenericContainer <Neo4jContainer > {
35
35
36
36
/**
37
37
* The image defaults to the official Neo4j image: <a href="https://hub.docker.com/_/neo4j/">Neo4j</a>.
@@ -205,7 +205,7 @@ public String getHttpsUrl() {
205
205
*
206
206
* @return This container.
207
207
*/
208
- public S withEnterpriseEdition () {
208
+ public Neo4jContainer withEnterpriseEdition () {
209
209
if (!standardImage ) {
210
210
throw new IllegalStateException (
211
211
String .format ("Cannot use enterprise version with alternative image %s." , getDockerImageName ())
@@ -227,7 +227,7 @@ public S withEnterpriseEdition() {
227
227
* @param adminPassword The admin password for the default database account.
228
228
* @return This container.
229
229
*/
230
- public S withAdminPassword (final String adminPassword ) {
230
+ public Neo4jContainer withAdminPassword (final String adminPassword ) {
231
231
if (adminPassword != null && adminPassword .length () < 8 ) {
232
232
logger ().warn ("Your provided admin password is too short and will not work with Neo4j 5.3+." );
233
233
}
@@ -240,7 +240,7 @@ public S withAdminPassword(final String adminPassword) {
240
240
*
241
241
* @return This container.
242
242
*/
243
- public S withoutAuthentication () {
243
+ public Neo4jContainer withoutAuthentication () {
244
244
return withAdminPassword (null );
245
245
}
246
246
@@ -264,7 +264,7 @@ public S withoutAuthentication() {
264
264
* @throws IllegalArgumentException If the database version is not 3.5.
265
265
* @return This container.
266
266
*/
267
- public S withDatabase (MountableFile graphDb ) {
267
+ public Neo4jContainer withDatabase (MountableFile graphDb ) {
268
268
if (!isNeo4jDatabaseVersionSupportingDbCopy ()) {
269
269
throw new IllegalArgumentException (
270
270
"Copying database folder is not supported for Neo4j instances with version 4.0 or higher."
@@ -283,7 +283,7 @@ public S withDatabase(MountableFile graphDb) {
283
283
* @param plugins
284
284
* @return This container.
285
285
*/
286
- public S withPlugins (MountableFile plugins ) {
286
+ public Neo4jContainer withPlugins (MountableFile plugins ) {
287
287
return withCopyFileToContainer (plugins , "/var/lib/neo4j/plugins/" );
288
288
}
289
289
@@ -295,7 +295,7 @@ public S withPlugins(MountableFile plugins) {
295
295
* @param value The value to set
296
296
* @return This container.
297
297
*/
298
- public S withNeo4jConfig (String key , String value ) {
298
+ public Neo4jContainer withNeo4jConfig (String key , String value ) {
299
299
addEnv (formatConfigurationKey (key ), value );
300
300
return self ();
301
301
}
@@ -307,31 +307,6 @@ public String getAdminPassword() {
307
307
return adminPassword ;
308
308
}
309
309
310
- /**
311
- * Registers one or more {@link Neo4jLabsPlugin} for download and server startup.
312
- *
313
- * @param neo4jLabsPlugins The Neo4j plugins that should get started with the server.
314
- * @return This container.
315
- * @deprecated {@link Neo4jLabsPlugin} were deprecated due to naming changes that cannot be solved by this enumeration.
316
- * Please use the {@link Neo4jContainer#withPlugins(String...)} method.
317
- */
318
- public S withLabsPlugins (Neo4jLabsPlugin ... neo4jLabsPlugins ) {
319
- List <String > pluginNames = Arrays
320
- .stream (neo4jLabsPlugins )
321
- .map (plugin -> plugin .pluginName )
322
- .collect (Collectors .toList ());
323
-
324
- this .labsPlugins .addAll (pluginNames );
325
- return self ();
326
- }
327
-
328
- /**
329
- * @deprecated Please use {@link Neo4jContainer#withPlugins(String...)} for named plugins.
330
- */
331
- public S withLabsPlugins (String ... neo4jLabsPlugins ) {
332
- return this .withPlugins (neo4jLabsPlugins );
333
- }
334
-
335
310
/**
336
311
* Registers one or more Neo4j plugins for server startup.
337
312
* The plugins are listed here
@@ -343,7 +318,7 @@ public S withLabsPlugins(String... neo4jLabsPlugins) {
343
318
* @param plugins The Neo4j plugins that should get started with the server.
344
319
* @return This container.
345
320
*/
346
- public S withPlugins (String ... plugins ) {
321
+ public Neo4jContainer withPlugins (String ... plugins ) {
347
322
this .labsPlugins .addAll (Arrays .asList (plugins ));
348
323
return self ();
349
324
}
@@ -376,7 +351,7 @@ private boolean isNeo4jDatabaseVersionSupportingDbCopy() {
376
351
return false ;
377
352
}
378
353
379
- public S withRandomPassword () {
354
+ public Neo4jContainer withRandomPassword () {
380
355
return withAdminPassword (UUID .randomUUID ().toString ());
381
356
}
382
357
}
0 commit comments