- try {
- mgr.updateStats("bogus", as1.getStatsDetails());
- throw new Exception("Unexpected success");
- } catch (StatsManagerException ex) {
- logger.info("caught expected exception: {}", ex.toString());
- }
- try {
- mgr.deleteStats("bogus", 999);
- throw new Exception("Unexpected success");
- } catch (StatsManagerException ex) {
- logger.info("caught expected exception: {}", ex.toString());
- }
+ Assertions.assertThrows(StatsManagerException.class, () -> {
+ mgr2.updateStats("bogus", as1.getStatsDetails());
+ });
+ Assertions.assertThrows(StatsManagerException.class, () -> {
+ mgr2.deleteStats("bogus", 999);
+ });