Authored by chenchao

add unit test

  1 +package com.yohoufo.order.service;
  2 +
  3 +import com.yohoufo.order.BaseTest;
  4 +import org.junit.Test;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +
  8 +/**
  9 + * Created by chao.chen on 2019/1/22.
  10 + */
  11 +public class RuntimeExceptionTest extends BaseTest{
  12 + private Logger logger = LoggerFactory.getLogger(getClass());
  13 +
  14 + @Test
  15 + public void testPrintStack(){
  16 + try{
  17 + throw new RuntimeException("test RuntimeException");
  18 + }catch (Exception ex){
  19 + logger.warn("in testPrintStack occur error", ex);
  20 + }
  21 + doAfterOccurError();
  22 + }
  23 +
  24 + private void doAfterOccurError(){
  25 + System.out.println("always i thought code can reach here");
  26 + }
  27 +}