Skip to content

Commit 6567ff4

Browse files
committed
Add SLF4J dependency and update JavaDoc links; comment out disabled tests in TestLivePreview and TestStack
1 parent 10f0bd2 commit 6567ff4

File tree

3 files changed

+69
-64
lines changed

3 files changed

+69
-64
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@
196196
<artifactId>okhttp</artifactId>
197197
<version>4.12.0</version>
198198
</dependency>
199+
<dependency>
200+
<groupId>org.slf4j</groupId>
201+
<artifactId>slf4j-simple</artifactId>
202+
<version>1.7.36</version>
203+
</dependency>
199204

200205
</dependencies>
201206

@@ -245,7 +250,7 @@
245250
<use>false</use>
246251
<source>1.8</source>
247252
<links>
248-
<link>https://docs.oracle.com/javase/23/docs/api/</link>
253+
<link>https://docs.oracle.com/en/java/javase/23/docs/api/index.html</link>
249254
</links>
250255
<doclint>none</doclint>
251256
</configuration>

src/test/java/com/contentstack/sdk/TestLivePreview.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,17 @@ void testStackEnableLivePreviewEntry() throws Exception {
9898
Assertions.assertNotNull(entryInstance);
9999
}
100100

101-
@Test()
102-
@Disabled("No validation required: improved test")
103-
void testEnableLivePreviewWithoutRequiredParameters() {
104-
Config livePreviewEnablerConfig = new Config().enableLivePreview(true);
105-
try {
106-
Contentstack.stack("liveAPIKey", "liveAccessToken", "liveEnv", livePreviewEnablerConfig);
107-
} catch (Exception e) {
108-
Assertions.assertEquals("managementToken is required", e.getLocalizedMessage());
109-
logger.severe(e.getLocalizedMessage());
110-
}
111-
}
101+
// @Test()
102+
// @Disabled("No validation required: improved test")
103+
// void testEnableLivePreviewWithoutRequiredParameters() {
104+
// Config livePreviewEnablerConfig = new Config().enableLivePreview(true);
105+
// try {
106+
// Contentstack.stack("liveAPIKey", "liveAccessToken", "liveEnv", livePreviewEnablerConfig);
107+
// } catch (Exception e) {
108+
// Assertions.assertEquals("managementToken is required", e.getLocalizedMessage());
109+
// logger.severe(e.getLocalizedMessage());
110+
// }
111+
// }
112112

113113
@Test()
114114
void testExceptionWhenAllRequiredParamsNotProvided() {
@@ -137,19 +137,19 @@ void testMissingHostToEnableLivePreview() {
137137
}
138138
}
139139

140-
@Test()
141-
@Disabled("No validation required")
142-
void testCompleteLivePreview() throws Exception {
143-
Config livePreviewEnablerConfig = new Config().enableLivePreview(true)
144-
.setLivePreviewHost("live-preview.contentstack.io").setManagementToken("management_token_123456");
145-
Stack stack = Contentstack.stack("liveAPIKey", "liveAccessToken", "liveEnv", livePreviewEnablerConfig);
146-
HashMap<String, String> hashMap = new HashMap<>();
147-
hashMap.put("content_type_uid", "content_type_uid");
148-
stack.livePreviewQuery(hashMap);
149-
Entry entry = stack.contentType("content_type_uid").entry("entry_uid");
150-
entry.fetch(null);
151-
Assertions.assertNotNull(entry);
152-
}
140+
// @Test()
141+
// @Disabled("No validation required")
142+
// void testCompleteLivePreview() throws Exception {
143+
// Config livePreviewEnablerConfig = new Config().enableLivePreview(true)
144+
// .setLivePreviewHost("live-preview.contentstack.io").setManagementToken("management_token_123456");
145+
// Stack stack = Contentstack.stack("liveAPIKey", "liveAccessToken", "liveEnv", livePreviewEnablerConfig);
146+
// HashMap<String, String> hashMap = new HashMap<>();
147+
// hashMap.put("content_type_uid", "content_type_uid");
148+
// stack.livePreviewQuery(hashMap);
149+
// Entry entry = stack.contentType("content_type_uid").entry("entry_uid");
150+
// entry.fetch(null);
151+
// Assertions.assertNotNull(entry);
152+
// }
153153

