parent
a6518526a3
commit
51f7b0324a
|
@ -0,0 +1,54 @@
|
|||
package com.dispose.test.haohan;
|
||||
|
||||
import com.dispose.common.Http;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Assert;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class HaoHanInterfaceTestCase {
|
||||
@Test
|
||||
public void a1_sendTowTest() {
|
||||
String jsonRequest = "{\"ip\":\"192.168.1.1\",\"orderFrom\":\"haohandata\"}";
|
||||
String svrReturn = Http.postJson("http://10.88.77.88:18080/DDoSClean/clean/sendFlow",
|
||||
null,
|
||||
jsonRequest);
|
||||
|
||||
log.info("++++++++++++Server Return: [{}]", svrReturn);
|
||||
Assert.assertNotNull(svrReturn);
|
||||
Assert.assertNotEquals(svrReturn.length(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void a2_delTowTest() {
|
||||
String jsonRequest = "{\"cleanTaskId\":12345,\"orderFrom\":\"haohandata\"}";
|
||||
String svrReturn = Http.postJson("http://10.88.77.88:18080/DDoSClean/clean/delFlow",
|
||||
null,
|
||||
jsonRequest);
|
||||
|
||||
log.info("+++++++++++Server Return: [{}]", svrReturn);
|
||||
Assert.assertNotNull(svrReturn);
|
||||
Assert.assertNotEquals(svrReturn.length(), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void a3_delTowTest() {
|
||||
String jsonRequest = "{\"orderFrom\":\"haohandata\"}";
|
||||
String svrReturn = Http.postJson("http://10.88.77.88:18080/DDoSClean/clean/allIpFlow",
|
||||
null,
|
||||
jsonRequest);
|
||||
|
||||
log.info("+++++++++++Server Return: [{}]", svrReturn);
|
||||
Assert.assertNotNull(svrReturn);
|
||||
Assert.assertNotEquals(svrReturn.length(), 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue