forked from aws/aws-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resovles issue aws#1648 set content type multipart upload
- Loading branch information
Jason Voss
committed
Nov 22, 2021
1 parent
a7ae671
commit ec40b83
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...-s3/src/test/java/com/amazonaws/services/s3/model/InitiateMultipartUploadRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.amazonaws.services.s3.model; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* Test Model InitiateMultipartUploadRequest | ||
*/ | ||
public class InitiateMultipartUploadRequestTest { | ||
|
||
/** | ||
* Test setting the content type of the metadata for the multipart upload request | ||
*/ | ||
@Test | ||
public void testWithObjectMetadataContentTypeFromFile(){ | ||
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest("bucketName", "key", new ObjectMetadata()); | ||
File file = new File("textFile.txt"); | ||
request = request.withObjectMetadataContentTypeFromFile(file); | ||
assertEquals("text/plain", request.getObjectMetadata().getContentType()); | ||
} | ||
|
||
/** | ||
* Test setting the content type of the metadata for the multipart upload request | ||
* Creates the metadata object if it does not exist | ||
*/ | ||
@Test | ||
public void testWithObjectMetadataContentTypeFromFileCreatesMetadata(){ | ||
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest("bucketName", "key"); | ||
File file = new File("textFile.txt"); | ||
request = request.withObjectMetadataContentTypeFromFile(file); | ||
assertEquals("text/plain", request.getObjectMetadata().getContentType()); | ||
} | ||
} |