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

Next #89

Merged
merged 17 commits into from
Oct 17, 2024
Merged

Next #89

Changes from 1 commit
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
Prev Previous commit
Next Next commit
Early acess header testcases added
reeshika-h committed Aug 26, 2024
commit b030d422cda769c3c78b62f0b33c3526398779b9
19 changes: 15 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@
<organizationUrl>https://www.contentstack.com/</organizationUrl>
</developer>
<developer>
<name>ishaileshmishra</name>
<name>***REMOVED***</name>
<email>mshaileshr@gmail.com</email>
<organization>contentstack</organization>
<organizationUrl>https://www.contentstack.com/</organizationUrl>
@@ -91,7 +91,7 @@
<rxjava-source.version>3.1.8</rxjava-source.version>
<retrofit-source.version>2.10.0</retrofit-source.version>
<converter-gson-version>2.10.0</converter-gson-version>
<logging.version>5.0.0-alpha.12</logging.version>
<okhttp.version>4.11.0</okhttp.version>
<jococo-plugin.version>0.8.7</jococo-plugin.version>
<lombok-source.version>1.18.32</lombok-source.version>
<junit-jupiter.version>5.10.1</junit-jupiter.version>
@@ -132,9 +132,20 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${logging.version}</version>
<version>${okhttp.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>${okhttp.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
@@ -253,7 +264,7 @@
</plugin>

<!-- -overview
"/Users/shaileshmishra/Documents/Workspace/contentstack/java/contentstack-management-java/src/main/overview.html"
"***REMOVED***tentstack/java/contentstack-management-java/src/main/overview.html"
-bottom "<b>Copyright © 2012-2022 Contentstack </b><sup>TM</sup>"-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
6 changes: 3 additions & 3 deletions src/main/java/com/contentstack/cms/Contentstack.java
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ public class Contentstack {
* <br>
*
* @return User
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#users">User
* </a>
@@ -129,7 +129,7 @@ public User user() {
* @param password the password of the user
* @return LoginDetails
* @throws IOException the IOException
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#users">User
* </a>
@@ -182,7 +182,7 @@ public Response<LoginDetails> login(String emailId, String password) throws IOEx
* @return LoginDetails
* @throws IOException the io exception
* @throws IOException the IOException
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a
* href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#log-in-to-your-account">Login
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
* API implementation, you'll want to pass the auth token as the value for the
* Authorization header.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @since v0.1.0
*/
public class AuthInterceptor implements Interceptor {
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
* an illegal or unsuitable argument
* passed to a method.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/core/CMALogger.java
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
/**
* The Contentstack Logger
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
/**
* CMARuntimeException that extends Exception class
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
/**
* The Contentstack ResponseResult class that accepts different types of Models
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
/**
* The Contentstack RetryCallback
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/core/Util.java
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
/**
* The utility class that contains utility common functions
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
* users. Organization allows easy management of projects as well as users
* within the Organization.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-20
*/
6 changes: 3 additions & 3 deletions src/main/java/com/contentstack/cms/stack/Alias.java
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
* ID in your frontend code to pull content
* from the target branch associated with an alias.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href= "https://www.contentstack.com/docs/developers/apis/content-management-api/#aliases">About Aliases </a>
* @since 2022 -10-20
@@ -138,7 +138,7 @@ protected void clearParams() {
* aliases available in a particular stack in your account.
*
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-aliases">Get
* all
@@ -153,7 +153,7 @@ public Call<ResponseBody> find() {
* The Get a single alias request returns information of a specific alias.
*
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-branch">
* Get a single branch</a>
16 changes: 8 additions & 8 deletions src/main/java/com/contentstack/cms/stack/Asset.java
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
* so on) uploaded in your Contentstack
* repository for future use.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @since 2022-10-20
*/
public class Asset implements BaseImplementation<Asset> {
@@ -187,7 +187,7 @@ public Folder folder(@NotNull String folderUid) {
* Example:file_size
*
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-assets">Get
* all
@@ -210,7 +210,7 @@ public Call<ResponseBody> find() {
* published in each of the environment.
*
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-asset">Get
* a single asset</a>
@@ -228,7 +228,7 @@ public Call<ResponseBody> fetch() {
*
* @param folderUid The folderUid of specific folder
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-assets-of-a-specific-folder">Get
* Assets of a Specific Folder</a>
@@ -249,7 +249,7 @@ public Call<ResponseBody> byFolderUid(@NotNull String folderUid) {
* @param folderUid folder uid
* @param isIncludeFolders provide true/false
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-assets-and-subfolders-of-a-parent-folder">Get
* Assets and Subfolders of a Parent Folder</a>
@@ -296,7 +296,7 @@ public Call<ResponseBody> subfolder(
* in the response.</li>
* </ul>
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#upload-asset">
* Upload
@@ -410,7 +410,7 @@ private MultipartBody.Part uploadFile(@NotNull String filePath) {
*
* @param body the JSONObject request body
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#generate-permanent-asset-url">
* Generate Permanent Asset URL </a>
@@ -439,7 +439,7 @@ public Call<ResponseBody> generatePermanentUrl(JSONObject body) {
*
* @param slugUrl The unique identifier of the asset.
* @return Call
* @author ishaileshmishra
* @author ***REMOVED***
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#generate-permanent-asset-url">
* Generate Permanent Asset Url</a>
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/AuditLog.java
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#audit-log">Audit
* Log</a>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Branch.java
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
* parallel in a more collaborative, organized,
* and structured manner without impacting each other.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v1.0.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#branches">About
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
* bulk operations on search results
* <br>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v1.0.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#bulk-publish-operation">
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
* key in the response. This key specifies the unique ID of the branch where the
* concerned Contentstack module resides.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#content-types">Content
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
* requests over your stack content, you can use Management Tokens
* <br>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Entry.java
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
* key in the response. This key specifies the unique ID of the branch where the
* concerned Contentstack module resides.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
* content delivery destination where the
* entries need to be published.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Extensions.java
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
* key in the response. This key specifies the unique ID of the branch where the
* concerned Contentstack module resides.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
* key in the response. This key specifies the unique ID of the branch where the
* concerned Contentstack module resides.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Label.java
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
* key in the response. This key specifies the unique ID of the branch where the
* concerned Contentstack module resides.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Locale.java
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
* to a wide variety of audience by serving
* content in their local language(s).
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#languages">
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* content, you can use Management Tokens
* <br>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Merge.java
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
* </li>
* </ul>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v1.0.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#merge-branches">Merge
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
* concerned Contentstack module resides.
* <br>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#publish-queue">
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Release.java
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
* Read more about <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#releases">Releases</a>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#release-items">Release
* Items</a>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Roles.java
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* A role is a collection of permissions that will be applicable to all the
* users who are assigned this role.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/invite-users-and-assign-roles/about-stack-roles">Roles
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Stack.java
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
* property). Within a stack, you can create
* content structures, content entries, users, etc. related to the project.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022 -10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Tokens.java
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
/**
* Contentstack provides different types of tokens to authorize API requests
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Webhook.java
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
* Read more
* about Webhooks.</a>
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @see <a href=
* "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-a-single-delivery-token">
2 changes: 1 addition & 1 deletion src/main/java/com/contentstack/cms/stack/Workflow.java
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
* <b>Note:</b> You cannot create workflows in a stack that supports branches
* when using the classic Contentstack interface.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v01.0
* @since 2022-10-22
*/
4 changes: 2 additions & 2 deletions src/main/java/com/contentstack/cms/user/User.java
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
* can have many users with varying
* permissions and roles.
*
* @author ishaileshmishra
* @author ***REMOVED***
* @version v0.1.0
* @since 2022-10-22
*/
@@ -45,7 +45,7 @@ public class User implements BaseImplementation {
* contentstack.user().execute();<br>
*
* <br>
* @author ishaileshmishra
* @author ***REMOVED***
*/
public User(Retrofit client) {
this.params = new HashMap<>();
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
import java.io.IOException;

/*
@author ishaileshmishra@gmail.com
@author ***REMOVED***@gmail.com
@since CMS v0.0.1
*/
public class ContentstackAPITest {
67 changes: 67 additions & 0 deletions src/test/java/com/contentstack/cms/ContentstackUnitTest.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package com.contentstack.cms;

import com.contentstack.cms.core.AuthInterceptor;
import com.contentstack.cms.organization.Organization;
import com.contentstack.cms.stack.Stack;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.ResponseBody;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import retrofit2.Response;
@@ -262,5 +268,66 @@ public void testEmptyOrganizationUid() {
Assertions.assertThrows(IllegalStateException.class, () -> client.organization(emptyOrganizationUid));
}

@Test
public void testEarlyAccessHeader() throws IOException, InterruptedException {
MockWebServer mockWebServer = new MockWebServer();
mockWebServer.enqueue(new MockResponse().setBody("{}"));

AuthInterceptor authInterceptor = new AuthInterceptor();
authInterceptor.setEarlyAccess(new String[]{"Taxonomy"});

OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(authInterceptor)
.build();

Request request = new Request.Builder()
.url(mockWebServer.url("/"))
.build();

client.newCall(request).execute();
RecordedRequest recordedRequest = mockWebServer.takeRequest();
String earlyAccessHeader = recordedRequest.getHeader("x-header-ea");

Assertions.assertNotNull(earlyAccessHeader);
Assertions.assertEquals("Taxonomy", earlyAccessHeader);

mockWebServer.shutdown();
}
@Test
public void testEarlyAccessMultipleHeader() throws IOException, InterruptedException {
MockWebServer mockWebServer = new MockWebServer();
mockWebServer.enqueue(new MockResponse().setBody("{}"));

AuthInterceptor authInterceptor = new AuthInterceptor();
authInterceptor.setEarlyAccess(new String[]{"Taxonomy","Teams"});

OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(authInterceptor)
.build();

Request request = new Request.Builder()
.url(mockWebServer.url("/"))
.build();

client.newCall(request).execute();
RecordedRequest recordedRequest = mockWebServer.takeRequest();
String earlyAccessHeader = recordedRequest.getHeader("x-header-ea");

Assertions.assertNotNull(earlyAccessHeader);
Assertions.assertEquals("Taxonomy, Teams", earlyAccessHeader);

mockWebServer.shutdown();
}

@Test
public void testEarlyAccessHeaderEmpty() {
String[] emptyEarlyAccessFeatures = {};
Contentstack client = new Contentstack.Builder()
.earlyAccess(emptyEarlyAccessFeatures)
.build();

Assertions.assertNotNull(client.earlyAccess);
Assertions.assertEquals(0, client.earlyAccess.length);
}

}
2 changes: 1 addition & 1 deletion src/test/java/com/contentstack/cms/TestClient.java
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public static Contentstack getCustomClient() {
instance = new Contentstack.Builder()
.setAuthtoken(AUTHTOKEN)
.setConnectionPool(5, 400, TimeUnit.MILLISECONDS)
.setHost("kpm.ishaileshmishra.io/path/another").build();
.setHost("kpm.***REMOVED***.io/path/another").build();
}
}
}
12 changes: 6 additions & 6 deletions src/test/java/com/contentstack/cms/models/LoginDetailTest.java
Original file line number Diff line number Diff line change
@@ -86,24 +86,24 @@ void getterSetterUserModelFailedAttempts() {
@Test
void getterSetterUserModelFirstName() {
UserModel userModel = new UserModel();
userModel.setFirstName("ishaileshmishra");
Assertions.assertEquals("ishaileshmishra",
userModel.setFirstName("***REMOVED***");
Assertions.assertEquals("***REMOVED***",
userModel.getFirstName());
}

@Test
void getterSetterUserModelLastName() {
UserModel userModel = new UserModel();
userModel.setLastName("ishaileshmishra");
Assertions.assertEquals("ishaileshmishra",
userModel.setLastName("***REMOVED***");
Assertions.assertEquals("***REMOVED***",
userModel.getLastName());
}

@Test
void getterSetterUserModelUsername() {
UserModel userModel = new UserModel();
userModel.setUsername("ishaileshmishra");
Assertions.assertEquals("ishaileshmishra",
userModel.setUsername("***REMOVED***");
Assertions.assertEquals("***REMOVED***",
userModel.getUsername());
}

Original file line number Diff line number Diff line change
@@ -457,7 +457,7 @@ void testGetAllInvitationsRequestParam() {
@Test
@Order(38)
void testTransferOwnershipMethod() {
//String transferToEmail = "ishaileshmishra@gmail.com";
//String transferToEmail = "***REMOVED***@gmail.com";
Request requestInfo = organization.transferOwnership(new JSONObject()).request();
Assertions.assertEquals("POST",
requestInfo.method());
@@ -466,7 +466,7 @@ void testTransferOwnershipMethod() {
@Test
@Order(39)
void testTransferOwnershipEncodedPath() {
// String transferToEmail = "ishaileshmishra@gmail.com";
// String transferToEmail = "***REMOVED***@gmail.com";
Request requestInfo = organization.transferOwnership(new JSONObject()).request();
Assertions.assertEquals("/v3/organizations/" + organizationUid + "/transfer-ownership",
requestInfo.url().encodedPath());
@@ -481,7 +481,7 @@ void testTransferOwnershipHeaders() {
@Test
@Order(41)
void testTransferOwnershipRequestBody() {
//String transferToEmail = "ishaileshmishra@gmail.com";
//String transferToEmail = "***REMOVED***@gmail.com";
Request requestInfo = organization.transferOwnership(new JSONObject()).request();
assertNull(
requestInfo.url().encodedQuery());
4 changes: 2 additions & 2 deletions src/test/java/com/contentstack/cms/stack/AssetAPITest.java
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ void testAssetReplace() throws IOException {
asset.addHeader("authorization", MANAGEMENT_TOKEN);
// Create Asset Instance to find all assets
String filePath = "/Users/shaileshmishra/Downloads/calendar.png";
Response<ResponseBody> resp = asset.replace(filePath, "Assets created by ishaileshmishra").execute();
Response<ResponseBody> resp = asset.replace(filePath, "Assets created by ***REMOVED***").execute();
// The assertions
Assertions.assertEquals(6, resp.raw().request().headers().size());
Assertions.assertTrue(resp.raw().request().headers().names().contains("api_key"));
@@ -248,7 +248,7 @@ void testAssetDownloadPermanentUrl() throws IOException {

@Test
void testAssetUploadWithMultipleParams() throws IOException {
String description = "The calender has been placed to assets by ishaileshmishra";
String description = "The calender has been placed to assets by ***REMOVED***";
String filePath = "/Users/shaileshmishra/Documents/workspace/GitHub/contentstack-management-java/src/test/resources/asset.png";
Contentstack client = new Contentstack.Builder().build();
Stack stack = client.stack("Your-api-key", "authorization");
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ void testAssetReplace() {
asset.addParam("include_dimension", true);

String filePath = "/Users/shaileshmishra/Downloads/calendar.png";
Request resp = asset.replace(filePath, "The calender has been placed to assets by ishaileshmishra")
Request resp = asset.replace(filePath, "The calender has been placed to assets by ***REMOVED***")
.request();
Assertions.assertTrue(resp.isHttps());
Assertions.assertEquals("PUT", resp.method());
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ void testEntryFetch() {
void testEntryCreate() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryCreate = new JSONObject();
entryCreate.put("entry", body);
Request request = entry.create(entryCreate).request();
@@ -82,7 +82,7 @@ void testEntryCreate() {
void testUpdate() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryUpdate = new JSONObject();
entryUpdate.put("entry", body);

@@ -105,7 +105,7 @@ void testUpdate() {
void testAtomicOperation() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

@@ -145,7 +145,7 @@ void testEntryDelete() {
void testEntryVersionName() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

@@ -187,7 +187,7 @@ void testEntryDetailOfAllVersion() {
void testEntryDeleteVersionName() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

@@ -229,7 +229,7 @@ void testEntryGetReference() {
void testEntryLocalise() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

@@ -303,7 +303,7 @@ void testEntryImportExisting() {
void testEntryPublish() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

@@ -326,7 +326,7 @@ void testEntryPublish() {
void testEntryPublishWithReference() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);
Request request = entry.publishWithReference(entryBody).request();
@@ -347,7 +347,7 @@ void testEntryPublishWithReference() {
void testPublishWithReference() {
JSONObject body = new JSONObject();
body.put("title", "The Create an entry call creates a new entry for the selected content type for testing");
body.put("url", "www.ishaileshmishra.in/stack/content_type/entry/fakeuid/code");
body.put("url", "www.***REMOVED***.in/stack/content_type/entry/fakeuid/code");
JSONObject entryBody = new JSONObject();
entryBody.put("entry", body);

2 changes: 1 addition & 1 deletion src/test/resources/entry.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"tags": [
"abdn",
"shailesh",
"ishaileshmishra",
"***REMOVED***",
"nature",
"loves"
],
2 changes: 1 addition & 1 deletion src/test/resources/mockstack/setting.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"sys_rte_allowed_tags":"style, figure, script"
},
"rte":{
"ishaileshmishra":true
"***REMOVED***":true
}
}
}
4 changes: 2 additions & 2 deletions src/test/resources/mockstack/share_stack.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"emails": [
"ishaileshmishra@contentstack.com"
"***REMOVED***@contentstack.com"
],
"roles": {
"manager@example.com": [
"ishaileshmishra8176367267626"
"***REMOVED***8176367267626"
]
}
}
2 changes: 1 addition & 1 deletion src/test/resources/mockstack/unshare.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"email": "ishaileshmishra@manager.com"
"email": "***REMOVED***@manager.com"
}