forked from rbridomzmr/ShadowSocks-Share
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xxx
committed
Jan 24, 2018
1 parent
5f2d86b
commit c0d02c9
Showing
3 changed files
with
111 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 26 additions & 19 deletions
45
src/test/java/com/example/ShadowSocksShare/service/ShadowSocksCrawlerServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,44 @@ | ||
package com.example.ShadowSocksShare.service; | ||
|
||
import com.example.ShadowSocksShare.BaseTest; | ||
import com.example.ShadowSocksShare.domain.ShadowSocksDetailsEntity; | ||
import com.example.ShadowSocksShare.domain.ShadowSocksEntity; | ||
import com.example.ShadowSocksShare.domain.ShadowSocksRepository; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Qualifier; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
|
||
import java.util.Date; | ||
import java.util.HashSet; | ||
|
||
@Slf4j | ||
public class ShadowSocksCrawlerServiceTest extends BaseTest { | ||
@Autowired | ||
private MockMvc mvc; | ||
|
||
@Autowired | ||
private ShadowSocksCrawlerService iShadowCrawlerServiceImpl; | ||
@Qualifier("iShadowCrawlerServiceImpl") | ||
private ShadowSocksCrawlerService iShadowCrawlerServiceImpl; // ishadow | ||
@Autowired | ||
private ShadowSocksRepository shadowSocksRepository; | ||
|
||
|
||
public void aa() { | ||
ShadowSocksEntity socksEntity = new ShadowSocksEntity("targetURL", "title", true, new Date()); | ||
socksEntity.setShadowSocksSet(new HashSet<>()); | ||
|
||
ShadowSocksDetailsEntity entity = new ShadowSocksDetailsEntity("216.189.158.147", 5307, "mm", "chacha20", "auth_aes128_sha1", "tls1.2_ticket_auth"); | ||
entity.setValid(true); | ||
entity.setRemarks("本账号来自:doub.io/sszhfx/镜像域名:doub.bid/sszhfx/"); | ||
entity.setGroup(""); | ||
@Qualifier("doubCrawlerServiceImpl") | ||
private ShadowSocksCrawlerService doubCrawlerServiceImpl; // https://doub.io | ||
@Autowired | ||
@Qualifier("freeSS_EasyToUseCrawlerServiceImpl") | ||
private ShadowSocksCrawlerService freeSS_EasyToUseCrawlerServiceImpl; // https://freess.cx/#portfolio-preview | ||
@Autowired | ||
@Qualifier("ss8ServiceImpl") | ||
private ShadowSocksCrawlerService ss8ServiceImpl; // https://en.ss8.fun/ | ||
@Autowired | ||
@Qualifier("freeSSRCrawlerServiceImpl") | ||
private ShadowSocksCrawlerService freeSSRCrawlerServiceImpl; // https://global.ishadowx.net/ | ||
@Autowired | ||
@Qualifier("free_ssServiceImpl") | ||
private ShadowSocksCrawlerService free_ssServiceImpl; // https://free-ss.site/ | ||
@Autowired | ||
@Qualifier("ssrBlueCrawlerServiceImpl") | ||
private ShadowSocksCrawlerService ssrBlueCrawlerServiceImpl; // http://www.ssr.blue | ||
|
||
socksEntity.getShadowSocksSet().add(entity); | ||
|
||
shadowSocksRepository.save(socksEntity); | ||
@Test | ||
public void testDoubCrawlerService() { | ||
ShadowSocksEntity entity = doubCrawlerServiceImpl.getShadowSocks(); | ||
log.debug("========>{}", entity); | ||
} | ||
} |