Skip to content

Commit 0308d70

Browse files
author
bramvonk
committed
Update ServiceBusEmulatorContainer to not use the deprecated MSSQLServerContainer anymore.
This is a breaking change, but only in the INCUBATING Azure module. No neat way to do this without any pain. Users of this module will need to: change their imports from: import org.testcontainers.containers.MSSQLServerContainer; to: import org.testcontainers.mssqlserver.MSSQLServerContainer; and: remove the <?> from the MSSQLServerContainer variable.
1 parent 2b53c47 commit 0308d70

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

modules/azure/src/main/java/org/testcontainers/azure/ServiceBusEmulatorContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.testcontainers.azure;
22

33
import org.testcontainers.containers.GenericContainer;
4-
import org.testcontainers.containers.MSSQLServerContainer;
54
import org.testcontainers.containers.wait.strategy.Wait;
65
import org.testcontainers.images.builder.Transferable;
6+
import org.testcontainers.mssqlserver.MSSQLServerContainer;
77
import org.testcontainers.utility.DockerImageName;
88
import org.testcontainers.utility.LicenseAcceptance;
99

@@ -25,7 +25,7 @@ public class ServiceBusEmulatorContainer extends GenericContainer<ServiceBusEmul
2525
"mcr.microsoft.com/azure-messaging/servicebus-emulator"
2626
);
2727

28-
private MSSQLServerContainer<?> msSqlServerContainer;
28+
private MSSQLServerContainer msSqlServerContainer;
2929

3030
/**
3131
* @param dockerImageName The specified docker image name to run
@@ -51,7 +51,7 @@ public ServiceBusEmulatorContainer(final DockerImageName dockerImageName) {
5151
* @param msSqlServerContainer The MS SQL Server container used by Service Bus as a dependency
5252
* @return this
5353
*/
54-
public ServiceBusEmulatorContainer withMsSqlServerContainer(final MSSQLServerContainer<?> msSqlServerContainer) {
54+
public ServiceBusEmulatorContainer withMsSqlServerContainer(final MSSQLServerContainer msSqlServerContainer) {
5555
dependsOn(msSqlServerContainer);
5656
this.msSqlServerContainer = msSqlServerContainer;
5757
return this;

modules/azure/src/test/java/org/testcontainers/azure/ServiceBusEmulatorContainerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import com.github.dockerjava.api.model.Capability;
1111
import org.assertj.core.api.Assertions;
1212
import org.junit.jupiter.api.Test;
13-
import org.testcontainers.containers.MSSQLServerContainer;
1413
import org.testcontainers.containers.Network;
14+
import org.testcontainers.mssqlserver.MSSQLServerContainer;
1515
import org.testcontainers.utility.MountableFile;
1616

1717
import java.util.List;
@@ -31,7 +31,7 @@ void testWithClient() {
3131
Network network = Network.newNetwork();
3232
// }
3333
// sqlContainer {
34-
MSSQLServerContainer<?> mssqlServerContainer = new MSSQLServerContainer<>(
34+
MSSQLServerContainer mssqlServerContainer = new MSSQLServerContainer(
3535
"mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04"
3636
)
3737
.acceptLicense()

0 commit comments

Comments
 (0)