Skip to content

Commit bb29d9c

Browse files
author
Behnam Mozafari
committed
Addressed review feedback: mock filesystem calls handler with failed future
1 parent eabb06d commit bb29d9c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/java/com/uid2/core/vertx/TestCoreVerticle.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ void deployVerticle(TestInfo info, Vertx vertx, VertxTestContext testContext) th
126126

127127
when(fileSystem.readFile(anyString(), any())).thenAnswer(invocation -> {
128128
String path = invocation.getArgument(0);
129+
Handler<AsyncResult<Buffer>> handler = invocation.getArgument(1);
129130
if (Objects.equals(path, com.uid2.core.Const.OPERATOR_CONFIG_PATH)) {
130-
Handler<AsyncResult<Buffer>> handler = invocation.getArgument(1);
131131
handler.handle(Future.succeededFuture(Buffer.buffer(operatorConfig)));
132+
} else {
133+
handler.handle(Future.failedFuture(new RuntimeException("Failed to read file: " + path)));
132134
}
133135
return null;
134136
});

0 commit comments

Comments
 (0)