use of com.github.lybgeek.shorturl.dto.ShortUrlDTO in project springboot-learning by lyb-geek.
the class ElasticsearchApplicationTest method testCustomGetShortUrl.
@Test
public void testCustomGetShortUrl() {
ShortUrlDTO shortUrlDTO = customShortUrlEsService.getShortUrlById(2L);
Assert.assertNotNull(shortUrlDTO);
System.out.println(shortUrlDTO);
}
use of com.github.lybgeek.shorturl.dto.ShortUrlDTO in project springboot-learning by lyb-geek.
the class ElasticsearchApplicationTest method testListShortUrl.
@Test
public void testListShortUrl() {
ShortUrlDTO dto = new ShortUrlDTO();
// dto.setUrlName("百度");
List<ShortUrlDTO> shortUrlDTOS = shortUrlService.listShortUrls(dto);
System.out.println(shortUrlDTOS);
}
use of com.github.lybgeek.shorturl.dto.ShortUrlDTO in project springboot-learning by lyb-geek.
the class ElasticsearchApplicationTest method testSaveShortUrlEs.
@Test
public void testSaveShortUrlEs() {
ShortUrlDTO shortUrlDTO = ShortUrlDTO.builder().longUrl("https://www.baidu.com").urlName("百度").remark("百度一下,你就知道").build();
ShortUrlVO shortUrlVO = shortUrlEsService.save(shortUrlDTO);
Assert.assertNotNull(shortUrlVO);
System.out.println(shortUrlVO);
}
use of com.github.lybgeek.shorturl.dto.ShortUrlDTO in project springboot-learning by lyb-geek.
the class ElasticsearchApplicationTest method testCustomSaveShortUrlEs.
@Test
public void testCustomSaveShortUrlEs() {
ShortUrlDTO shortUrlDTO = ShortUrlDTO.builder().longUrl("https://www.meituan.com").urlName("美团外卖").remark("美团外卖APP").build();
boolean isSuccess = customShortUrlEsService.saveShortUrl(shortUrlDTO);
Assert.assertTrue(isSuccess);
}
use of com.github.lybgeek.shorturl.dto.ShortUrlDTO in project springboot-learning by lyb-geek.
the class ElasticsearchApplicationTest method testCustomSaveShortUrlEsAndReturnId.
@Test
public void testCustomSaveShortUrlEsAndReturnId() {
ShortUrlDTO shortUrlDTO = ShortUrlDTO.builder().id(20L).longUrl("https://music.wangyiyun.com/").urlName("网易云").remark("网易云音乐").build();
String id = customShortUrlEsService.save(shortUrlDTO);
Assert.assertNotNull(id);
}
Aggregations