Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import com.azure.storage.file.share.models.UserDelegationKey;
import com.azure.storage.file.share.options.ShareCreateOptions;
import com.azure.storage.file.share.options.ShareSetPropertiesOptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIf;
Expand All @@ -44,6 +43,7 @@
import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
Expand All @@ -66,7 +66,9 @@ public class FileServiceApiTests extends FileShareTestBase {
private static final Map<String, String> TEST_METADATA = Collections.singletonMap("testmetadata", "value");
private static final String REALLY_LONG_STRING
= "thisisareallylongstringthatexceedsthe64characterlimitallowedoncertainproperties";
private static List<ShareCorsRule> tooManyRules = new ArrayList<>();
private static final List<ShareCorsRule> TOO_MANY_RULES
= Collections.unmodifiableList(Arrays.asList(new ShareCorsRule(), new ShareCorsRule(), new ShareCorsRule(),
new ShareCorsRule(), new ShareCorsRule(), new ShareCorsRule()));
private static final List<ShareCorsRule> INVALID_ALLOWED_HEADER
= Collections.singletonList(new ShareCorsRule().setAllowedHeaders(REALLY_LONG_STRING));
private static final List<ShareCorsRule> INVALID_EXPOSED_HEADER
Expand All @@ -76,14 +78,6 @@ public class FileServiceApiTests extends FileShareTestBase {
private static final List<ShareCorsRule> INVALID_ALLOWED_METHOD
= Collections.singletonList(new ShareCorsRule().setAllowedMethods("NOTAREALHTTPMETHOD"));

@BeforeAll
public static void setupSpec() {
for (int i = 0; i < 6; i++) {
tooManyRules.add(new ShareCorsRule());
}
tooManyRules = Collections.unmodifiableList(tooManyRules);
}

@BeforeEach
public void setup() {
shareName = generateShareName();
Expand Down Expand Up @@ -400,7 +394,7 @@ public void setAndGetPropertiesWithInvalidArgs(List<ShareCorsRule> coreList, int
}

private static Stream<Arguments> setAndGetPropertiesWithInvalidArgsSupplier() {
return Stream.of(Arguments.of(tooManyRules, 400, ShareErrorCode.INVALID_XML_DOCUMENT),
return Stream.of(Arguments.of(TOO_MANY_RULES, 400, ShareErrorCode.INVALID_XML_DOCUMENT),
Arguments.of(INVALID_ALLOWED_HEADER, 400, ShareErrorCode.INVALID_XML_DOCUMENT),
Arguments.of(INVALID_EXPOSED_HEADER, 400, ShareErrorCode.INVALID_XML_DOCUMENT),
Arguments.of(INVALID_ALLOWED_ORIGIN, 400, ShareErrorCode.INVALID_XML_DOCUMENT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
Expand All @@ -63,7 +64,9 @@ public class FileServiceAsyncApiTests extends FileShareTestBase {
private static final Map<String, String> TEST_METADATA = Collections.singletonMap("testmetadata", "value");
private static final String REALLY_LONG_STRING
= "thisisareallylongstringthatexceedsthe64characterlimitallowedoncertainproperties";
private static final List<ShareCorsRule> TOO_MANY_RULES = new ArrayList<>();
private static final List<ShareCorsRule> TOO_MANY_RULES
= Collections.unmodifiableList(Arrays.asList(new ShareCorsRule(), new ShareCorsRule(), new ShareCorsRule(),
new ShareCorsRule(), new ShareCorsRule(), new ShareCorsRule()));
private static final List<ShareCorsRule> INVALID_ALLOWED_HEADER
= Collections.singletonList(new ShareCorsRule().setAllowedHeaders(REALLY_LONG_STRING));
private static final List<ShareCorsRule> INVALID_EXPOSED_HEADER
Expand All @@ -77,9 +80,6 @@ public class FileServiceAsyncApiTests extends FileShareTestBase {
public void setup() {
shareName = generateShareName();
primaryFileServiceAsyncClient = fileServiceBuilderHelper().buildAsyncClient();
for (int i = 0; i < 6; i++) {
TOO_MANY_RULES.add(new ShareCorsRule());
}
}

@Test
Expand Down
Loading