mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-04 14:16:25 +08:00 
			
		
		
		
	issue #101 获取微信服务器IP地址
This commit is contained in:
		@ -0,0 +1,42 @@
 | 
			
		||||
package me.chanjar.weixin.mp.api;
 | 
			
		||||
 | 
			
		||||
import com.google.inject.Inject;
 | 
			
		||||
import me.chanjar.weixin.common.api.WxConsts;
 | 
			
		||||
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
 | 
			
		||||
import me.chanjar.weixin.common.exception.WxErrorException;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.WxMpMassGroupMessage;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.WxMpMassNews;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.WxMpMassVideo;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
 | 
			
		||||
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
 | 
			
		||||
import org.testng.Assert;
 | 
			
		||||
import org.testng.annotations.DataProvider;
 | 
			
		||||
import org.testng.annotations.Guice;
 | 
			
		||||
import org.testng.annotations.Test;
 | 
			
		||||
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.io.InputStream;
 | 
			
		||||
import java.util.Arrays;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 *
 | 
			
		||||
 * @author chanjarster
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
@Test(groups = "miscAPI", dependsOnGroups = { "baseAPI"})
 | 
			
		||||
@Guice(modules = ApiTestModule.class)
 | 
			
		||||
public class WxMpMiscAPITest {
 | 
			
		||||
 | 
			
		||||
  @Inject
 | 
			
		||||
  protected WxMpServiceImpl wxService;
 | 
			
		||||
 | 
			
		||||
  @Test
 | 
			
		||||
  public void getCallbackIP() throws WxErrorException {
 | 
			
		||||
    String[] ipArray = wxService.getCallbackIP();
 | 
			
		||||
    System.out.println(Arrays.toString(ipArray));
 | 
			
		||||
    Assert.assertNotNull(ipArray);
 | 
			
		||||
    Assert.assertNotEquals(ipArray.length, 0);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@ -15,6 +15,7 @@
 | 
			
		||||
			<class name="me.chanjar.weixin.mp.api.WxMpShortUrlAPITest" />
 | 
			
		||||
			<class name="me.chanjar.weixin.mp.api.WxMpMessageRouterTest" />
 | 
			
		||||
      <class name="me.chanjar.weixin.mp.api.WxMpJsAPITest" />
 | 
			
		||||
      <class name="me.chanjar.weixin.mp.api.WxMpMiscAPITest" />
 | 
			
		||||
		</classes>
 | 
			
		||||
	</test>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user