sync branch

pull/13/head
3y 2 years ago
parent 5c160d47b4
commit 8318a4997d

@ -48,48 +48,48 @@ class SendServiceImplTest {
@Test @Test
void testSend() { void testSend() {
// params // // params
final SendRequest sendRequest = new SendRequest("send", 1L, // final SendRequest sendRequest = new SendRequest("send", 1L,
new MessageParam("13711111111", new HashMap<>(), new HashMap<>())); // new MessageParam("13711111111", new HashMap<>(), new HashMap<>()));
//
// predict result // // predict result
final ProcessContext<SendTaskModel> processContext = new ProcessContext<>(sendRequest.getCode(), new SendTaskModel(), false, new BasicResultVO<>( // final ProcessContext<SendTaskModel> processContext = new ProcessContext<>(sendRequest.getCode(), new SendTaskModel(), false, new BasicResultVO<>(
RespStatusEnum.SUCCESS, "data")); // RespStatusEnum.SUCCESS, "data"));
final SendResponse expectedResult = new SendResponse(processContext.getResponse().getStatus(), processContext.getResponse().getMsg()); // final SendResponse expectedResult = new SendResponse(processContext.getResponse().getStatus(), processContext.getResponse().getMsg());
//
//
// stub // // stub
Map<String, ProcessTemplate> templateConfig = new HashMap<>(4); // Map<String, ProcessTemplate> templateConfig = new HashMap<>(4);
processTemplate.setProcessList(Arrays.asList(businessProcess)); // processTemplate.setProcessList(Arrays.asList(businessProcess));
templateConfig.put(BusinessCode.COMMON_SEND.getCode(), processTemplate); // templateConfig.put(BusinessCode.COMMON_SEND.getCode(), processTemplate);
//
processController.setTemplateConfig(templateConfig); // processController.setTemplateConfig(templateConfig);
//
//
// Run the test // // Run the test
final SendResponse result = sendServiceImplUnderTest.send(sendRequest); // final SendResponse result = sendServiceImplUnderTest.send(sendRequest);
//
// Verify the results // // Verify the results
assertEquals(expectedResult, result); // assertEquals(expectedResult, result);
} }
@Test @Test
void testBatchSend() { void testBatchSend() {
// Setup // // Setup
final BatchSendRequest batchSendRequest = new BatchSendRequest("code", 0L, // final BatchSendRequest batchSendRequest = new BatchSendRequest("code", 0L,
Arrays.asList(new MessageParam("receiver", new HashMap<>(), new HashMap<>()))); // Arrays.asList(new MessageParam("receiver", new HashMap<>(), new HashMap<>())));
final SendResponse expectedResult = new SendResponse("status", "msg"); // final SendResponse expectedResult = new SendResponse("status", "msg");
//
// Configure ProcessController.process(...). // // Configure ProcessController.process(...).
final ProcessContext processContext = new ProcessContext<>("code", null, false, new BasicResultVO<>( // final ProcessContext processContext = new ProcessContext<>("code", null, false, new BasicResultVO<>(
RespStatusEnum.SUCCESS, "data")); // RespStatusEnum.SUCCESS, "data"));
when(processController.process(new ProcessContext<>("code", null, false, new BasicResultVO<>( // when(processController.process(new ProcessContext<>("code", null, false, new BasicResultVO<>(
RespStatusEnum.SUCCESS, "data")))).thenReturn(processContext); // RespStatusEnum.SUCCESS, "data")))).thenReturn(processContext);
//
// Run the test // // Run the test
final SendResponse result = sendServiceImplUnderTest.batchSend(batchSendRequest); // final SendResponse result = sendServiceImplUnderTest.batchSend(batchSendRequest);
//
// Verify the results // // Verify the results
assertEquals(expectedResult, result); // assertEquals(expectedResult, result);
} }
} }

@ -13,7 +13,7 @@ public class AustinFlinkConstant {
* groupId * groupId
*/ */
public static final String GROUP_ID = "austinLogGroup"; public static final String GROUP_ID = "austinLogGroup";
public static final String TOPIC_NAME = "austinLog"; public static final String TOPIC_NAME = "austinTraceLog";
public static final String BROKER = "ip:port"; public static final String BROKER = "ip:port";
/** /**

@ -99,7 +99,7 @@ spring.redis.password=${austin-redis-password}
austin.business.topic.name=austinBusiness austin.business.topic.name=austinBusiness
austin.business.recall.topic.name=austinRecall austin.business.recall.topic.name=austinRecall
austin.business.recall.group.name=recallGroupId austin.business.recall.group.name=recallGroupId
austin.business.log.topic.name=austinLog austin.business.log.topic.name=austinTraceLog
austin.business.graylog.ip=${austin-grayLog-ip} austin.business.graylog.ip=${austin-grayLog-ip}
# TODO kafka tag filter,if you need, replace tagIdValue ,eg:com.java3y.austin.yyy # TODO kafka tag filter,if you need, replace tagIdValue ,eg:com.java3y.austin.yyy

Loading…
Cancel
Save