3434import org .apache .hadoop .fs .azurebfs .utils .AccountSASGenerator ;
3535import org .apache .hadoop .fs .azurebfs .utils .Base64 ;
3636
37- import static org .apache .hadoop .fs .azurebfs .constants .AbfsHttpConstants .ROOT_PATH ;
3837import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_SAS_FIXED_TOKEN ;
3938import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_SAS_TOKEN_PROVIDER_TYPE ;
4039import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .accountProperty ;
4746public class ITestAzureBlobFileSystemChooseSAS extends AbstractAbfsIntegrationTest {
4847
4948 private String accountSAS = null ;
49+ private final String TEST_PATH = "testPath" ;
5050
5151 /**
5252 * To differentiate which SASTokenProvider was used we will use different type of SAS Tokens.
@@ -62,9 +62,10 @@ public ITestAzureBlobFileSystemChooseSAS() throws Exception {
6262
6363 @ Override
6464 public void setup () throws Exception {
65- createFilesystemForSASTests ( );
65+ createFilesystemWithTestFileForSASTests ( new Path ( TEST_PATH ) );
6666 super .setup ();
67- generateAccountSAS (); }
67+ generateAccountSAS ();
68+ }
6869
6970 /**
7071 * Generates an Account SAS Token using the Account Shared Key to be used as a fixed SAS Token.
@@ -143,7 +144,7 @@ private void testOnlyFixedTokenConfiguredInternal(AbfsConfiguration testAbfsConf
143144
144145 // Asserting that FixedSASTokenProvider is used.
145146 Assertions .assertThat (testAbfsConfig .getSASTokenProvider ())
146- .describedAs ("Custom SASTokenProvider Class must be used" )
147+ .describedAs ("FixedSASTokenProvider Class must be used" )
147148 .isInstanceOf (FixedSASTokenProvider .class );
148149
149150 // Assert that Account SAS is used and only read operations are permitted.
@@ -152,7 +153,7 @@ private void testOnlyFixedTokenConfiguredInternal(AbfsConfiguration testAbfsConf
152153 newTestFs .create (testPath );
153154 });
154155 // Read Operation is permitted
155- newTestFs .getFileStatus (new Path (ROOT_PATH ));
156+ newTestFs .getFileStatus (new Path (TEST_PATH ));
156157 }
157158 }
158159
0 commit comments