Fixed some deprecated calls in JUnit tests