@@ -68,6 +68,52 @@ public void testBuckets() {
6868 }
6969 }
7070
71+ @ Test
72+ @ Tag ("IntegrationTest" )
73+ public void testStorageTypeIntelligentTiering () {
74+ String key = "storage_type_intelligent_tiering" ;
75+ String bucket = TestConfig .testBucket_z0 ;
76+
77+ // 清理文件
78+ try {
79+ Response response = bucketManager .delete (bucket , key );
80+ assertTrue (response .isOK (), "response is not OK" );
81+ } catch (QiniuException e ) {
82+ e .printStackTrace ();
83+ fail ();
84+ }
85+
86+ // 上传文件
87+ try {
88+ StringMap map = new StringMap ();
89+ map .put ("insertOnly" , "1" );
90+ uploadManager .put ("aaa" .getBytes (), key , TestConfig .testAuth .uploadToken (bucket ), map , null , false );
91+ } catch (QiniuException e ) {
92+ e .printStackTrace ();
93+ fail ();
94+ }
95+
96+ // 修改文件修类型
97+ try {
98+ Response resp = bucketManager .changeType (bucket , key , StorageType .IntelligentTiering );
99+ assertTrue (resp .isOK (), "change type failed" );
100+ } catch (QiniuException e ) {
101+ e .printStackTrace ();
102+ fail ();
103+ }
104+
105+ // 验证文件类型
106+ try {
107+ FileInfo fi = bucketManager .stat (bucket , key );
108+ assertNotNull (fi , "stat failed" );
109+ assertEquals (5 , fi .type , "stat failed" );
110+ assertEquals (fi .type , StorageType .IntelligentTiering .ordinal (), "stat failed" );
111+ } catch (QiniuException e ) {
112+ e .printStackTrace ();
113+ fail ();
114+ }
115+ }
116+
71117 /**
72118 * 测试列举空间域名
73119 */
0 commit comments