Skip to content

Commit 8df946e

Browse files
committed
Don't use MimeType in LogoUploadsUrlResponse
1 parent 72d8035 commit 8df946e

2 files changed

Lines changed: 5 additions & 26 deletions

File tree

src/main/java/com/vonage/client/meetings/LogoUploadsUrlResponse.java

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,8 @@
1515
*/
1616
package com.vonage.client.meetings;
1717

18-
import com.fasterxml.jackson.annotation.JsonGetter;
1918
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2019
import com.fasterxml.jackson.annotation.JsonProperty;
21-
import com.fasterxml.jackson.annotation.JsonSetter;
22-
import com.vonage.client.VonageResponseParseException;
23-
import javax.activation.MimeType;
24-
import javax.activation.MimeTypeParseException;
2520
import java.net.URI;
2621

2722
@JsonIgnoreProperties(ignoreUnknown = true)
@@ -55,32 +50,22 @@ public Fields getFields() {
5550
@JsonIgnoreProperties(ignoreUnknown = true)
5651
public static class Fields {
5752
private LogoType logoType;
58-
private MimeType contentType;
59-
private String key, bucket, policy, amzDate, amzAlgorithm, amzCredential, amzSecurityToken, amzSignature;
53+
private String contentType, key, bucket, policy,
54+
amzDate, amzAlgorithm, amzCredential, amzSecurityToken, amzSignature;
6055

6156
protected Fields() {
6257
}
6358

6459
/**
6560
* MIME type of the content.
6661
*
67-
* @return The image type.
62+
* @return The image type as a string.
6863
*/
69-
@JsonGetter("Content-Type")
70-
public MimeType getContentType() {
64+
@JsonProperty("Content-Type")
65+
public String getContentType() {
7166
return contentType;
7267
}
7368

74-
@JsonSetter("Content-Type")
75-
protected void setContentType(String contentType) {
76-
try {
77-
this.contentType = contentType != null ? new MimeType(contentType) : null;
78-
}
79-
catch (MimeTypeParseException ex) {
80-
throw new VonageResponseParseException("Invalid MIME type: "+contentType, ex);
81-
}
82-
}
83-
8469
/**
8570
* Logo's key in storage system.
8671
*

src/test/java/com/vonage/client/meetings/MeetingsClientTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ public void runTests() throws Exception {
10111011
testUnsuccessfulResponse();
10121012
testEmptyEdgeCases();
10131013
testParseMalformedResponse();
1014-
testInvalidContentType();
10151014
testInvalidLogoType();
10161015
}
10171016

@@ -1038,11 +1037,6 @@ private void testParseMalformedResponse() throws Exception {
10381037
assertThrows(VonageResponseParseException.class, this::executeEndpoint);
10391038
}
10401039

1041-
private void testInvalidContentType() throws Exception {
1042-
stubResponse(200, "[{\"fields\":{\"Content-Type\":\"not-a-mime\"}}]");
1043-
assertThrows(VonageResponseParseException.class, this::executeEndpoint);
1044-
}
1045-
10461040
private void testInvalidLogoType() throws Exception {
10471041
stubResponse(200, "[{\"fields\":{\"logoType\":\"smoll\"}}]");
10481042
List<LogoUploadsUrlResponse> parsed = executeEndpoint();

0 commit comments

Comments
 (0)