Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
2755c53f
Commit
2755c53f
authored
Jul 31, 2024
by
xuyamei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决报错
parent
4162e588
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
src/main/java/com/xiaomai/cases/polar/reserve/personal/TestGetCoachHistorySpecialDate.java
+30
-5
No files found.
src/main/java/com/xiaomai/cases/polar/reserve/personal/TestGetCoachHistorySpecialDate.java
View file @
2755c53f
...
@@ -44,9 +44,19 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
...
@@ -44,9 +44,19 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
JSONObject
pageStudioPersonalCoach
=
reserveTools
.
pageStudioPersonalCoach
(
""
);
JSONObject
pageStudioPersonalCoach
=
reserveTools
.
pageStudioPersonalCoach
(
""
);
int
total
=
pageStudioPersonalCoach
.
getInteger
(
"total"
);
int
total
=
pageStudioPersonalCoach
.
getInteger
(
"total"
);
Random
rand
=
new
Random
();
Random
rand
=
new
Random
();
// 随机取
两
个教练
// 随机取
1
个教练
coachedId
=
pageStudioPersonalCoach
.
getJSONArray
(
"records"
).
getJSONObject
(
rand
.
nextInt
(
total
>
10
?
10
:
total
)).
getString
(
"id"
);
coachedId
=
pageStudioPersonalCoach
.
getJSONArray
(
"records"
).
getJSONObject
(
rand
.
nextInt
(
total
>
10
?
10
:
total
)).
getString
(
"id"
);
// 获取教练后先清除特殊日期数据。避免重叠
// 查询特殊可约时间列表
JSONArray
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
for
(
int
i
=
0
;
i
<
specialTimeVOS
.
size
();
i
++){
String
id
=
specialTimeVOS
.
getJSONObject
(
i
).
getJSONArray
(
"recordIds"
).
getString
(
0
);
// 删除查询到的特殊可约时间
reserveTools
.
deleteSpecialDate
(
id
);
}
Long
date
=
TimeUtils
.
getBeforeDayDate
(
1
);
Long
date
=
TimeUtils
.
getBeforeDayDate
(
1
);
JSONObject
body
=
new
JSONObject
();
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
...
@@ -65,7 +75,7 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
...
@@ -65,7 +75,7 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
reserveTools
.
createSpecialDate
(
coachedId
,
"OFF_DUTY"
,
specialTimeInfoRequest
);
reserveTools
.
createSpecialDate
(
coachedId
,
"OFF_DUTY"
,
specialTimeInfoRequest
);
// 设置全天休息完成后检查个人时间是否有这条数据
// 设置全天休息完成后检查个人时间是否有这条数据
JSONArray
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
boolean
flag
=
false
;
boolean
flag
=
false
;
for
(
int
i
=
0
;
i
<
specialTimeVOS
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
specialTimeVOS
.
size
();
i
++){
JSONObject
specialTimeVO
=
specialTimeVOS
.
getJSONObject
(
i
);
JSONObject
specialTimeVO
=
specialTimeVOS
.
getJSONObject
(
i
);
...
@@ -77,8 +87,23 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
...
@@ -77,8 +87,23 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
Assert
.
assertTrue
(
flag
,
"设置特殊日期全天休息后在历史特定日期可约时间列表没有找到相关数据"
);
Assert
.
assertTrue
(
flag
,
"设置特殊日期全天休息后在历史特定日期可约时间列表没有找到相关数据"
);
}
}
@Test
(
description
=
"删除特殊日期"
,
priority
=
1
)
public
void
testDeleteSpecialDate
()
{
// 查询特殊可约时间列表
JSONArray
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
for
(
int
i
=
0
;
i
<
specialTimeVOS
.
size
();
i
++){
String
id
=
specialTimeVOS
.
getJSONObject
(
i
).
getJSONArray
(
"recordIds"
).
getString
(
0
);
// 删除查询到的特殊可约时间
reserveTools
.
deleteSpecialDate
(
id
);
}
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
Assert
.
assertEquals
(
specialTimeVOS
.
size
(),
0
,
"删除特殊日期后,特殊日期列表不为空"
);
}
@Test
(
description
=
"设置特定日期可约"
,
priority
=
1
)
@Test
(
description
=
"设置特定日期可约"
,
priority
=
2
)
public
void
testCreateSpecialDate_ON
()
{
public
void
testCreateSpecialDate_ON
()
{
Long
date
=
TimeUtils
.
getBeforeDayDate
(
2
);
Long
date
=
TimeUtils
.
getBeforeDayDate
(
2
);
...
@@ -123,8 +148,8 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
...
@@ -123,8 +148,8 @@ public class TestGetCoachHistorySpecialDate extends BaseTestImpl {
Assert
.
assertTrue
(
flag
,
"设置特殊日期在历史特定日期可约时间列表没有找到相关数据"
);
Assert
.
assertTrue
(
flag
,
"设置特殊日期在历史特定日期可约时间列表没有找到相关数据"
);
}
}
@Test
(
description
=
"删除特殊日期"
,
priority
=
2
)
@Test
(
description
=
"删除特殊日期"
,
priority
=
3
)
public
void
testDeleteSpecialDate
()
{
public
void
testDeleteSpecialDate
2
()
{
// 查询特殊可约时间列表
// 查询特殊可约时间列表
JSONArray
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
JSONArray
specialTimeVOS
=
reserveTools
.
getCoachHistorySpecialDate
(
coachedId
);
...
...
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