use of com.vip.saturn.job.SaturnJobReturn in project Saturn by vipshop.
the class JsonParseObjectTest method test_H_blank.
/**
* 没有内容
*/
@Test
public void test_H_blank() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnBlank");
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNull();
}
use of com.vip.saturn.job.SaturnJobReturn in project Saturn by vipshop.
the class JsonParseObjectTest method test_I_trim.
@Test
public void test_I_trim() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnTrim");
SaturnJobReturn expect = new SaturnJobReturn(500, "hello world", 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.SaturnJobReturn in project Saturn by vipshop.
the class JsonParseObjectTest method test_B_overFields.
@Test
public void test_B_overFields() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnMoreFields");
SaturnJobReturn expect = new SaturnJobReturn(500, "hello world", 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.SaturnJobReturn in project Saturn by vipshop.
the class JsonParseObjectTest method test_C_lessFieldErrorGroup.
/**
* 少errorGroup,默认为200
*/
@Test
public void test_C_lessFieldErrorGroup() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnLessFieldErrorGroup");
SaturnJobReturn expect = new SaturnJobReturn(500, "hello world", 200);
HashMap<String, String> prop = new HashMap();
prop.put("key", "value");
expect.setProp(prop);
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
use of com.vip.saturn.job.SaturnJobReturn in project Saturn by vipshop.
the class JsonParseObjectTest method test_G_NoFields.
/**
* 少全部字段,只有{}
*/
@Test
public void test_G_NoFields() throws Exception {
LogbackListAppender logbackListAppender = new LogbackListAppender();
logbackListAppender.addToLogger(ScriptJobRunner.class);
logbackListAppender.start();
SaturnJobReturn saturnJobReturn = readSaturnJobReturn("/SaturnJobReturnNoFields");
SaturnJobReturn expect = new SaturnJobReturn();
assertThat(logbackListAppender.getLastMessage()).isNull();
assertThat(saturnJobReturn).isNotNull().isEqualToComparingFieldByField(expect);
}
Aggregations