Revert huaweicloud-sdk-java-obs from 3.21.8.1 to 3.21.4 (#2209)

Signed-off-by: johnniang <johnniang@fastmail.com>
pull/2225/head
John Niang 2022-07-06 15:44:12 +08:00 committed by GitHub
parent b926fd0ebe
commit 5798a28471
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 1 deletions

View File

@ -70,7 +70,7 @@ ext {
levelDbVersion = "0.12"
annotationsVersion = "3.0.1u2"
zxingVersion = '3.4.1'
huaweiObsVersion = '3.21.8.1'
huaweiObsVersion = '3.21.4'
templateInheritanceVersion = "0.4.RELEASE"
jsoupVersion = '1.14.3'
embeddedRedisVersion = '0.6'

View File

@ -0,0 +1,46 @@
package run.halo.app.handler.file;
import com.obs.services.internal.ObsProperties;
import com.obs.services.internal.RestConnectionService;
import com.obs.services.internal.ServiceException;
import com.obs.services.model.HttpMethodEnum;
import java.util.Map;
import okhttp3.Request;
import okhttp3.RequestBody;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class HuaweiObsSdkTest {
/**
* See
* <a href="https://github.com/halo-dev/halo/issues/1909">
* https://github.com/halo-dev/halo/issues/1909
* </a>
* for more.
*/
@Test
void shouldSetUpConnectionCorrectly() {
var connSvc = new RestConnectionService() {
{
// We have to initialize the obsProperties, or we will get a NPE while setting up
// connection.
obsProperties = new ObsProperties();
}
@Override
public Request.Builder setupConnection(HttpMethodEnum method, String bucketName,
String objectKey,
Map<String, String> requestParameters,
RequestBody body) throws ServiceException {
return super.setupConnection(method, bucketName, objectKey, requestParameters,
body);
}
};
var builder = connSvc.setupConnection(HttpMethodEnum.GET, "fake-bucket-name",
"fake-object-key", Map.of(), null);
Assertions.assertNotNull(builder);
}
}