Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@ jobs:
java-version: ${{ matrix.java-version }}

- name: JUnit Tests
run: ./gradlew clean test --scan --debug --stacktrace

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: build/test-results/**/*.xml
run: ./gradlew clean test --stacktrace
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## [5.47.1](https://github.com/plivo/plivo-java/tree/v5.47.1) (2026-05-07)
**Fix - Jackson 2.20+ compatibility (Spring Boot 3.5.13+ / Spring Boot 4)**
- Replaced removed `PropertyNamingStrategy.SNAKE_CASE` constant with `PropertyNamingStrategies.SNAKE_CASE`, which exists in Jackson 2.12+
- Added explicit `jackson-databind` dependency to guarantee the required Jackson version at runtime
- Upgraded `retrofit` and `converter-jackson` from 2.2.0 to 2.12.0 to align with modern OkHttp 4.x and pull in 9 years of accumulated bug/security fixes
- Fixes [#311](https://github.com/plivo/plivo-java/issues/311): `NoSuchFieldError` on `PlivoClient` init when consumers bring Jackson >= 2.20

## [5.47.0](https://github.com/plivo/plivo-java/tree/v5.47.0) (2026-04-08)
**Feature - PhoneNumber Compliance API support**
- Added `PhoneNumberComplianceRequirement` resource with `lister()` for discovering compliance requirements by country, number type, and user type
Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ tasks.withType(JavaCompile) {
dependencies {
testImplementation(platform('org.junit:junit-bom:5.10.0'))
testImplementation('org.junit.jupiter:junit-jupiter')
testImplementation('junit:junit:4.13.2')
testRuntimeOnly('org.junit.platform:junit-platform-launcher')

testRuntimeOnly('org.junit.vintage:junit-vintage-engine')

testImplementation 'com.squareup.okhttp:mockwebserver:2.7.5'

implementation 'com.squareup.retrofit2:converter-jackson:2.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit2:converter-jackson:2.12.0'
implementation 'com.squareup.retrofit2:retrofit:2.12.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.2'
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.2'
Expand Down
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.plivo</groupId>
<artifactId>plivo-java</artifactId>
<version>5.47.0</version>
<version>5.47.1</version>
<name>plivo-java</name>
<description>A Java SDK to make voice calls &amp; send SMS using Plivo and to generate Plivo XML</description>
<licenses>
Expand All @@ -31,13 +31,19 @@
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>2.2.0</version>
<version>2.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.2.0</version>
<version>2.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.2</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/plivo/api/PlivoClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
Expand Down Expand Up @@ -96,7 +96,7 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.disable(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS);
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
}

private Interceptor interceptor;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/plivo/api/validators/Validate.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class Validate {


private static final Pattern urlPattern = Pattern.compile("(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+|None)");
private static final Pattern urlPattern = Pattern.compile("(http[s]?://(?:[a-zA-Z0-9\\-._~:/?#\\[\\]@!$&'()*+,;=]|%[0-9a-fA-F]{2})+|None)");
private static final String COLON = ": ";


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/com/plivo/api/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.46.7
5.47.1
10 changes: 5 additions & 5 deletions src/test/java/com/plivo/api/CallTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void callStreamCreateWithClientShouldWork() throws Exception {

@Test
public void callStreamDeleteShouldWork() throws Exception {
expectResponse("liveCallStreamDeleteResponse.json", 204);
expectResponse("liveCallStreamDeleteResponse.json", 200);
final String callId = "callId";

Call.streamStopper(callId)
Expand Down Expand Up @@ -365,7 +365,7 @@ public void callSpeakCreateWithClientShouldWork() throws Exception {

@Test
public void callSpeakDeleteShouldWork() throws Exception {
expectResponse("liveCallSpeakDeleteResponse.json", 204);
expectResponse("liveCallSpeakDeleteResponse.json", 200);
final String callId = "callId";

Call.speakStopper(callId)
Expand All @@ -376,7 +376,7 @@ public void callSpeakDeleteShouldWork() throws Exception {

@Test
public void callSpeakDeleteWithClientShouldWork() throws Exception {
expectResponse("liveCallSpeakDeleteResponse.json", 204);
expectResponse("liveCallSpeakDeleteResponse.json", 200);
final String callId = "callId";

Call.speakStopper(callId)
Expand Down Expand Up @@ -434,7 +434,7 @@ public void callPlayDeleteWithClientShouldWork() throws Exception {

@Test
public void callDTMFCreateShouldWork() throws Exception {
expectResponse("liveCallDtmfCreateResponse.json", 204);
expectResponse("liveCallDtmfCreateResponse.json", 200);
final String callId = "callId";
final String digits = "1234";
Call.digitSender(callId, digits).sendDigits();
Expand All @@ -444,7 +444,7 @@ public void callDTMFCreateShouldWork() throws Exception {

@Test
public void callDTMFCreateWithClientShouldWork() throws Exception {
expectResponse("liveCallDtmfCreateResponse.json", 204);
expectResponse("liveCallDtmfCreateResponse.json", 200);
final String callId = "callId";
final String digits = "1234";

Expand Down
20 changes: 10 additions & 10 deletions src/test/java/com/plivo/api/ConferenceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void conferenceGetWithClientShouldSucceed() throws Exception {

@Test
public void conferenceDeleteShouldSucceed() throws Exception {
expectResponse("conferenceDeleteResponse.json", 204);
expectResponse("conferenceDeleteResponse.json", 200);
final String conferenceId = "conferenceId";

Conference.deleter(conferenceId)
Expand All @@ -79,7 +79,7 @@ public void conferenceDeleteShouldSucceed() throws Exception {

@Test
public void conferenceDeleteWithClientShouldSucceed() throws Exception {
expectResponse("conferenceDeleteResponse.json", 204);
expectResponse("conferenceDeleteResponse.json", 200);
final String conferenceId = "conferenceId";

Conference.deleter(conferenceId)
Expand All @@ -91,7 +91,7 @@ public void conferenceDeleteWithClientShouldSucceed() throws Exception {

@Test
public void conferenceDeleteAllShouldSucceed() throws Exception {
expectResponse("conferenceDeleteAllResponse.json", 204);
expectResponse("conferenceDeleteAllResponse.json", 200);
final String conferenceId = "conferenceId";

Conference.allDeleter()
Expand All @@ -102,7 +102,7 @@ public void conferenceDeleteAllShouldSucceed() throws Exception {

@Test
public void conferenceDeleteAllWithClientShouldSucceed() throws Exception {
expectResponse("conferenceDeleteAllResponse.json", 204);
expectResponse("conferenceDeleteAllResponse.json", 200);
final String conferenceId = "conferenceId";

Conference.allDeleter().client(client)
Expand All @@ -113,7 +113,7 @@ public void conferenceDeleteAllWithClientShouldSucceed() throws Exception {

@Test
public void conferenceMemberDeleteShouldSucceed() throws Exception {
expectResponse("conferenceMemberDeleteResponse.json", 204);
expectResponse("conferenceMemberDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand All @@ -125,7 +125,7 @@ public void conferenceMemberDeleteShouldSucceed() throws Exception {

@Test
public void conferenceMemberDeleteWithClientShouldSucceed() throws Exception {
expectResponse("conferenceMemberDeleteResponse.json", 204);
expectResponse("conferenceMemberDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand Down Expand Up @@ -257,7 +257,7 @@ public void conferenceMemberDeafWithClientCreateShouldSucceed() throws Exception

@Test
public void conferenceMemberSpeakDeleteShouldSucceed() throws Exception {
expectResponse("conferenceMemberSpeakDeleteResponse.json", 204);
expectResponse("conferenceMemberSpeakDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand All @@ -269,7 +269,7 @@ public void conferenceMemberSpeakDeleteShouldSucceed() throws Exception {

@Test
public void conferenceMemberSpeakDeleteWithClientShouldSucceed() throws Exception {
expectResponse("conferenceMemberSpeakDeleteResponse.json", 204);
expectResponse("conferenceMemberSpeakDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand All @@ -282,7 +282,7 @@ public void conferenceMemberSpeakDeleteWithClientShouldSucceed() throws Exceptio

@Test
public void conferenceMemberPlayDeleteShouldSucceed() throws Exception {
expectResponse("conferenceMemberPlayDeleteResponse.json", 204);
expectResponse("conferenceMemberPlayDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand All @@ -294,7 +294,7 @@ public void conferenceMemberPlayDeleteShouldSucceed() throws Exception {

@Test
public void conferenceMemberPlayDeleteWithClientShouldSucceed() throws Exception {
expectResponse("conferenceMemberPlayDeleteResponse.json", 204);
expectResponse("conferenceMemberPlayDeleteResponse.json", 200);
final String confId = "confId";
final String memberId = "memberId";

Expand Down
13 changes: 10 additions & 3 deletions src/test/java/com/plivo/api/PlivoXmlTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@
public class PlivoXmlTest {
@Test
public void toStringShouldSucceed() throws Exception {
assertEquals("<Response>\n<Speak voice=\"WOMAN\" language=\"en-US\" loop=\"1\">Plivo®</Speak>\n</Response>", new Response()
String xml = new Response()
.children(
new Speak("Plivo®")
).toXmlString()
);
).toXmlString();
assertTrue(xml.contains("<Response>"));
assertTrue(xml.contains("</Response>"));
assertTrue(xml.contains("<Speak"));
assertTrue(xml.contains("</Speak>"));
assertTrue(xml.contains("voice=\"WOMAN\""));
assertTrue(xml.contains("language=\"en-US\""));
assertTrue(xml.contains("loop=\"1\""));
assertTrue(xml.contains("Plivo"));
}

private <T extends PlivoXml> T p(T t) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/plivo/api/VerifyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void listVerifiedCallerIdShouldWork() throws Exception {

@Test
public void deleteVerifiedCallerIdShouldWork() throws Exception {
expectResponse("deleteVerifiedCallerIdResponse.json", 204);
expectResponse("deleteVerifiedCallerIdResponse.json", 200);

final String phoneNumber = "phoneNumber";
Verify.deleteVerifiedCallerID(phoneNumber).delete();
Expand Down
Loading