import static org.junit.jupiter.api.Assertions.assertTrue; import java.lang.reflect.Method; import org.junit.Before; import org.junit.Test; public class TombsugTest { Tombsug tombsug; @Before public void setUp() { this.tombsug = new Tombsug(); } @Test public void testInput() { boolean ok = false; try { Method inputMethod = Tombsug.class.getMethod("input", String.class); if("java.lang.String".equals(inputMethod.getReturnType().getName())) { ok = true; } } catch (NoSuchMethodException e) { System.out.println("Hiba! Nincs ilyen metódus!"); } assertTrue(ok, "Hiba! Nem létezik a input(String msg) metódus!"); } }