package com.pingan.stock.oas.app.openacc.action; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import com.alibaba.fastjson.JSON; import com.pingan.pafa.papp.test.BaseSARTest; import com.pingan.pafa.papp.test.SARContextConfiguration; import com.pingan.stock.oas.admin.core.action.OasVideoHangupReasonCfgAction; import com.pingan.stock.oas.common.web.form.OASVideoHangupReasonCfgForm; import com.pingan.stock.oas.common.web.vo.RemVO; @SARContextConfiguration(sarList = "oas_admin_core", protocols = "jetty") //這個開發框架輸入@會自動帶出後面的類和參數說明 public class OasVideoHangupReasonCfgActionTest extends BaseSARTest{ @Autowired //這個是加的註解,手動輸入的 private OasVideoHangupReasonCfgAction cfgAction; @Test //這個也能夠手動輸入 public void test_add(){ OASVideoHangupReasonCfgForm cfgForm = new OASVideoHangupReasonCfgForm(); cfgForm.setName_zh("aaaaaaaaaaaaa"); cfgForm.setDisplay_name("aaaaaaaa"); cfgForm.setChannel_id("ydkh"); try { RemVO remVO = cfgAction.addHangupReasonCfg(cfgForm); String str = JSON.toJSONString(remVO); System.err.println(str); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Test public void test_update(){ OASVideoHangupReasonCfgForm cfgForm = new OASVideoHangupReasonCfgForm(); cfgForm.setName_zh("bbbbbbbbbbbbbbbbbbbb"); cfgForm.setDisplay_name("bbbbb"); cfgForm.setChannel_id("ydkh"); cfgForm.setId("8A2AD090DB504D0AE0537AAF190AE576"); try { RemVO remVO = cfgAction.updateHangupReasonCfg(cfgForm); String str = JSON.toJSONString(remVO); System.err.println(str); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Test public void test_delete(){ String idStr = "8A2AD090DB504D0AE0537AAF190AE576"; try { RemVO remVO = cfgAction.deleteHangupReasonCfg(idStr); String str = JSON.toJSONString(remVO); System.err.println(str); } catch (Exception e) { e.printStackTrace(); } } @Test public void test_query(){ OASVideoHangupReasonCfgForm cfgForm = new OASVideoHangupReasonCfgForm(); cfgForm.setName_zh("客戶端掛斷"); // cfgForm.setDisplay_name("bbbbb"); // cfgForm.setChannel_id("ydkh"); // cfgForm.setId("8A2AD090DB504D0AE0537AAF190AE576"); try { RemVO remVO = cfgAction.queryHangupReasonCfg(cfgForm); String str = JSON.toJSONString(remVO); System.err.println(str); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }