SensitiveTest.java 825 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11
package com.kwan.springbootkwan;

import com.kwan.springbootkwan.utils.SensitiveWordUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
12
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
13 14 15 16 17 18 19 20 21 22 23 24 25
@ContextConfiguration(classes = SpringBootKwanApplication.class)
public class SensitiveTest {

    @Autowired
    private SensitiveWordUtil sensitiveWordUtil;

    @Test
    public void test() {
        String result = sensitiveWordUtil.replace("国家 哇 nnd 复活 马化腾");
        System.out.println(result);
    }
}