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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# CHANGELOG

## Version 4.0.1

### Date: 06-June-2024

- Integration tests added
- Global fields support added

---
## Version 4.0.0

### Date: 12-Sept-2024

- Added support for the upcoming Feature

---

## Version 3.16.1

### Date: 21-August-2024
Expand Down
2 changes: 1 addition & 1 deletion contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
coordinates("com.contentstack.sdk", "android", "4.0.0")
coordinates("com.contentstack.sdk", "android", "4.0.1")

pom {
name = "contentstack-android"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,40 @@ public void setUp() {

@Test
public void test_fetchGlobalField() throws Exception {
GlobalField globalField = stack.globalField("specific_gf_uid");
globalField.findAll(new GlobalFieldsResultCallback() {
// GlobalField globalField = stack.globalField("specific_gf_uid").includeBranch();
// globalField.fetch(new GlobalFieldsResultCallback() {
// @Override
// public void onCompletion(GlobalFieldsModel globalFieldsModel, Error error) {
// if (error == null) {
// JSONArray result = globalFieldsModel.getResultArray();
// System.out.println("✅ Global Fields Response: " + result);
//// Assertions.assertEquals("main", );
// Log.d(TAG, "✅ Global Fields Response: " + result);
// Assertions.assertNotNull(result);
// } else {
// System.out.println("❌ Error: " + error.getErrorMessage());
// }
// latch.countDown(); // Signal that response arrived
// }
// });
CountDownLatch latch = new CountDownLatch(1); // <- define inside test

GlobalField globalField = stack.globalField("specific_gf_uid").includeBranch();
globalField.fetch(new GlobalFieldsResultCallback() {
@Override
public void onCompletion(GlobalFieldsModel globalFieldsModel, Error error) {
if (error == null) {
JSONArray result = globalFieldsModel.getResultArray();
System.out.println("✅ Global Fields Response: " + result);
Log.d(TAG, "✅ Global Fields Response: " + result);
Assertions.assertNotNull(result);
} else {
System.out.println("❌ Error: " + error.getErrorMessage());
Log.e(TAG, "❌ Error: " + error.getErrorMessage());
}
latch.countDown(); // Signal that response arrived
latch.countDown();
}
});

latch.await(10, TimeUnit.SECONDS); // Wait for callback
}


Expand Down
Loading