Skip to content

Tcibisov tests#6

Open
Corsay wants to merge 1 commit into
48x:masterfrom
Corsay:Hometask
Open

Tcibisov tests#6
Corsay wants to merge 1 commit into
48x:masterfrom
Corsay:Hometask

Conversation

@Corsay
Copy link
Copy Markdown

@Corsay Corsay commented May 18, 2018

Created by Dmitriy Tcibisov

@Corsay Corsay changed the title added tests to methods group.getInfo group.getUserGroupsV2 users.getInfoBy Tcibisov tests May 18, 2018
Copy link
Copy Markdown
Owner

@48x 48x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Есть несколько похожих ошибок во многих тестах. В остальном всё хорошо

try {
LOGGER.info("Вызовем метод в сессии пользователя");
bindDefaultUserSession();
LOGGER.info("Вызовем метод с некорректным uids");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Авторизацию лучше вытащить из try-catch. По возможности в этом блоке надо распологать только код, при выполнении которого ожидается ошибка. Логирование тоже можно вынести, но допускается и в try-catch

LOGGER.info("Вызовем метод в сессии пользователя");
bindDefaultUserSession();

Integer count = COUNT_INCORRECT;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно и не вводить новую переменную count, а использовать COUNT_INCORRECT


LOGGER.info("Проверим, что в ответе есть группы");
List<UserGroupBean> userGroupBean = groupGetUserGroupsV2Response.getGroups();
Assert.assertNotNull("Получили null вместо списка групп", userGroupBean);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CollectionUtils.isEmpty() уже проверяет коллекцию на null, так что эта проверка лишняя

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants