Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
brandkbs2
Commits
dcf29a94
Commit
dcf29a94
authored
Sep 22, 2022
by
陈健智
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试类
parent
fffdf7a6
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
994 additions
and
0 deletions
+994
-0
src/test/java/com/zhiwei/brandkbs2/ChannelServiceTest.java
+103
-0
src/test/java/com/zhiwei/brandkbs2/CommonServiceTest.java
+75
-0
src/test/java/com/zhiwei/brandkbs2/CustomEventServiceTest.java
+56
-0
src/test/java/com/zhiwei/brandkbs2/CustomTagServiceTest.java
+27
-0
src/test/java/com/zhiwei/brandkbs2/EventDataServiceTest.java
+21
-0
src/test/java/com/zhiwei/brandkbs2/EventServiceTest.java
+144
-0
src/test/java/com/zhiwei/brandkbs2/HighWordServiceTest.java
+37
-0
src/test/java/com/zhiwei/brandkbs2/IndexServiceTest.java
+60
-0
src/test/java/com/zhiwei/brandkbs2/MarkDataServiceTest.java
+212
-0
src/test/java/com/zhiwei/brandkbs2/MarkFlowServiceTest.java
+22
-0
src/test/java/com/zhiwei/brandkbs2/ProjectServiceTest.java
+87
-0
src/test/java/com/zhiwei/brandkbs2/ReportServiceTest.java
+62
-0
src/test/java/com/zhiwei/brandkbs2/SystemInfoServiceTest.java
+53
-0
src/test/java/com/zhiwei/brandkbs2/TagFilterServiceTest.java
+35
-0
No files found.
src/test/java/com/zhiwei/brandkbs2/ChannelServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.pojo.vo.ChannelListVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.ChannelService
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.security.PublicKey
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
ChannelServiceTest
{
@Autowired
private
ChannelService
channelService
;
@Test
public
void
getActiveChannelListTest
(){
List
<
ChannelListVO
>
activeChannelList
=
channelService
.
getActiveChannelList
(
"0"
,
null
,
null
,
null
,
null
,
50
);
for
(
ChannelListVO
channelListVO
:
activeChannelList
)
{
System
.
out
.
println
(
channelListVO
);
}
}
@Test
public
void
getPositiveListTest
(){
List
<
ChannelListVO
>
positiveList
=
channelService
.
getPositiveList
(
"0"
,
null
,
null
,
"{\"index\":\"descend\"}"
,
null
,
null
,
50
);
for
(
ChannelListVO
channelListVO
:
positiveList
)
{
System
.
out
.
println
(
channelListVO
);
}
}
@Test
public
void
getNegativeListTest
(){
List
<
ChannelListVO
>
negativeList
=
channelService
.
getNegativeList
(
"0"
,
null
,
null
,
"{\"index\":\"descend\"}"
,
null
,
null
,
50
);
for
(
ChannelListVO
channelListVO
:
negativeList
)
{
System
.
out
.
println
(
channelListVO
);
}
}
@Test
public
void
collectChannelTest
(){
boolean
b
=
channelService
.
collectChannel
(
"62e9d653ba79005c9ee05b58"
);
System
.
out
.
println
(
b
);
}
@Test
public
void
removeCollectChannelTest
(){
boolean
b
=
channelService
.
removeCollectChannel
(
"62e9d653ba79005c9ee05b58"
);
System
.
out
.
println
(
b
);
}
@Test
public
void
getCollectListTest
(){
List
<
JSONObject
>
collectList
=
channelService
.
getCollectList
(
"0"
);
for
(
JSONObject
jsonObject
:
collectList
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getBaseInfoByChannelIdTest
(){
JSONObject
baseInfo
=
channelService
.
getBaseInfoByChannelId
(
"62e9d653ba79005c9ee05b58"
);
System
.
out
.
println
(
baseInfo
);
}
@Test
public
void
getSpreadingTendTest
(){
JSONObject
spreadingTend
=
channelService
.
getSpreadingTend
(
"62f9bccf7dabe314572e1a3b"
,
"文章"
,
null
,
null
,
null
);
System
.
out
.
println
(
spreadingTend
);
}
@Test
public
void
getSpreadingTendSummaryTest
(){
JSONObject
spreadingTendSummary
=
channelService
.
getSpreadingTendSummary
(
"62f9bccf7dabe314572e1a3b"
,
"0"
,
null
,
null
);
System
.
out
.
println
(
spreadingTendSummary
);
}
@Test
public
void
getArticlesByTimeTest
(){
JSONObject
articlesByTime
=
channelService
.
getArticlesByTime
(
1658073600000L
,
1660814098000L
,
null
,
1
,
10
,
"62f9bccf7dabe314572e1a3b"
,
"0"
);
System
.
out
.
println
(
articlesByTime
);
}
@Test
public
void
getEventsByTimeTest
(){
JSONObject
eventsByTime
=
channelService
.
getEventsByTime
(
1658073600000L
,
1660814098000L
,
1
,
10
,
"62e9d653ba79005c9ee05b58"
,
"0"
);
System
.
out
.
println
(
eventsByTime
);
}
}
src/test/java/com/zhiwei/brandkbs2/CommonServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.service.CommonService
;
import
com.zhiwei.middleware.mark.vo.MarkerTag
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
CommonServiceTest
{
@Autowired
private
CommonService
commonService
;
@Test
public
void
getQbjcTagsTest
(){
List
<
MarkerTag
>
qbjcTags
=
commonService
.
getQbjcTags
(
"21"
);
for
(
MarkerTag
qbjcTag
:
qbjcTags
)
{
System
.
out
.
println
(
qbjcTag
);
}
}
@Test
public
void
getEmotionTagsWithSortTest
(){
List
<
MarkerTag
>
emotionTagsWithSort
=
commonService
.
getEmotionTagsWithSort
(
"62beadd1bbf8eb20f96d2f2f"
,
"21"
);
for
(
MarkerTag
markerTag
:
emotionTagsWithSort
)
{
System
.
out
.
println
(
markerTag
);
}
}
@Test
public
void
getQbjcTagsByGroupNameTest
(){
List
<
MarkerTag
>
markerTags
=
commonService
.
getQbjcTagsByGroupName
(
"情感倾向"
);
for
(
MarkerTag
markerTag
:
markerTags
)
{
System
.
out
.
println
(
markerTag
);
}
}
@Test
public
void
getQbjcPlatformNamesTest
(){
List
<
String
>
qbjcPlatform
=
commonService
.
getQbjcPlatformNames
();
for
(
String
s
:
qbjcPlatform
)
{
System
.
out
.
println
(
s
);
}
}
@Test
public
void
getQbjcPlatformTest
(){
List
<
JSONObject
>
qbjcPlatform
=
commonService
.
getQbjcPlatform
();
for
(
JSONObject
jsonObject
:
qbjcPlatform
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getTimeRangeMonthTest
(){
Long
[]
timeRangeMonth
=
commonService
.
getTimeRangeMonth
();
for
(
Long
aLong
:
timeRangeMonth
)
{
System
.
out
.
println
(
aLong
);
}
}
@Test
public
void
getTimeRangeWeekTest
(){
Long
[]
timeRangeWeek
=
commonService
.
getTimeRangeWeek
();
for
(
Long
aLong
:
timeRangeWeek
)
{
System
.
out
.
println
(
aLong
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/CustomEventServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.CustomEventService
;
import
org.apache.commons.collections4.SplitMapUtils
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
CustomEventServiceTest
{
@Autowired
private
CustomEventService
customEventService
;
private
static
final
long
startTime
=
1658073600000L
;
private
static
final
long
endTime
=
1661937298000L
;
@Test
public
void
getCustomEventRankListTest
(){
List
<
JSONObject
>
customEventRankList
=
customEventService
.
getCustomEventRankList
(
startTime
,
endTime
);
for
(
JSONObject
jsonObject
:
customEventRankList
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getCustomEventListTest
(){
PageVO
<
JSONObject
>
jsonObjectPageVO
=
customEventService
.
getCustomEventList
(
1
,
10
,
"阿里"
);
System
.
out
.
println
(
jsonObjectPageVO
);
}
@Test
public
void
getCustomEventAnalyzeShareIdTest
(){
JSONObject
customEventAnalyzeShareId
=
customEventService
.
getCustomEventAnalyzeShareId
(
"630c985e13130d488d6484d2"
);
System
.
out
.
println
(
customEventAnalyzeShareId
);
// e8a53bbf3ac44c068ddf6639b864037c
}
@Test
public
void
getCustomEventAnalyzeTest
(){
JSONObject
customEventAnalyze
=
customEventService
.
getCustomEventAnalyze
(
"630c985e13130d488d6484d2"
,
false
);
System
.
out
.
println
(
customEventAnalyze
);
}
@Test
public
void
getShareCustomEventAnalyzeTest
(){
JSONObject
e8a53bbf3ac44c068ddf6639b864037c
=
customEventService
.
getShareCustomEventAnalyze
(
"e8a53bbf3ac44c068ddf6639b864037c"
);
System
.
out
.
println
(
e8a53bbf3ac44c068ddf6639b864037c
);
}
}
src/test/java/com/zhiwei/brandkbs2/CustomTagServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.zhiwei.brandkbs2.pojo.vo.CustomTagVo
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.CustomEventService
;
import
com.zhiwei.brandkbs2.service.CustomTagService
;
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.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
CustomTagServiceTest
{
@Autowired
private
CustomTagService
customTagService
;
@Test
public
void
findCustomTagListTest
(){
PageVO
<
CustomTagVo
>
customTagList
=
customTagService
.
findCustomTagList
(
1
,
10
);
for
(
CustomTagVo
customTagVo
:
customTagList
.
getList
())
{
System
.
out
.
println
(
customTagVo
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/EventDataServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.zhiwei.brandkbs2.service.EventDataService
;
import
org.checkerframework.checker.units.qual.A
;
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.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
EventDataServiceTest
{
@Autowired
EventDataService
eventDataService
;
@Test
public
void
analysisEventTest
(){
}
}
src/test/java/com/zhiwei/brandkbs2/EventServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportEventDTO
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportEventDataDTO
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.EventDisseminationTrend
;
import
com.zhiwei.brandkbs2.pojo.dto.EventSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.EventListInfoVO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.YqEventSearchVO
;
import
com.zhiwei.brandkbs2.service.EventService
;
import
org.apache.commons.lang3.tuple.Pair
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
EventServiceTest
{
@Autowired
EventService
eventService
;
@Test
public
void
getEventByIdTest
(){
Event
event
=
eventService
.
getEventById
(
"630e3e6abd377773ca194d9e"
);
System
.
out
.
println
(
event
.
getTitle
());
}
@Test
public
void
findEventListTest
(){
PageVO
<
JSONObject
>
eventList
=
eventService
.
findEventList
(
1
,
10
,
"21"
,
null
,
"{\"startTime\":\"descend\"}"
);
for
(
JSONObject
jsonObject
:
eventList
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getEventAnalyzeProgressTest
(){
List
<
String
>
ls
=
new
ArrayList
<>(
1
);
ls
.
add
(
"630e3e6abd377773ca194d9e"
);
JSONObject
eventAnalyzeProgress
=
eventService
.
getEventAnalyzeProgress
(
ls
);
System
.
out
.
println
(
eventAnalyzeProgress
);
}
@Test
public
void
getEventJSONByEventIdTest
(){
JSONObject
eventJSONByEventId
=
eventService
.
getEventJSONByEventId
(
"630e3e6abd377773ca194d9e"
);
System
.
out
.
println
(
eventJSONByEventId
);
}
@Test
public
void
getEventDatasTest
(){
PageVO
<
JSONObject
>
eventDatas
=
eventService
.
getEventDatas
(
1
,
10
,
"630e3e6abd377773ca194d9e"
);
for
(
JSONObject
jsonObject
:
eventDatas
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
downloadEventDatasTest
(){
Pair
<
String
,
List
<
ExportEventDataDTO
>>
stringListPair
=
eventService
.
downloadEventDatas
(
"630e3e6abd377773ca194d9e"
);
for
(
ExportEventDataDTO
exportEventDataDTO
:
stringListPair
.
getRight
())
{
System
.
out
.
println
(
exportEventDataDTO
);
}
}
@Test
public
void
downloadEventsTest
(){
Pair
<
String
,
List
<
ExportEventDTO
>>
stringListPair
=
eventService
.
downloadEvents
(
"21"
);
for
(
ExportEventDTO
exportEventDTO
:
stringListPair
.
getRight
())
{
System
.
out
.
println
(
exportEventDTO
);
}
}
@Test
public
void
findEventTagListAllTest
(){
JSONObject
eventTagListAll
=
eventService
.
findEventTagListAll
(
"21"
);
System
.
out
.
println
(
eventTagListAll
);
}
@Test
public
void
findEventTagGroupNameTest
(){
List
<
String
>
eventTagGroupName
=
eventService
.
findEventTagGroupName
(
"21"
);
for
(
String
s
:
eventTagGroupName
)
{
System
.
out
.
println
(
s
);
}
}
@Test
public
void
getEventsSearchCriteriaTest
(){
JSONObject
eventsSearchCriteria
=
eventService
.
getEventsSearchCriteria
();
System
.
out
.
println
(
eventsSearchCriteria
);
}
@Test
public
void
getEventListTest
(){
EventSearchDTO
dto
=
new
EventSearchDTO
();
dto
.
setKeyword
(
"美团"
);
PageVO
<
EventListInfoVO
>
eventList
=
eventService
.
getEventList
(
dto
);
for
(
EventListInfoVO
eventListInfoVO
:
eventList
.
getList
())
{
System
.
out
.
println
(
eventListInfoVO
);
}
}
@Test
public
void
getEventBaseInfoTest
(){
EventListInfoVO
eventBaseInfo
=
eventService
.
getEventBaseInfo
(
"630e3e6abd377773ca194d9e"
);
System
.
out
.
println
(
eventBaseInfo
.
getTitle
());
}
@Test
public
void
getEventDisseminationTrendsTest
(){
EventDisseminationTrend
eventDisseminationTrends
=
eventService
.
getEventDisseminationTrends
(
"62f5ee1eabed6410100016d3"
,
"小时"
);
System
.
out
.
println
(
eventDisseminationTrends
.
getTotalSpread
());
}
@Test
public
void
getEventChannelVoicesTest
(){
PageVO
<
JSONObject
>
jsonObjectPageVO
=
eventService
.
getEventChannelVoices
(
"630e3e6abd377773ca194d9e"
,
"重要渠道"
,
1
,
10
,
null
);
for
(
JSONObject
jsonObject
:
jsonObjectPageVO
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getEventTopArticlesAnalysisTest
(){
JSONObject
eventTopArticlesAnalysis
=
eventService
.
getEventTopArticlesAnalysis
(
"630e3e6abd377773ca194d9e"
,
"按时间"
,
"全部"
,
"华为网约车功守道"
);
System
.
out
.
println
(
eventTopArticlesAnalysis
);
}
@Test
public
void
getLastEventTopTest
(){
List
<
JSONObject
>
ls
=
eventService
.
getLastEventTop
(
"华为"
,
10
);
for
(
JSONObject
l
:
ls
)
{
System
.
out
.
println
(
l
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/HighWordServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.easyexcel.dto.ExportHighWordDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.HighWordService
;
import
org.junit.Test
;
import
org.junit.jupiter.api.Tags
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
HighWordServiceTest
{
@Autowired
private
HighWordService
highWordService
;
@Test
public
void
findHighWordTest
(){
PageVO
<
JSONObject
>
ls
=
highWordService
.
findHighWord
(
1
,
10
,
"里"
);
for
(
JSONObject
jsonObject
:
ls
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
downloadHighWordTest
(){
List
<
ExportHighWordDTO
>
exportHighWordDTOS
=
highWordService
.
downloadHighWord
();
for
(
ExportHighWordDTO
exportHighWordDTO
:
exportHighWordDTOS
)
{
System
.
out
.
println
(
exportHighWordDTO
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/IndexServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.sun.media.sound.SoftTuning
;
import
com.zhiwei.brandkbs2.service.IndexService
;
import
org.elasticsearch.index.mapper.SourceToParse
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
IndexServiceTest
{
@Autowired
private
IndexService
indexService
;
private
static
final
long
startTime
=
1658073600000L
;
private
static
final
long
endTime
=
1661937298000L
;
@Test
public
void
getYuqingAmountTest
(){
JSONObject
yuqingAmount
=
indexService
.
getYuqingAmount
(
null
,
null
,
false
);
System
.
out
.
println
(
yuqingAmount
);
}
@Test
public
void
getReputationTest
(){
JSONObject
reputation
=
indexService
.
getReputation
(
null
,
null
,
false
);
System
.
out
.
println
(
reputation
);
}
@Test
public
void
getEventAmountTest
(){
JSONObject
eventAmount
=
indexService
.
getEventAmount
(
null
,
null
,
false
);
System
.
out
.
println
(
eventAmount
);
}
@Test
public
void
getPlatformInfoTest
(){
List
<
JSONObject
>
platformInfo
=
indexService
.
getPlatformInfo
(
null
,
null
,
false
);
System
.
out
.
println
(
platformInfo
);
}
@Test
public
void
getSpreadingTendTest
(){
JSONObject
spreadingTend
=
indexService
.
getSpreadingTend
(
null
,
null
,
false
);
System
.
out
.
println
(
spreadingTend
);
}
@Test
public
void
getSpreadingTend2
(){
JSONObject
spreadingTend
=
indexService
.
getSpreadingTend
(
null
,
null
,
"62beadd1bbf8eb20f96d2f2f"
,
"0"
,
false
);
System
.
out
.
println
(
spreadingTend
);
}
}
src/test/java/com/zhiwei/brandkbs2/MarkDataServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.sun.media.sound.SoftTuning
;
import
com.zhiwei.brandkbs2.pojo.BaseMap
;
import
com.zhiwei.brandkbs2.pojo.Event
;
import
com.zhiwei.brandkbs2.pojo.MarkFlowEntity
;
import
com.zhiwei.brandkbs2.pojo.dto.MarkSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.SearchFilterDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.MarkDataService
;
import
org.checkerframework.checker.units.qual.K
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
MarkDataServiceTest
{
@Autowired
private
MarkDataService
markDataService
;
@Test
public
void
getYuqingMarkListTest
(){
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
PageVO
<
MarkFlowEntity
>
yuqingMarkList
=
markDataService
.
getYuqingMarkList
(
dto
);
for
(
MarkFlowEntity
markFlowEntity
:
yuqingMarkList
.
getList
())
{
System
.
out
.
println
(
"markFlowEntity.getData() = "
+
markFlowEntity
.
getData
());
System
.
out
.
println
(
"markFlowEntity.getInfo() = "
+
markFlowEntity
.
getInfo
());
}
}
@Test
public
void
generateYuqingMarkAggreeListTest
(){
String
s
=
markDataService
.
generateYuqingMarkAggreeList
(
1658073600000L
,
1660814098000L
);
System
.
out
.
println
(
s
);
// 2e555f743f454ff29fc35bda2668c72c
}
@Test
public
void
getYuqingMarkAggreeProgressTest
(){
String
yuqingMarkAggreeProgress
=
markDataService
.
getYuqingMarkAggreeProgress
(
"2e555f743f454ff29fc35bda2668c72c"
);
System
.
out
.
println
(
yuqingMarkAggreeProgress
);
}
@Test
public
void
getYuqingMarkAggreeListTest
(){
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
dto
.
setAggreeId
(
"2e555f743f454ff29fc35bda2668c72c"
);
PageVO
<
MarkFlowEntity
>
yuqingMarkAggreeList
=
markDataService
.
getYuqingMarkAggreeList
(
dto
);
for
(
MarkFlowEntity
markFlowEntity
:
yuqingMarkAggreeList
.
getList
())
{
System
.
out
.
println
(
"markFlowEntity.getData() = "
+
markFlowEntity
.
getData
());
System
.
out
.
println
(
"markFlowEntity.getInfo() = "
+
markFlowEntity
.
getInfo
());
}
}
@Test
public
void
getYuqingMarkCriteriaTest
(){
JSONObject
yuqingMarkCriteria
=
markDataService
.
getYuqingMarkCriteria
(
null
);
System
.
out
.
println
(
yuqingMarkCriteria
);
}
@Test
public
void
getAnalyzeSummaryTest
(){
JSONObject
analyzeSummary
=
markDataService
.
getAnalyzeSummary
(
1658073600000L
,
1660814098000L
,
false
);
System
.
out
.
println
(
analyzeSummary
);
}
@Test
public
void
getMarkSpreadTest
(){
List
<
JSONObject
>
markSpread
=
markDataService
.
getMarkSpread
(
1658073600000L
,
1661937298000L
,
false
);
System
.
out
.
println
(
markSpread
);
}
@Test
public
void
getMarkEmotionProportionTest
(){
JSONObject
markEmotionProportion
=
markDataService
.
getMarkEmotionProportion
(
1658073600000L
,
1661937298000L
,
false
);
System
.
out
.
println
(
markEmotionProportion
);
}
@Test
public
void
getMarkChannelProportionTest
(){
JSONObject
markChannelProportion
=
markDataService
.
getMarkChannelProportion
(
1658073600000L
,
1661937298000L
,
false
);
System
.
out
.
println
(
markChannelProportion
);
}
@Test
public
void
getMarkPlatformProportion
(){
List
<
JSONObject
>
markPlatformProportion
=
markDataService
.
getMarkPlatformProportion
(
1658073600000L
,
1661937298000L
,
false
);
for
(
JSONObject
jsonObject
:
markPlatformProportion
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getMarkHighWord
(){
List
<
JSONObject
>
markHighWord
=
markDataService
.
getMarkHighWord
(
1658073600000L
,
1661937298000L
);
for
(
JSONObject
jsonObject
:
markHighWord
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getMarkTopTitle
()
throws
IOException
{
List
<
Map
.
Entry
<
String
,
Integer
>>
markTopTitle
=
markDataService
.
getMarkTopTitle
(
1658073600000L
,
1661937298000L
,
null
,
"62beadd1bbf8eb20f96d2f2e"
,
"136"
,
"62e1f113b746930599b616a0"
,
10
);
for
(
Map
.
Entry
<
String
,
Integer
>
stringIntegerEntry
:
markTopTitle
)
{
System
.
out
.
println
(
stringIntegerEntry
);
}
}
@Test
public
void
getFirstArticleTest
()
throws
IOException
{
BaseMap
article
=
markDataService
.
getFirstArticle
(
1658073600000L
,
1661727700000L
,
"飞鹤杯小小朗读者活动北上广津等八位公益推广大使来啦"
,
"62beadd1bbf8eb20f96d2f2e"
,
"136"
,
"62e1f113b746930599b616a0"
);
System
.
out
.
println
(
article
.
getContent
());
}
@Test
public
void
searchMarkDataByEvent
(){
Event
event
=
new
Event
();
event
.
setProjectId
(
"62beadd1bbf8eb20f96d2f2f"
);
event
.
setContendId
(
"0"
);
event
.
setStartTime
(
1659628800000L
);
event
.
setEndTime
(
1659888000000L
);
List
<
JSONObject
>
jsonObjects
=
markDataService
.
searchMarkDataByEvent
(
event
);
for
(
JSONObject
jsonObject
:
jsonObjects
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
searchMarkDataByTimeTest
(){
List
<
JSONObject
>
jsonObjects
=
markDataService
.
searchMarkDataByTime
(
"62beadd1bbf8eb20f96d2f2d"
,
"23"
,
"62e1f113b746930599b6167e"
,
1658073600000L
,
1661727700000L
);
for
(
JSONObject
jsonObject
:
jsonObjects
)
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getContendSearchCriteriaTest
(){
JSONObject
contendSearchCriteria
=
markDataService
.
getContendSearchCriteria
(
"62e1f113b746930599b616b4"
);
System
.
out
.
println
(
contendSearchCriteria
);
}
@Test
public
void
getContendSearchList
(){
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
PageVO
<
MarkFlowEntity
>
contendSearchList
=
markDataService
.
getContendSearchList
(
dto
);
for
(
MarkFlowEntity
markFlowEntity
:
contendSearchList
.
getList
())
{
System
.
out
.
println
(
"markFlowEntity.getData() = "
+
markFlowEntity
.
getData
());
System
.
out
.
println
(
"markFlowEntity.getInfo() = "
+
markFlowEntity
.
getInfo
());
}
}
@Test
public
void
getContendSummary
()
throws
IOException
{
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
JSONObject
contendSummary
=
markDataService
.
getContendSummary
(
dto
,
false
);
System
.
out
.
println
(
contendSummary
);
}
@Test
public
void
getContendSpreadAnalyzeTest
()
throws
IOException
{
MarkSearchDTO
dto
=
new
MarkSearchDTO
();
JSONObject
contendSpreadAnalyze
=
markDataService
.
getContendSpreadAnalyze
(
dto
,
5
,
false
);
System
.
out
.
println
(
contendSpreadAnalyze
);
}
@Test
public
void
searchWholeNetworkTest
(){
SearchFilterDTO
dto
=
new
SearchFilterDTO
();
dto
.
setProjectId
(
"62beadd1bbf8eb20f96d2f2f"
);
dto
.
setSearch
(
"阿里"
);
JSONObject
jsonObject
=
markDataService
.
searchWholeNetwork
(
dto
);
System
.
out
.
println
(
jsonObject
);
}
@Test
public
void
getYuqingMarkCountTest
()
throws
IOException
{
long
yuqingMarkCount
=
markDataService
.
getYuqingMarkCount
(
1658073600000L
,
1661727700000L
,
null
,
"62beadd1bbf8eb20f96d2f2d"
,
"23"
);
System
.
out
.
println
(
yuqingMarkCount
);
}
@Test
public
void
getYuqingMarkCountTest2
()
throws
IOException
{
long
yuqingMarkCount
=
markDataService
.
getYuqingMarkCount
(
1658073600000L
,
1661727700000L
,
null
,
null
,
"62beadd1bbf8eb20f96d2f2d"
,
"0"
);
System
.
out
.
println
(
yuqingMarkCount
);
}
@Test
public
void
getYuqingMarkFirstTimeTest
()
throws
IOException
{
long
yuqingMarkFirstTime
=
markDataService
.
getYuqingMarkFirstTime
(
"62beadd1bbf8eb20f96d2f2e"
,
"0"
);
System
.
out
.
println
(
yuqingMarkFirstTime
);
}
@Test
public
void
getEsTopSourceTest
()
throws
IOException
{
List
<
Map
<
String
,
Object
>>
esTopSource
=
markDataService
.
getEsTopSource
(
1658073600000L
,
1661727700000L
,
"62beadd1bbf8eb20f96d2f2e"
,
"136"
,
"0"
,
null
,
5
);
for
(
Map
<
String
,
Object
>
stringObjectMap
:
esTopSource
)
{
System
.
out
.
println
(
stringObjectMap
.
entrySet
());
}
}
}
src/test/java/com/zhiwei/brandkbs2/MarkFlowServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.zhiwei.brandkbs2.pojo.MarkFlowEntity
;
import
com.zhiwei.brandkbs2.service.MarkFlowService
;
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.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
MarkFlowServiceTest
{
@Autowired
private
MarkFlowService
markFlowService
;
@Test
public
void
getShotPageFromCacheTest
(){
MarkFlowEntity
shotPageFromCache
=
markFlowService
.
getShotPageFromCache
(
"94c94f060071f302dbfb482f68ebfc8d"
);
System
.
out
.
println
(
shotPageFromCache
.
getData
());
}
}
src/test/java/com/zhiwei/brandkbs2/ProjectServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.pojo.AbstractProject
;
import
com.zhiwei.brandkbs2.pojo.Project
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.pojo.vo.ProjectVO
;
import
com.zhiwei.brandkbs2.service.ProjectService
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
ProjectServiceTest
{
@Autowired
private
ProjectService
projectService
;
@Test
public
void
findProjectListTest
(){
PageVO
<
JSONObject
>
projectList
=
projectService
.
findProjectList
(
1
,
10
,
null
);
for
(
JSONObject
jsonObject
:
projectList
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
@Test
public
void
getProjectVOByIdTest
(){
ProjectVO
projectVOById
=
projectService
.
getProjectVOById
(
UserThreadLocal
.
getProjectId
());
System
.
out
.
println
(
projectVOById
.
getProjectName
());
}
@Test
public
void
getProjectByIdTest
(){
Project
projectById
=
projectService
.
getProjectById
(
UserThreadLocal
.
getProjectId
());
System
.
out
.
println
(
projectById
.
getProjectName
());
}
@Test
public
void
getUserAllProjectsTest
(){
List
<
JSONObject
>
userAllProjects
=
projectService
.
getUserAllProjects
();
for
(
JSONObject
userAllProject
:
userAllProjects
)
{
System
.
out
.
println
(
userAllProject
);
}
}
@Test
public
void
getLoginUserAllProjects
(){
List
<
JSONObject
>
loginUserAllProjects
=
projectService
.
getLoginUserAllProjects
();
for
(
JSONObject
loginUserAllProject
:
loginUserAllProjects
)
{
System
.
out
.
println
(
loginUserAllProject
);
}
}
@Test
public
void
getBrandsTest
(){
List
<
JSONObject
>
brands
=
projectService
.
getBrands
(
UserThreadLocal
.
getProjectId
(),
true
);
for
(
JSONObject
brand
:
brands
)
{
System
.
out
.
println
(
brand
);
}
}
@Test
public
void
getProjectByLinkedGroupIdTest
(){
AbstractProject
projectByLinkedGroupId
=
projectService
.
getProjectByLinkedGroupId
(
"21"
);
System
.
out
.
println
(
projectByLinkedGroupId
.
getProjectName
());
}
@Test
public
void
getProjectByContendIdTest
(){
AbstractProject
projectByContendId
=
projectService
.
getProjectByContendId
(
UserThreadLocal
.
getProjectId
(),
"0"
);
System
.
out
.
println
(
projectByContendId
.
getProjectName
());
}
@Test
public
void
getAllProjectsWithStart
(){
List
<
Project
>
allProjectsWithStart
=
projectService
.
getAllProjectsWithStart
();
for
(
Project
project
:
allProjectsWithStart
)
{
System
.
out
.
println
(
project
.
getProjectName
());
}
}
}
src/test/java/com/zhiwei/brandkbs2/ReportServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.alibaba.fastjson.JSONObject
;
import
com.zhiwei.brandkbs2.auth.UserThreadLocal
;
import
com.zhiwei.brandkbs2.pojo.Report
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSearchDTO
;
import
com.zhiwei.brandkbs2.pojo.dto.ReportSettingsDTO
;
import
com.zhiwei.brandkbs2.pojo.vo.PageVO
;
import
com.zhiwei.brandkbs2.service.ReportService
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
import
java.util.Map
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
ReportServiceTest
{
@Autowired
private
ReportService
reportService
;
@Test
public
void
getReportSettingsTest
(){
Map
<
String
,
ReportSettingsDTO
>
reportSettings
=
reportService
.
getReportSettings
();
for
(
Map
.
Entry
<
String
,
ReportSettingsDTO
>
stringReportSettingsDTOEntry
:
reportSettings
.
entrySet
())
{
System
.
out
.
println
(
stringReportSettingsDTOEntry
);
}
}
@Test
public
void
getCustomReportByStatusTest
(){
List
<
Report
>
customReportByStatus
=
reportService
.
getCustomReportByStatus
(
UserThreadLocal
.
getProjectId
(),
false
);
for
(
Report
reportByStatus
:
customReportByStatus
)
{
System
.
out
.
println
(
reportByStatus
);
}
}
@Test
public
void
getReportsAggCountTest
(){
JSONObject
reportsAggCount
=
reportService
.
getReportsAggCount
();
System
.
out
.
println
(
reportsAggCount
);
}
@Test
public
void
getPcReportAnalyzeTest
(){
JSONObject
pcReportAnalyze
=
reportService
.
getPcReportAnalyze
(
"62d10e9eabed6407b00012f4"
,
false
);
System
.
out
.
println
(
pcReportAnalyze
);
}
@Test
public
void
findReportListTest
(){
ReportSearchDTO
dto
=
new
ReportSearchDTO
();
PageVO
<
JSONObject
>
reportList
=
reportService
.
findReportList
(
dto
);
for
(
JSONObject
jsonObject
:
reportList
.
getList
())
{
System
.
out
.
println
(
jsonObject
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/SystemInfoServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.zhiwei.brandkbs2.pojo.ChannelTag
;
import
com.zhiwei.brandkbs2.service.SystemInfoService
;
import
com.zhiwei.qbjc.bean.pojo.common.MessagePlatform
;
import
com.zhiwei.qbjc.bean.pojo.common.Tag
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
import
java.util.Map
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
SystemInfoServiceTest
{
@Autowired
private
SystemInfoService
systemInfoService
;
@Test
public
void
getPlatformsTest
(){
List
<
MessagePlatform
>
platforms
=
systemInfoService
.
getPlatforms
();
for
(
MessagePlatform
platform
:
platforms
)
{
System
.
out
.
println
(
platform
);
}
}
@Test
public
void
getTagsTest
(){
List
<
Tag
>
tags
=
systemInfoService
.
getTags
();
for
(
Tag
tag
:
tags
)
{
System
.
out
.
println
(
tag
);
}
}
@Test
public
void
getChannelTagsTest
(){
List
<
ChannelTag
>
channelTags
=
systemInfoService
.
getChannelTags
();
for
(
ChannelTag
channelTag
:
channelTags
)
{
System
.
out
.
println
(
channelTag
.
getTag
());
}
}
@Test
public
void
getMediaTypesTest
(){
Map
<
String
,
Map
<
String
,
String
>>
mediaTypes
=
systemInfoService
.
getMediaTypes
();
for
(
Map
.
Entry
<
String
,
Map
<
String
,
String
>>
stringMapEntry
:
mediaTypes
.
entrySet
())
{
System
.
out
.
println
(
stringMapEntry
);
}
}
}
src/test/java/com/zhiwei/brandkbs2/TagFilterServiceTest.java
0 → 100644
View file @
dcf29a94
package
com
.
zhiwei
.
brandkbs2
;
import
com.zhiwei.brandkbs2.pojo.dto.TagFilterDTO
;
import
com.zhiwei.brandkbs2.service.TagFilterService
;
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.junit4.SpringJUnit4ClassRunner
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@SpringBootTest
public
class
TagFilterServiceTest
{
@Autowired
private
TagFilterService
tagFilterService
;
@Test
public
void
getTagFilter
(){
List
<
TagFilterDTO
>
tagFilter
=
tagFilterService
.
getTagFilter
();
for
(
TagFilterDTO
tagFilterDTO
:
tagFilter
)
{
System
.
out
.
println
(
tagFilterDTO
.
getGroupName
());
}
}
@Test
public
void
getTagFilterAllTest
(){
List
<
TagFilterDTO
>
tagFilterAll
=
tagFilterService
.
getTagFilterAll
();
for
(
TagFilterDTO
tagFilterDTO
:
tagFilterAll
)
{
System
.
out
.
println
(
tagFilterDTO
.
getGroupName
());
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment