Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to the library will be documented in this file.
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/)
and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in [README.md][readme] file.

## [ [6.4.1](https://github.com/infobip/infobip-api-java-client/releases/tag/6.4.1) ] - 2026-05-05

### Fixed
* Fixed `getCampaignNetworkStatuses` response type to return a list instead of a single object.

## [ [6.4.0](https://github.com/infobip/infobip-api-java-client/releases/tag/6.4.0) ] - 2026-03-31

⚠️ **IMPORTANT NOTE:** This release contains compile time breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Simply add the following in your project's POM file under `dependencies` tag:
<dependency>
<groupId>com.infobip</groupId>
<artifactId>infobip-api-java-client</artifactId>
<version>6.4.0</version>
<version>6.4.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.infobip</groupId>
<artifactId>infobip-api-java-client</artifactId>
<version>6.4.0</version>
<version>6.4.1</version>
<packaging>jar</packaging>

<name>infobip-api-java-client</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/infobip/RequestFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class RequestFactory {

private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.4.0";
private static final String USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.4.1";

private final ApiKey apiKey;
private final BaseUrl baseUrl;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/infobip/api/NumbersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -1943,13 +1943,13 @@ private GetCampaignNetworkStatusesRequest(UUID campaignId) {
/**
* Executes the getCampaignNetworkStatuses request.
*
* @return NumbersNetworkStatus The deserialized response.
* @return List&lt;NumbersNetworkStatus&gt; The deserialized response.
* @throws ApiException If the API call fails or an error occurs during the request or response processing.
*/
public NumbersNetworkStatus execute() throws ApiException {
public List<NumbersNetworkStatus> execute() throws ApiException {
RequestDefinition getCampaignNetworkStatusesDefinition = getCampaignNetworkStatusesDefinition(campaignId);
return apiClient.execute(
getCampaignNetworkStatusesDefinition, new TypeReference<NumbersNetworkStatus>() {}.getType());
getCampaignNetworkStatusesDefinition, new TypeReference<List<NumbersNetworkStatus>>() {}.getType());
}

/**
Expand All @@ -1958,11 +1958,11 @@ public NumbersNetworkStatus execute() throws ApiException {
* @param callback The {@link ApiCallback} to be invoked.
* @return The {@link okhttp3.Call} associated with the API request.
*/
public okhttp3.Call executeAsync(ApiCallback<NumbersNetworkStatus> callback) {
public okhttp3.Call executeAsync(ApiCallback<List<NumbersNetworkStatus>> callback) {
RequestDefinition getCampaignNetworkStatusesDefinition = getCampaignNetworkStatusesDefinition(campaignId);
return apiClient.executeAsync(
getCampaignNetworkStatusesDefinition,
new TypeReference<NumbersNetworkStatus>() {}.getType(),
new TypeReference<List<NumbersNetworkStatus>>() {}.getType(),
callback);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/infobip/RequestFactoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RequestFactoryTest {

private static final String GIVEN_API_KEY_VALUE = "apiKeyValue";
private static final ApiKey GIVEN_API_KEY = ApiKey.from(GIVEN_API_KEY_VALUE);
private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.4.0";
private static final String EXPECTED_USER_AGENT_HEADER_VALUE = "infobip-api-client-java/6.4.1";

private final OkHttpClient client = new OkHttpClient();
private final JSON json = new JSON();
Expand Down
52 changes: 35 additions & 17 deletions src/test/java/com/infobip/api/NumbersApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4641,18 +4641,28 @@ void shouldGetCampaignNetworkStatuses() {
NumbersNetworkState givenState1 = NumbersNetworkState.ACTIVE;
String givenMessageClass1 = "A";
Integer givenThroughput1 = 4500;
NumbersNetwork givenNetwork2 = NumbersNetwork.T_MOBILE;
NumbersNetworkState givenState2 = NumbersNetworkState.ACTIVE;
String givenMessageClass2 = "20";
Integer givenThroughput2 = 2000;
String givenBrandTier2 = "LOW";

String givenResponse = "{\n"
+ " \"network\": \"ATT\",\n"
+ " \"state\": \"ACTIVE\",\n"
+ " \"messageClass\": \""
+ givenMessageClass1
+ "\",\n"
+ " \"throughput\": "
+ givenThroughput1
+ ",\n"
+ " \"brandTier\": null\n"
+ "}\n";
String givenResponse = "[\n"
+ " {\n"
+ " \"network\": \"ATT\",\n"
+ " \"state\": \"ACTIVE\",\n"
+ " \"messageClass\": \"A\",\n"
+ " \"throughput\": 4500,\n"
+ " \"brandTier\": null\n"
+ " },\n"
+ " {\n"
+ " \"network\": \"T_MOBILE\",\n"
+ " \"state\": \"ACTIVE\",\n"
+ " \"messageClass\": \"20\",\n"
+ " \"throughput\": 2000,\n"
+ " \"brandTier\": \"LOW\"\n"
+ " }\n"
+ "]\n";

setUpSuccessGetRequest(
CAMPAIGN_NETWORK_STATUSES.replace("{campaignId}", givenCampaignId.toString()), Map.of(), givenResponse);
Expand All @@ -4661,13 +4671,21 @@ void shouldGetCampaignNetworkStatuses() {

var call = api.getCampaignNetworkStatuses(givenCampaignId);

Consumer<NumbersNetworkStatus> assertions = response -> {
Consumer<List<NumbersNetworkStatus>> assertions = response -> {
then(response).isNotNull();
then(response.getNetwork()).isEqualTo(givenNetwork1);
then(response.getState()).isEqualTo(givenState1);
then(response.getMessageClass()).isEqualTo(givenMessageClass1);
then(response.getThroughput()).isEqualTo(givenThroughput1);
then(response.getBrandTier()).isNull();
then(response).hasSize(2);
NumbersNetworkStatus status1 = response.get(0);
then(status1.getNetwork()).isEqualTo(givenNetwork1);
then(status1.getState()).isEqualTo(givenState1);
then(status1.getMessageClass()).isEqualTo(givenMessageClass1);
then(status1.getThroughput()).isEqualTo(givenThroughput1);
then(status1.getBrandTier()).isNull();
NumbersNetworkStatus status2 = response.get(1);
then(status2.getNetwork()).isEqualTo(givenNetwork2);
then(status2.getState()).isEqualTo(givenState2);
then(status2.getMessageClass()).isEqualTo(givenMessageClass2);
then(status2.getThroughput()).isEqualTo(givenThroughput2);
then(status2.getBrandTier()).isEqualTo(givenBrandTier2);
};

testSuccessfulCall(call::execute, assertions);
Expand Down
Loading