@@ -6,7 +6,7 @@ namespace Testcontainers.Xunit;
66/// <typeparam name="TBuilderEntity">The builder entity.</typeparam>
77/// <typeparam name="TContainerEntity">The container entity.</typeparam>
88public abstract class ContainerLifetime < TBuilderEntity , TContainerEntity > : IAsyncLifetime
9- where TBuilderEntity : IContainerBuilder < TBuilderEntity , TContainerEntity , IContainerConfiguration > , new ( )
9+ where TBuilderEntity : IContainerBuilder < TBuilderEntity , TContainerEntity , IContainerConfiguration >
1010 where TContainerEntity : IContainer
1111{
1212 private readonly Lazy < TContainerEntity > _container ;
@@ -16,7 +16,7 @@ public abstract class ContainerLifetime<TBuilderEntity, TContainerEntity> : IAsy
1616
1717 protected ContainerLifetime ( ILogger logger )
1818 {
19- _container = new Lazy < TContainerEntity > ( ( ) => Configure ( Configure ( ) ) . WithLogger ( logger ) . Build ( ) ) ;
19+ _container = new Lazy < TContainerEntity > ( ( ) => Configure ( ) . WithLogger ( logger ) . Build ( ) ) ;
2020 }
2121
2222 /// <summary>
@@ -65,31 +65,7 @@ await DisposeAsyncCore()
6565 /// </code>
6666 /// </example>
6767 /// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
68- protected virtual TBuilderEntity Configure ( ) => new ( ) ;
69-
70- /// <summary>
71- /// Extension method to further configure the container instance.
72- /// </summary>
73- /// <example>
74- /// <code>
75- /// public class MariaDbRootUserFixture(IMessageSink messageSink) : DbContainerFixture<MariaDbBuilder, MariaDbContainer>(messageSink)
76- /// {
77- /// public override DbProviderFactory DbProviderFactory => MySqlConnectorFactory.Instance;
78- /// <br />
79- /// protected override MariaDbBuilder Configure(MariaDbBuilder builder)
80- /// {
81- /// return builder.WithUsername("root");
82- /// }
83- /// }
84- /// </code>
85- /// </example>
86- /// <param name="builder">The container builder to configure.</param>
87- /// <returns>A configured instance of <typeparamref name="TBuilderEntity" />.</returns>
88- [ Obsolete ( "This method is obsolete and will be removed. Use the parameterless Configure() method and create the builder explicitly instead." ) ]
89- protected virtual TBuilderEntity Configure ( TBuilderEntity builder )
90- {
91- return builder ;
92- }
68+ protected abstract TBuilderEntity Configure ( ) ;
9369
9470 /// <inheritdoc cref="IAsyncLifetime.InitializeAsync" />
9571 protected virtual async LifetimeTask InitializeAsync ( )
0 commit comments