|
15 | 15 | import static org.eclipse.biscuit.token.builder.Utils.var; |
16 | 16 | import static org.junit.jupiter.api.Assertions.assertEquals; |
17 | 17 | import static org.junit.jupiter.api.Assertions.assertThrows; |
18 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
19 | 18 | import static org.junit.jupiter.api.Assertions.fail; |
20 | 19 |
|
21 | 20 | import biscuit.format.schema.Schema; |
22 | | -import io.vavr.control.Try; |
23 | 21 | import java.security.InvalidKeyException; |
24 | 22 | import java.security.NoSuchAlgorithmException; |
25 | 23 | import java.security.SecureRandom; |
|
38 | 36 | import org.eclipse.biscuit.error.FailedCheck; |
39 | 37 | import org.eclipse.biscuit.error.LogicError; |
40 | 38 | import org.eclipse.biscuit.token.builder.Block; |
| 39 | +import org.junit.jupiter.api.Assertions; |
41 | 40 | import org.junit.jupiter.api.Test; |
42 | 41 |
|
43 | 42 | public class BiscuitTest { |
@@ -332,17 +331,15 @@ public void testReset() throws Error { |
332 | 331 | v3.addFact("resource(\"/folder2/file3\")"); |
333 | 332 | v3.addFact("operation(\"read\")"); |
334 | 333 |
|
335 | | - Try<Long> res = Try.of(() -> v3.authorize()); |
| 334 | + Assertions.assertThrows(Error.class, v3::authorize); |
336 | 335 | System.out.println(v3.formatWorld()); |
337 | 336 |
|
338 | | - assertTrue(res.isFailure()); |
339 | | - |
340 | 337 | Authorizer v4 = v1.clone(); |
341 | 338 |
|
342 | 339 | v4.addFact("resource(\"/folder2/file1\")"); |
343 | 340 | v4.addFact("operation(\"write\")"); |
344 | 341 |
|
345 | | - Error e = (Error) Try.of(() -> v4.authorize()).getCause(); |
| 342 | + var e = Assertions.assertThrows(Error.class, v4::authorize); |
346 | 343 |
|
347 | 344 | System.out.println(v4.formatWorld()); |
348 | 345 | for (FailedCheck f : e.getFailedChecks().get()) { |
@@ -402,7 +399,7 @@ public void testEmptyAuthorizer() throws Error { |
402 | 399 | v1.addFact("resource(\"/folder2/file1\")"); |
403 | 400 | v1.addFact("operation(\"write\")"); |
404 | 401 |
|
405 | | - assertTrue(Try.of(() -> v1.authorize()).isFailure()); |
| 402 | + assertThrows(Error.class, v1::authorize); |
406 | 403 | } |
407 | 404 |
|
408 | 405 | @Test |
|
0 commit comments