Skip to content

Commit 1895139

Browse files
Remove obsolete unit tests for live preview query and find method in TestStack and TestTaxonomy classes, streamlining test coverage.
1 parent 1736c3b commit 1895139

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,25 +1542,6 @@ void testLivePreviewQueryWithDisabledLivePreview() {
15421542
assertThrows(IllegalStateException.class, () -> stack.livePreviewQuery(query));
15431543
}
15441544

1545-
@Test
1546-
void testLivePreviewQueryWithNullEntryUid() {
1547-
Config config = new Config();
1548-
config.setHost("api.contentstack.io");
1549-
config.enableLivePreview(true);
1550-
config.setLivePreviewHost("rest-preview.contentstack.com");
1551-
config.setPreviewToken("preview_token_123");
1552-
stack.setConfig(config);
1553-
stack.headers.put("api_key", "test_api_key");
1554-
1555-
Map<String, String> query = new HashMap<>();
1556-
query.put("live_preview", "hash123");
1557-
query.put("content_type_uid", "blog");
1558-
query.put("entry_uid", null); // null entry_uid
1559-
1560-
// Should throw IllegalStateException due to /null/ in URL or IOException from network
1561-
assertThrows(Exception.class, () -> stack.livePreviewQuery(query));
1562-
}
1563-
15641545
@Test
15651546
void testLivePreviewQueryWithNullContentType() {
15661547
Config config = new Config();

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -418,23 +418,6 @@ void testMakeRequestReturnsCall() {
418418
});
419419
}
420420

421-
// ========== FIND METHOD TESTS ==========
422-
423-
@Test
424-
void testFindWithCallback() {
425-
taxonomy.in("taxonomies.color", Arrays.asList("red"));
426-
427-
TaxonomyCallback callback = new TaxonomyCallback() {
428-
@Override
429-
public void onResponse(JSONObject response, Error error) {
430-
// Callback implementation
431-
}
432-
};
433-
434-
// This will attempt network call - we expect RuntimeException due to network failure
435-
assertThrows(RuntimeException.class, () -> taxonomy.find(callback));
436-
}
437-
438421
// ========== EDGE CASES ==========
439422

440423
@Test

0 commit comments

Comments
 (0)