BaseServiceTest.java
1.27 KB
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
32
33
34
35
36
37
38
package cn.com.glsx.entmicro.service;
import cn.com.glsx.entmicro.Main;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import java.util.Arrays;
/**
* @Title: BaseServiceTest.java
* @Description:
* @author deployer name
* @date 2018年1月6日 下午1:23:03
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2015
*/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Main.class)
public class BaseServiceTest {
@Test
public void Test1111() throws Exception {
String cloudId = "13476670125_R:厦门海沧问界延保业务沟通群_广联";
// 获取cloudId第一个下划线“_”之前的字符串
String cloudStaffId = cloudId.substring(0, cloudId.indexOf("_"));
// 获取cloudId第一个下划线“_”之后的字符串
String cloudCustomerId = cloudId.substring(cloudId.indexOf("_") + 1);
log.info("cloudStaffId:{},cloudCustomerId:{}", cloudStaffId, cloudCustomerId);
String substring = cloudCustomerId.substring(cloudCustomerId.indexOf("R:") + 2);
System.out.println(substring);
}
}