test refactored in order to make it more stable
tests refactored in order not to use deprecated methods