Search in sources :

Example 6 with ModelsListEmpty

use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.

the class UsersSupport method assertEquals.

public void assertEquals(UserEntity expected, UserModelInterface actual) {
    assertEquals(actual, expected);
    Assert.assertEquals(new ModelsListEmpty(), actual.getSubjects());
}
Also used : ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty)

Example 7 with ModelsListEmpty

use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.

the class UsersSupport method getModelMock.

private UserModelInterface getModelMock(Integer id, String firstName, String lastName, String surname, String email, String password, Boolean isAdmin, Integer state) {
    final UserModelInterface userModel = Mockito.mock(UserModelInterface.class);
    Mockito.when(userModel.getId()).thenReturn(id);
    Mockito.when(userModel.getFirstName()).thenReturn(firstName);
    Mockito.when(userModel.getLastName()).thenReturn(lastName);
    Mockito.when(userModel.getSurname()).thenReturn(surname);
    Mockito.when(userModel.getEmail()).thenReturn(email);
    Mockito.when(userModel.getPassword()).thenReturn(password);
    Mockito.when(userModel.getIsAdmin()).thenReturn(isAdmin);
    Mockito.when(userModel.getState()).thenReturn(state);
    Mockito.when(userModel.getSubjects()).thenReturn(new ModelsListEmpty());
    return userModel;
}
Also used : UserModelInterface(easytests.core.models.UserModelInterface) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty)

Example 8 with ModelsListEmpty

use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.

the class QuestionsServiceTest method createQuestionModel.

private QuestionModelInterface createQuestionModel(Integer id, String text, Integer questionTypeId, Integer topicId) {
    final QuestionModelInterface questionModel = new QuestionModel();
    questionModel.setId(id);
    questionModel.setText(text);
    questionModel.setQuestionType(new QuestionTypeModelEmpty(questionTypeId));
    questionModel.setAnswers(new ModelsListEmpty());
    questionModel.setTopic(new TopicModelEmpty(topicId));
    return questionModel;
}
Also used : TopicModelEmpty(easytests.core.models.empty.TopicModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) QuestionTypeModelEmpty(easytests.core.models.empty.QuestionTypeModelEmpty)

Example 9 with ModelsListEmpty

use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.

the class SubjectsServiceTest method testSaveModel.

@Test
public void testSaveModel() throws Exception {
    final SubjectModelInterface subjectModel = new SubjectModel();
    subjectModel.setName("test111");
    subjectModel.setTopics(new ModelsListEmpty());
    subjectModel.setIssueStandard(new IssueStandardModelEmpty());
    subjectModel.setUser(new UserModelEmpty(1));
    subjectModel.setIssues(new ModelsListEmpty());
    this.subjectsService.save(subjectModel);
    final SubjectModelInterface foundedSubjectModel = this.subjectsService.find(subjectModel.getId());
    Assert.assertEquals(subjectModel, foundedSubjectModel);
}
Also used : ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty) UserModelEmpty(easytests.core.models.empty.UserModelEmpty) IssueStandardModelEmpty(easytests.core.models.empty.IssueStandardModelEmpty) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 10 with ModelsListEmpty

use of easytests.core.models.empty.ModelsListEmpty in project easy-tests by malinink.

the class IssueModel method map.

public void map(IssueEntity issueEntity) {
    this.setId(issueEntity.getId());
    this.setName(issueEntity.getName());
    this.setSubject(new SubjectModelEmpty(issueEntity.getSubjectId()));
    this.setQuizzes(new ModelsListEmpty());
}
Also used : SubjectModelEmpty(easytests.core.models.empty.SubjectModelEmpty) ModelsListEmpty(easytests.core.models.empty.ModelsListEmpty)

Aggregations

ModelsListEmpty (easytests.core.models.empty.ModelsListEmpty)36 Test (org.junit.Test)13 SubjectModelEmpty (easytests.core.models.empty.SubjectModelEmpty)11 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)8 IssueStandardModelEmpty (easytests.core.models.empty.IssueStandardModelEmpty)7 UserModelEmpty (easytests.core.models.empty.UserModelEmpty)7 QuestionTypeModelEmpty (easytests.core.models.empty.QuestionTypeModelEmpty)5 TopicModelEmpty (easytests.core.models.empty.TopicModelEmpty)5 IssueStandardModelInterface (easytests.core.models.IssueStandardModelInterface)4 SubjectModelInterface (easytests.core.models.SubjectModelInterface)4 IssueModelEmpty (easytests.core.models.empty.IssueModelEmpty)3 QuestionModelEmpty (easytests.core.models.empty.QuestionModelEmpty)3 QuizModelEmpty (easytests.core.models.empty.QuizModelEmpty)3 TesteeModelEmpty (easytests.core.models.empty.TesteeModelEmpty)3 IssueStandardQuestionTypeOptionModelInterface (easytests.core.models.IssueStandardQuestionTypeOptionModelInterface)2 IssueStandardTopicPriorityModelInterface (easytests.core.models.IssueStandardTopicPriorityModelInterface)2 IssueStandardQuestionTypeOptionsServiceInterface (easytests.core.services.IssueStandardQuestionTypeOptionsServiceInterface)2 IssueStandardTopicPrioritiesServiceInterface (easytests.core.services.IssueStandardTopicPrioritiesServiceInterface)2 SubjectsServiceInterface (easytests.core.services.SubjectsServiceInterface)2 ArrayList (java.util.ArrayList)2