Skip to content

Commit 36c0d92

Browse files
committed
test failure condition
1 parent 7534c28 commit 36c0d92

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

curator-x-async/src/test/java/org/apache/curator/x/async/modeled/TestCachedModeledFramework.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,22 @@ public void initialized() {
268268
}
269269
}
270270

271+
@Test
272+
void testReadThroughFailure() throws InterruptedException, TimeoutException, ExecutionException {
273+
try (CachedModeledFramework<TestModel> client =
274+
ModeledFramework.wrap(async, modelSpec).cached()) {
275+
client.start();
276+
assertNull(timing.getFuture(client.delete().toCompletableFuture()));
277+
complete(client.readThrough(), (d, e) -> {
278+
if (e == null) {
279+
fail("This test should result in a NoNodeException");
280+
} else {
281+
assertEquals(KeeperException.NoNodeException.class, e.getClass());
282+
}
283+
});
284+
}
285+
}
286+
271287
private <T> void verifyEmptyNodeDeserialization(T model, ModelSpec<T> parentModelSpec) {
272288
// The sub-path is the ZNode that will be removed that does not contain any model data. Their should be no
273289
// attempt to deserialize this empty ZNode.

0 commit comments

Comments
 (0)