Substitution of deprecated classes in tests

I performed some modifications to remove all those deprecation warnings that were shown when running tests.