Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/dx 1150 early access header testcases #66

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## Version 3.16.2

### Date: 28-August-2024

- Early access header test

---

## 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", "3.16.1")
coordinates("com.contentstack.sdk", "android", "3.16.2")

pom {
name = "contentstack-android"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import android.content.Context;
import android.util.Log;
Expand Down Expand Up @@ -98,4 +99,30 @@ public void onCompletion(SyncStack syncStack, Error error) {
});
assertNotNull(stack.syncParams);
}

@Test
public void testEarlyAccess() throws Exception {
Context ctx = ApplicationProvider.getApplicationContext();
Config config = new Config();
String[] earlyAccess = {"Taxonomy"};
config.earlyAccess(earlyAccess);
stack = Contentstack.stack(ctx, apiKey, deliveryToken, environment, config);
assertEquals(earlyAccess[0], config.earlyAccess[0]);
assertNotNull(stack.localHeader.containsKey("x-header-ea"));
assertEquals("Taxonomy", stack.localHeader.get("x-header-ea"));
}

@Test
public void testConfigEarlyAccessMultipleFeature() throws Exception {
Context ctx = ApplicationProvider.getApplicationContext();
Config config = new Config();
String[] earlyAccess = {"Taxonomy", "Teams", "Terms", "LivePreview"};
config.earlyAccess(earlyAccess);
stack = Contentstack.stack(ctx, apiKey, deliveryToken, environment, config);
assertEquals(4, stack.localHeader.keySet().size());
assertEquals(earlyAccess[1], config.earlyAccess[1]);
assertTrue(stack.localHeader.containsKey("x-header-ea"));
assertEquals("Taxonomy,Teams,Terms,LivePreview", stack.localHeader.get("x-header-ea"));
}

}
Loading