Skip to content

Commit e1214b9

Browse files
reeshika-hreeshika-h
andauthored
Merging :"Fix: Constructor in Java class files now include missing headers" (#53)
* passed headers * added: changes in setup of testcases * added the new version in the logs * added: taxonomyAPI testcases along with mocktaxonomy folder * v1.3.3 bump * added: APISanitytest file ,generating test reports * Revert "added: APISanitytest file ,generating test reports" --------- Co-authored-by: reeshika-h <reeshika.hosman@contentstack.com>
1 parent 1505c18 commit e1214b9

32 files changed

+496
-101
lines changed

changelog.md

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

3+
## v1.3.3
4+
-Fix:
5+
- Constructor in Java class files now include missing headers
6+
### Apr 09, 2024
7+
38
## v1.3.2
49

510
### March 28, 2024

src/main/java/com/contentstack/cms/stack/Alias.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ public class Alias implements BaseImplementation<Alias> {
3535
// also creates an
3636
// instance of the `AliasService` interface using the provided `Retrofit`
3737
// instance.
38-
protected Alias(Retrofit instance) {
38+
protected Alias(Retrofit instance,Map<String, Object> headers) {
3939
this.headers = new HashMap<>();
40+
this.headers.putAll(headers);
4041
this.headers.put("Content-Type", "application/json");
4142
params = new HashMap<>();
4243
this.service = instance.create(AliasService.class);
@@ -45,8 +46,9 @@ protected Alias(Retrofit instance) {
4546
// The `protected Alias(Retrofit instance, String aliasUid)` constructor is used
4647
// to create an
4748
// instance of the `Alias` class with a specific alias UID.
48-
protected Alias(Retrofit instance, String aliasUid) {
49+
protected Alias(Retrofit instance,Map<String, Object> headers, String aliasUid) {
4950
this.headers = new HashMap<>();
51+
this.headers.putAll(headers);
5052
this.headers.put("Content-Type", "application/json");
5153
params = new HashMap<>();
5254
this.uid = aliasUid;

src/main/java/com/contentstack/cms/stack/Asset.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ protected void clearParams() {
117117
* @return Folder
118118
*/
119119
public Folder folder() {
120-
return new Folder(this.instance);
120+
return new Folder(this.instance,this.headers);
121121
}
122122

123123
/**
@@ -127,7 +127,7 @@ public Folder folder() {
127127
* @return Folder
128128
*/
129129
public Folder folder(@NotNull String folderUid) {
130-
return new Folder(this.instance, folderUid);
130+
return new Folder(this.instance,this.headers, folderUid);
131131
}
132132

133133
/**

src/main/java/com/contentstack/cms/stack/AuditLog.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import retrofit2.Retrofit;
88

99
import java.util.HashMap;
10+
import java.util.Map;
1011
import java.util.Objects;
1112

1213
/**
@@ -37,14 +38,16 @@ public class AuditLog implements BaseImplementation<AuditLog> {
3738
protected HashMap<String, Object> params;
3839
private String logItemUid;
3940

40-
protected AuditLog(Retrofit retrofit) {
41+
protected AuditLog(Retrofit retrofit,Map<String, Object> headers) {
4142
this.headers = new HashMap<>();
43+
this.headers.putAll(headers);
4244
this.params = new HashMap<>();
4345
this.service = retrofit.create(AuditLogService.class);
4446
}
4547

46-
protected AuditLog(Retrofit retrofit, String uid) {
48+
protected AuditLog(Retrofit retrofit,Map<String, Object> headers, String uid) {
4749
this.headers = new HashMap<>();
50+
this.headers.putAll(headers);
4851
this.params = new HashMap<>();
4952
this.logItemUid = uid;
5053
this.service = retrofit.create(AuditLogService.class);

src/main/java/com/contentstack/cms/stack/Branch.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ public class Branch implements BaseImplementation<Branch> {
3434
private Retrofit instance;
3535
private String baseBranchId;
3636

37-
protected Branch(Retrofit instance) {
37+
protected Branch(Retrofit instance,Map<String, Object> headers) {
3838
this.headers = new HashMap<>();
39+
this.headers.putAll(headers);
3940
this.headers.put("Content-Type", "application/json");
4041
this.params = new HashMap<>();
4142
this.service = instance.create(BranchService.class);
4243
}
4344

44-
protected Branch(Retrofit instance, String uid) {
45+
protected Branch(Retrofit instance,Map<String, Object> headers, String uid) {
4546
this.headers = new HashMap<>();
47+
this.headers.putAll(headers);
4648
this.headers.put("Content-Type", "application/json");
4749
this.baseBranchId = uid;
4850
this.params = new HashMap<>();

src/main/java/com/contentstack/cms/stack/BulkOperation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import retrofit2.Retrofit;
99

1010
import java.util.HashMap;
11+
import java.util.Map;
1112

1213
/**
1314
* You can perform bulk operations such as Publish, Unpublished, and Delete on
@@ -48,8 +49,9 @@ public class BulkOperation implements BaseImplementation<BulkOperation> {
4849
*
4950
* @param retrofit the retrofit
5051
*/
51-
protected BulkOperation(Retrofit retrofit) {
52+
protected BulkOperation(Retrofit retrofit,Map<String, Object> headers) {
5253
this.headers = new HashMap<>();
54+
this.headers.putAll(headers);
5355
this.params = new HashMap<>();
5456
this.retrofit = retrofit;
5557
this.service = this.retrofit.create(BulkOperationService.class);

src/main/java/com/contentstack/cms/stack/DeliveryToken.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import retrofit2.Call;
88

99
import java.util.HashMap;
10+
import java.util.Map;
1011
import java.util.Objects;
1112

1213
/**
@@ -31,14 +32,16 @@ public class DeliveryToken implements BaseImplementation<DeliveryToken> {
3132
private String tokenUid;
3233
String ERROR = "Token UID Can Not Be Null OR Empty";
3334

34-
protected DeliveryToken(TokenService service) {
35+
protected DeliveryToken(TokenService service, Map<String, Object> headers) {
3536
this.headers = new HashMap<>();
37+
this.headers.putAll(headers);
3638
this.params = new HashMap<>();
3739
this.service = service;
3840
}
3941

40-
protected DeliveryToken(TokenService service, @NotNull String tokenUid) {
42+
protected DeliveryToken(TokenService service, Map<String, Object> headers, @NotNull String tokenUid) {
4143
this.headers = new HashMap<>();
44+
this.headers.putAll(headers);
4245
this.params = new HashMap<>();
4346
this.tokenUid = tokenUid;
4447
this.service = service;

src/main/java/com/contentstack/cms/stack/Environment.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ public class Environment implements BaseImplementation<Environment> {
2727
protected final EnvironmentService service;
2828
protected String environment;
2929

30-
protected Environment(Retrofit instance) {
30+
protected Environment(Retrofit instance, Map<String, Object> headers) {
3131
this.headers = new HashMap<>();
32+
this.headers.putAll(headers);
3233
this.params = new HashMap<>();
3334
this.service = instance.create(EnvironmentService.class);
3435
}
3536

36-
protected Environment(Retrofit instance, String environment) {
37+
protected Environment(Retrofit instance, Map<String, Object> headers, String environment) {
3738
this.environment = environment;
3839
this.headers = new HashMap<>();
40+
this.headers.putAll(headers);
3941
this.params = new HashMap<>();
4042
this.service = instance.create(EnvironmentService.class);
4143
}

src/main/java/com/contentstack/cms/stack/Extensions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ public class Extensions implements BaseImplementation<Extensions> {
3636
protected HashMap<String, Object> params;
3737
protected String customFieldUid;
3838

39-
protected Extensions(Retrofit retrofit) {
39+
protected Extensions(Retrofit retrofit,Map<String, Object> headers) {
4040
this.headers = new HashMap<>();
41+
this.headers.putAll(headers);
4142
this.params = new HashMap<>();
4243
this.service = retrofit.create(ExtensionsService.class);
4344
}
4445

45-
protected Extensions(Retrofit retrofit, String fieldUid) {
46+
protected Extensions(Retrofit retrofit,Map<String, Object> headers, String fieldUid) {
4647
this.headers = new HashMap<>();
48+
this.headers.putAll(headers);
4749
this.params = new HashMap<>();
4850
this.customFieldUid = fieldUid;
4951
this.service = retrofit.create(ExtensionsService.class);

src/main/java/com/contentstack/cms/stack/Folder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ public class Folder implements BaseImplementation<Folder> {
1818
protected final AssetService service;
1919
private String folderUid;
2020

21-
protected Folder(Retrofit instance) {
21+
protected Folder(Retrofit instance,Map<String, Object> headers) {
2222
this.headers = new HashMap<>();
23+
this.headers.putAll(headers);
2324
params = new HashMap<>();
2425
this.service = instance.create(AssetService.class);
2526
}
2627

27-
protected Folder(Retrofit instance, String folderUid) {
28+
protected Folder(Retrofit instance,Map<String, Object> headers, String folderUid) {
2829
this.headers = new HashMap<>();
30+
this.headers.putAll(headers);
2931
params = new HashMap<>();
3032
this.folderUid = folderUid;
3133
this.service = instance.create(AssetService.class);

0 commit comments

Comments
 (0)