77import org .testcontainers .containers .wait .strategy .WaitStrategy ;
88import org .testcontainers .utility .ComparableVersion ;
99import org .testcontainers .utility .DockerImageName ;
10- import org .testcontainers .utility .LicenseAcceptance ;
1110import org .testcontainers .utility .MountableFile ;
1211
1312import java .net .HttpURLConnection ;
@@ -39,13 +38,6 @@ public class Neo4jContainer extends GenericContainer<Neo4jContainer> {
3938 */
4039 private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName .parse ("neo4j" );
4140
42- /**
43- * The default tag (version) to use.
44- */
45- private static final String DEFAULT_TAG = "4.4" ;
46-
47- private static final String ENTERPRISE_TAG = DEFAULT_TAG + "-enterprise" ;
48-
4941 /**
5042 * Default port for the binary Bolt protocol.
5143 */
@@ -68,8 +60,6 @@ public class Neo4jContainer extends GenericContainer<Neo4jContainer> {
6860
6961 private static final String AUTH_FORMAT = "neo4j/%s" ;
7062
71- private final boolean standardImage ;
72-
7363 private String adminPassword = DEFAULT_ADMIN_PASSWORD ;
7464
7565 private final Set <String > labsPlugins = new HashSet <>();
@@ -100,8 +90,6 @@ public Neo4jContainer(String dockerImageName) {
10090 */
10191 public Neo4jContainer (final DockerImageName dockerImageName ) {
10292 super (dockerImageName );
103- this .standardImage = dockerImageName .getUnversionedPart ().equals (DEFAULT_IMAGE_NAME .getUnversionedPart ());
104-
10593 dockerImageName .assertCompatibleWith (DEFAULT_IMAGE_NAME );
10694
10795 waitingFor (
@@ -197,26 +185,12 @@ public String getHttpsUrl() {
197185 }
198186
199187 /**
200- * Configures the container to use the enterprise edition of the default docker image.
201- * <br><br>
202- * Please have a look at the <a href="https://neo4j.com/licensing/">Neo4j Licensing page</a>. While the Neo4j
203- * Community Edition can be used for free in your projects under the GPL v3 license, Neo4j Enterprise edition
204- * needs either a commercial, education or evaluation license.
188+ * Accepts the license agreement of the container.
205189 *
206- * @return This container.
190+ * @return this
207191 */
208- public Neo4jContainer withEnterpriseEdition () {
209- if (!standardImage ) {
210- throw new IllegalStateException (
211- String .format ("Cannot use enterprise version with alternative image %s." , getDockerImageName ())
212- );
213- }
214-
215- setDockerImageName (DEFAULT_IMAGE_NAME .withTag (ENTERPRISE_TAG ).asCanonicalNameString ());
216- LicenseAcceptance .assertLicenseAccepted (getDockerImageName ());
217-
192+ public Neo4jContainer acceptLicense () {
218193 addEnv ("NEO4J_ACCEPT_LICENSE_AGREEMENT" , "yes" );
219-
220194 return self ();
221195 }
222196
0 commit comments