From 52391dde92b01a89072d8442ab0f9826c09bd829 Mon Sep 17 00:00:00 2001 From: jez04 <david.jezek@post.cz> Date: Tue, 12 Nov 2024 14:31:55 +0100 Subject: [PATCH] fix: test --- src/test/java/jez04/structure/test/ClassStructureTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/jez04/structure/test/ClassStructureTest.java b/src/test/java/jez04/structure/test/ClassStructureTest.java index 241d7af..19d3dde 100644 --- a/src/test/java/jez04/structure/test/ClassStructureTest.java +++ b/src/test/java/jez04/structure/test/ClassStructureTest.java @@ -56,7 +56,7 @@ class ClassStructureTest { .size() > 1); } - void loadScoresFromStreamExceptionTest() throws ScoreNotLoaded, IllegalAccessException, InvocationTargetException, NoSuchMethodException, SecurityException { + void loadScoresFromStreamExceptionTest() throws Exception, IllegalAccessException, InvocationTargetException, NoSuchMethodException, SecurityException { App app = new App(); try { app.loadScoresFromStream(new InputStreamReader(App.class.getResourceAsStream("/bestScores-err.csv"))) @@ -64,8 +64,7 @@ class ClassStructureTest { fail("Exception not throwen!"); } catch (Exception e) { assertEquals(ScoreNotLoaded.class, e.getClass(), "Excpectin exception of type ScoreNotLoaded"); - ScoreNotLoaded ex = (ScoreNotLoaded) e; - int count = (int)ScoreNotLoaded.class.getDeclaredMethod("getCount").invoke(ex); + int count = (int)ScoreNotLoaded.class.getDeclaredMethod("getCount").invoke(e); assertTrue(count > 0, "Info about already parsed line missing"); } } -- GitLab