@@ -21,9 +21,6 @@ export class AzuriteContainer extends GenericContainer {
2121 . withStartupTimeout ( 120_000 ) ;
2222 }
2323
24- private blobPort : number = BLOB_PORT ;
25- private queuePort : number = QUEUE_PORT ;
26- private tablePort : number = TABLE_PORT ;
2724 private accountName : string = DEFAULT_ACCOUNT_NAME ;
2825 private accountKey : string = DEFAULT_ACCOUNT_KEY ;
2926
@@ -49,33 +46,6 @@ export class AzuriteContainer extends GenericContainer {
4946 return this ;
5047 }
5148
52- /**
53- * Sets the port to expose the Blob service on.
54- * @param port The port to expose the Blob service on. Default is 10000.
55- */
56- public withBlobPort ( port : number ) : this {
57- this . blobPort = port ;
58- return this ;
59- }
60-
61- /**
62- * Sets the port to expose the Queue service on.
63- * @param port The port to expose the Queue service on. Default is 10001.
64- */
65- public withQueuePort ( port : number ) : this {
66- this . queuePort = port ;
67- return this ;
68- }
69-
70- /**
71- * Sets the port to expose the Table service on.
72- * @param port The port to expose the Table service on. Default is 10002.
73- */
74- public withTablePort ( port : number ) : this {
75- this . tablePort = port ;
76- return this ;
77- }
78-
7949 /**
8050 * Disable persisting any data to disk and only store data in-memory. If the Azurite process is terminated, all data is lost.
8151 */
@@ -119,11 +89,7 @@ export class AzuriteContainer extends GenericContainer {
11989 command . push ( "--skipApiVersionCheck" ) ;
12090 }
12191
122- this . withCommand ( command ) . withExposedPorts (
123- { container : BLOB_PORT , host : this . blobPort } ,
124- { container : QUEUE_PORT , host : this . queuePort } ,
125- { container : TABLE_PORT , host : this . tablePort }
126- ) ;
92+ this . withCommand ( command ) . withExposedPorts ( BLOB_PORT , QUEUE_PORT , TABLE_PORT ) ;
12793
12894 if ( this . accountName !== DEFAULT_ACCOUNT_NAME || this . accountKey !== DEFAULT_ACCOUNT_KEY ) {
12995 this . withEnvironment ( {
@@ -137,9 +103,6 @@ export class AzuriteContainer extends GenericContainer {
137103 startedContainer ,
138104 this . accountName ,
139105 this . accountKey ,
140- this . blobPort ,
141- this . queuePort ,
142- this . tablePort
143106 ) ;
144107 }
145108}
@@ -149,9 +112,6 @@ export class StartedAzuriteContainer extends AbstractStartedContainer {
149112 startedTestContainer : StartedTestContainer ,
150113 private readonly accountName : string ,
151114 private readonly accountKey : string ,
152- private readonly blobPort : number ,
153- private readonly queuePort : number ,
154- private readonly tablePort : number
155115 ) {
156116 super ( startedTestContainer ) ;
157117 }
@@ -164,28 +124,28 @@ export class StartedAzuriteContainer extends AbstractStartedContainer {
164124 return this . accountKey ;
165125 }
166126
167- public getBlobPort ( ) : number {
168- return this . blobPort ;
127+ public getMappedBlobPort ( ) : number {
128+ return this . getMappedPort ( BLOB_PORT ) ;
169129 }
170130
171- public getQueuePort ( ) : number {
172- return this . queuePort ;
131+ public getMappedQueuePort ( ) : number {
132+ return this . getMappedPort ( QUEUE_PORT ) ;
173133 }
174134
175- public getTablePort ( ) : number {
176- return this . tablePort ;
135+ public getMappedTablePort ( ) : number {
136+ return this . getMappedPort ( TABLE_PORT ) ;
177137 }
178138
179139 public getBlobEndpoint ( ) : string {
180- return this . getEndpoint ( this . blobPort , this . accountName ) ;
140+ return this . getEndpoint ( this . getMappedBlobPort ( ) , this . accountName ) ;
181141 }
182142
183143 public getQueueEndpoint ( ) : string {
184- return this . getEndpoint ( this . queuePort , this . accountName ) ;
144+ return this . getEndpoint ( this . getMappedQueuePort ( ) , this . accountName ) ;
185145 }
186146
187147 public getTableEndpoint ( ) : string {
188- return this . getEndpoint ( this . tablePort , this . accountName ) ;
148+ return this . getEndpoint ( this . getMappedTablePort ( ) , this . accountName ) ;
189149 }
190150
191151 /**
0 commit comments