Skip to content

Commit 94ce618

Browse files
authored
Merge pull request #75 from contentstack/feat/DX-2979-global-field-impl
Version bump
2 parents 00940b3 + dedb1b9 commit 94ce618

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# CHANGELOG
22

3+
## Version 4.0.1
4+
5+
### Date: 06-June-2024
6+
7+
- Integration tests added
8+
- Global fields support added
9+
10+
---
11+
## Version 4.0.0
12+
13+
### Date: 12-Sept-2024
14+
15+
- Added support for the upcoming Feature
16+
17+
---
18+
319
## Version 3.16.1
420

521
### Date: 21-August-2024

contentstack/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
1010
mavenPublishing {
1111
publishToMavenCentral(SonatypeHost.DEFAULT)
1212
signAllPublications()
13-
coordinates("com.contentstack.sdk", "android", "4.0.0")
13+
coordinates("com.contentstack.sdk", "android", "4.0.1")
1414

1515
pom {
1616
name = "contentstack-android"

contentstack/src/androidTest/java/com/contentstack/sdk/GlobalFieldTestCase.java

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,40 @@ public void setUp() {
3838

3939
@Test
4040
public void test_fetchGlobalField() throws Exception {
41-
GlobalField globalField = stack.globalField("specific_gf_uid");
42-
globalField.findAll(new GlobalFieldsResultCallback() {
41+
// GlobalField globalField = stack.globalField("specific_gf_uid").includeBranch();
42+
// globalField.fetch(new GlobalFieldsResultCallback() {
43+
// @Override
44+
// public void onCompletion(GlobalFieldsModel globalFieldsModel, Error error) {
45+
// if (error == null) {
46+
// JSONArray result = globalFieldsModel.getResultArray();
47+
// System.out.println("✅ Global Fields Response: " + result);
48+
//// Assertions.assertEquals("main", );
49+
// Log.d(TAG, "✅ Global Fields Response: " + result);
50+
// Assertions.assertNotNull(result);
51+
// } else {
52+
// System.out.println("❌ Error: " + error.getErrorMessage());
53+
// }
54+
// latch.countDown(); // Signal that response arrived
55+
// }
56+
// });
57+
CountDownLatch latch = new CountDownLatch(1); // <- define inside test
58+
59+
GlobalField globalField = stack.globalField("specific_gf_uid").includeBranch();
60+
globalField.fetch(new GlobalFieldsResultCallback() {
4361
@Override
4462
public void onCompletion(GlobalFieldsModel globalFieldsModel, Error error) {
4563
if (error == null) {
4664
JSONArray result = globalFieldsModel.getResultArray();
47-
System.out.println("✅ Global Fields Response: " + result);
65+
Log.d(TAG, "✅ Global Fields Response: " + result);
66+
Assertions.assertNotNull(result);
4867
} else {
49-
System.out.println("❌ Error: " + error.getErrorMessage());
68+
Log.e(TAG, "❌ Error: " + error.getErrorMessage());
5069
}
51-
latch.countDown(); // Signal that response arrived
70+
latch.countDown();
5271
}
5372
});
73+
74+
latch.await(10, TimeUnit.SECONDS); // Wait for callback
5475
}
5576

5677

0 commit comments

Comments
 (0)