Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

SampleServiceTests.java 본문

SPRING/chapter06_AOP

SampleServiceTests.java

GAWON 2023. 7. 6. 18:37
package org.joonzis.service;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import lombok.Setter;
import lombok.extern.log4j.Log4j;

@Log4j
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("file:src/main/webapp/WEB-INF/spring/root-context.xml")
public class SampleServiceTests {
   
   @Setter(onMethod_ = @Autowired)
   private SampleService service;
   /*
   @Test
   public void testClass() {
      log.info(service);
      log.info(service.getClass().getName());
   }
   */
   @Test
   public void testAdd() throws Exception {
      log.info(service.doAdd("123", "456"));
   }
  /* 
   @Test
   public void testAddError() throws Exception{
	   log.info(service.doAdd("123", "ABC"));
   }
   */
   
   
   
}

'SPRING > chapter06_AOP' 카테고리의 다른 글

chapter06_AOP SPRING  (0) 2023.07.06
chapter06_AOP/pom.xml  (0) 2023.07.06
SampleServiceImpl.java  (0) 2023.07.06
SampleService.java  (0) 2023.07.06
LogAdvice.java  (0) 2023.07.06