Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Oct 11, 2024
1 parent 4b3e67a commit 502fe1e
Show file tree
Hide file tree
Showing 51 changed files with 65 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/audit/apis/ApiQueryLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -640,4 +640,4 @@ public LogInfo[] getAuditLogInfos() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiCreateGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,4 @@ public CreatedGroupData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiCreatePolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,4 +470,4 @@ public CreatedPolicyData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiCreateUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ public CreatedIamUserData getData() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,4 @@ public CreatedIamUserKeyPairData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeleteGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeleteGroupUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeletePolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeleteUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeleteUserKeypair.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiDeleteUserPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiEnableUserKeypair.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,4 @@ public GetActionsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetAudits.java
Original file line number Diff line number Diff line change
Expand Up @@ -528,4 +528,4 @@ public GetAuditLogsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,4 @@ public GetGroupData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetGroupPolicies.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ public GetGroupPoliciesData getData() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@ public GetGroupServiceActionResources getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetGroupUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,4 @@ public GetGroupIamUsersData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,4 @@ public GetGroupsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetPolicies.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,4 @@ public GetPoliciesData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ public GetPolicyData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetPolicyGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,4 @@ public GetPolicyGroupsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetPolicyUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,4 +362,4 @@ public GetPolicyIamUsersData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ public String[] getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,4 @@ public GetIamUserData getData() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ public String[] getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetUserGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,4 @@ public GetIamUserGroupsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetUserKeypairs.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@ public GetIamUserKeyPairsData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetUserPolicies.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,4 @@ public GetIamUserPoliciesData getData() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -213,4 +213,4 @@ public GetIamUserServiceActionResources getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiGetUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -369,4 +369,4 @@ public GetIamUsersData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiModifyGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiModifyGroupUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiModifyPolicy.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,4 @@ public ModifiedPolicyData getData() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiModifyUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,4 @@ public ModifiedIamUserData getData() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiUpdateGroupUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiUpdatePolicyUsers.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/iam/apis/ApiUpdateUserGroups.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ protected Response(com.qiniu.http.Response response) throws QiniuException {
}

}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/media/apis/ApiPfop.java
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,4 @@ public String getPersistentId() {
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/qiniu/media/apis/ApiPrefop.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,4 @@ public PfopTaskItem[] getItems() {
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/qiniu/storage/UpHostHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ private void randomAdd(ArrayList<String> _lastHosts, ArrayList<Integer> iidx, Ra
}

String upHost(List<String> accHosts, List<String> srcHosts, String lastUsedHost, boolean changeHost) throws QiniuException {
if ((accHosts == null || accHosts.isEmpty()) &&
(srcHosts == null || srcHosts.isEmpty())) {
if ((accHosts == null || accHosts.isEmpty())
&& (srcHosts == null || srcHosts.isEmpty())) {
throw QiniuException.unrecoverable("no up host found");
}

Expand Down
30 changes: 10 additions & 20 deletions src/test/java/com/qiniu/common/AutoZoneTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import org.junit.jupiter.api.Test;
import test.com.qiniu.TestConfig;

import java.util.HashMap;
import java.util.Map;

import static org.junit.jupiter.api.Assertions.*;

/**
Expand All @@ -17,24 +14,17 @@ public class AutoZoneTest {
@Test
@Tag("IntegrationTest")
public void testHttp() {
Map<String, String[]> cases = new HashMap<String, String[]>();
cases.put(TestConfig.testBucket_z0,
new String[]{"http://up.qiniu.com", "http://upload.qiniu.com", "https://up.qbox.me"});
cases.put(TestConfig.testBucket_na0,
new String[]{"http://up-na0.qiniu.com", "http://upload-na0.qiniu.com", "https://up-na0.qbox.me"});

for (Map.Entry<String, String[]> entry : cases.entrySet()) {
String bucket = entry.getKey();
String[] domains = entry.getValue();
try {
AutoZone zone = AutoZone.instance;
AutoZone.ZoneInfo zoneInfo = zone.queryZoneInfo(TestConfig.testAccessKey, bucket);
assertEquals(zoneInfo.upHttp, domains[0]);
assertEquals(zoneInfo.upBackupHttp, domains[1]);
assertEquals(zoneInfo.upHttps, domains[2]);
} catch (QiniuException e) {
fail(e.response.toString());
}
String bucket = TestConfig.testBucket_z0;
try {
AutoZone zone = AutoZone.instance;
AutoZone.ZoneInfo zoneInfo = zone.queryZoneInfo(TestConfig.testAccessKey, bucket);
assertTrue(zoneInfo.upHttp.contains("http://"));
assertTrue(zoneInfo.upBackupHttp.contains("http://"));
assertTrue(zoneInfo.upHttps.contains("https://"));
assertTrue(zoneInfo.upBackupHttps.contains("https://"));
} catch (QiniuException e) {
fail(e.response.toString());
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/test/java/com/qiniu/iam/apis/ApiTestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ public class ApiTestConfig {
.setRequestDebugLevel(Api.Config.DebugLevelDetail)
.setResponseDebugLevel(Api.Config.DebugLevelDetail)
.build();

private ApiTestConfig() {
}

}
Loading

0 comments on commit 502fe1e

Please sign in to comment.