/mybatis-practice/src/test/java/com/doctor/manager/impl/AuthorManagerImplTest.java
Java | 45 lines | 35 code | 10 blank | 0 comment | 0 complexity | 3c00e53ddaacdb7e6eb608817372c031 MD5 | raw file
- package com.doctor.manager.impl;
- import static org.junit.Assert.*;
- import org.junit.Test;
- import org.junit.runner.RunWith;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Qualifier;
- import org.springframework.test.context.ContextConfiguration;
- import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
- import com.alibaba.fastjson.JSON;
- import com.doctor.entity.Author;
- import com.doctor.enums.FavouriteSection;
- import com.doctor.manager.AuthorManager;
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration(value = { "classpath:mybatisPracticeConfig/spring-context.xml" })
- public class AuthorManagerImplTest {
- @Autowired
- @Qualifier("authorManager")
- private AuthorManager authorManager;
-
- @Test
- public void testInsertAuthor() {
- Author author = new Author(null,"doctor","12367890","doctor@doctor.com","bio",FavouriteSection.VIDEOS);
- boolean b = authorManager.insertAuthor(author);
- assertTrue(b);
- assertNotNull(author.getId());
- }
- @Test
- public void testQueryById() {
- Author author = authorManager.queryById(10000L);
- System.out.println(JSON.toJSONString(author));
- }
- @Test
- public void testDeleteAuthorById() {
- fail("Not yet implemented");
- }
- }