154154
@Test()
155155
void testCompleteLivePreviewInQuery() throws Exception {

src/test/java/com/contentstack/sdk/TestStack.java

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -347,45 +347,45 @@ void testConfigGetHost() {
347347
assertEquals(config.host, config.getHost());
348348
}
349349

350-
@Test
351-
@Disabled("No relevant code")
352-
@Order(41)
353-
void testSynchronizationAPIRequest() throws IllegalAccessException {
354-
355-
stack.sync(new SyncResultCallBack() {
356-
@Override
357-
public void onCompletion(SyncStack response, Error error) {
358-
paginationToken = response.getPaginationToken();
359-
Assertions.assertNull(response.getUrl());
360-
Assertions.assertNotNull(response.getJSONResponse());
361-
Assertions.assertEquals(129, response.getCount());
362-
Assertions.assertEquals(100, response.getLimit());
363-
Assertions.assertEquals(0, response.getSkip());
364-
Assertions.assertNotNull(response.getPaginationToken());
365-
Assertions.assertNull(response.getSyncToken());
366-
Assertions.assertEquals(100, response.getItems().size());
367-
}
368-
});
369-
}
370-
371-
@Test
372-
@Disabled("No relevant code")
373-
@Order(42)
374-
void testSyncPaginationToken() throws IllegalAccessException {
375-
stack.syncPaginationToken(paginationToken, new SyncResultCallBack() {
376-
@Override
377-
public void onCompletion(SyncStack response, Error error) {
378-
Assertions.assertNull(response.getUrl());
379-
Assertions.assertNotNull(response.getJSONResponse());
380-
Assertions.assertEquals(29, response.getCount());
381-
Assertions.assertEquals(100, response.getLimit());
382-
Assertions.assertEquals(100, response.getSkip());
383-
Assertions.assertNull(response.getPaginationToken());
384-
Assertions.assertNotNull(response.getSyncToken());
385-
Assertions.assertEquals(29, response.getItems().size());
386-
}
387-
});
388-
}
350+
// @Test
351+
// @Disabled("No relevant code")
352+
// @Order(41)
353+
// void testSynchronizationAPIRequest() throws IllegalAccessException {
354+
355+
// stack.sync(new SyncResultCallBack() {
356+
// @Override
357+
// public void onCompletion(SyncStack response, Error error) {
358+
// paginationToken = response.getPaginationToken();
359+
// Assertions.assertNull(response.getUrl());
360+
// Assertions.assertNotNull(response.getJSONResponse());
361+
// Assertions.assertEquals(129, response.getCount());
362+
// Assertions.assertEquals(100, response.getLimit());
363+
// Assertions.assertEquals(0, response.getSkip());
364+
// Assertions.assertNotNull(response.getPaginationToken());
365+
// Assertions.assertNull(response.getSyncToken());
366+
// Assertions.assertEquals(100, response.getItems().size());
367+
// }
368+
// });
369+
// }
370+
371+
// @Test
372+
// @Disabled("No relevant code")
373+
// @Order(42)
374+
// void testSyncPaginationToken() throws IllegalAccessException {
375+
// stack.syncPaginationToken(paginationToken, new SyncResultCallBack() {
376+
// @Override
377+
// public void onCompletion(SyncStack response, Error error) {
378+
// Assertions.assertNull(response.getUrl());
379+
// Assertions.assertNotNull(response.getJSONResponse());
380+
// Assertions.assertEquals(29, response.getCount());
381+
// Assertions.assertEquals(100, response.getLimit());
382+
// Assertions.assertEquals(100, response.getSkip());
383+
// Assertions.assertNull(response.getPaginationToken());
384+
// Assertions.assertNotNull(response.getSyncToken());
385+
// Assertions.assertEquals(29, response.getItems().size());
386+
// }
387+
// });
388+
// }
389389
@Test
390390
@Order(43)
391391
void testAsseturlupdate() throws IllegalAccessException {

0 commit comments

Comments
 (0)