Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Queue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Queue
Commits
8efd1cf9
Commit
8efd1cf9
authored
Feb 24, 2023
by
Henry Page
Browse files
Options
Downloads
Patches
Plain Diff
Augment test suite
parent
b083a173
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!724
Deploy
,
!623
Resolve Amount of requests per TA In a single lab + the time taken since the last lab.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/nl/tudelft/queue/service/RoleDTOService.java
+2
-7
2 additions, 7 deletions
src/main/java/nl/tudelft/queue/service/RoleDTOService.java
src/test/java/nl/tudelft/queue/service/LabStatusServiceTest.java
+15
-1
15 additions, 1 deletion
...t/java/nl/tudelft/queue/service/LabStatusServiceTest.java
with
17 additions
and
8 deletions
src/main/java/nl/tudelft/queue/service/RoleDTOService.java
+
2
−
7
View file @
8efd1cf9
...
...
@@ -29,7 +29,6 @@ import nl.tudelft.labracore.api.dto.*;
import
nl.tudelft.labracore.lib.security.user.Person
;
import
nl.tudelft.queue.cache.EditionRolesCacheManager
;
import
org.modelmapper.ModelMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -41,9 +40,6 @@ public class RoleDTOService {
@Autowired
private
RoleControllerApi
rApi
;
@Autowired
private
ModelMapper
mapper
;
public
List
<
String
>
names
(
List
<
PersonSummaryDTO
>
people
)
{
return
people
.
stream
().
map
(
PersonSummaryDTO:
:
getDisplayName
).
collect
(
Collectors
.
toList
());
}
...
...
@@ -149,9 +145,8 @@ public class RoleDTOService {
public
boolean
isStaff
(
RoleDetailsDTO
role
)
{
var
type
=
role
.
getType
();
return
type
.
equals
(
RoleDetailsDTO
.
TypeEnum
.
TA
)
||
type
.
equals
(
RoleDetailsDTO
.
TypeEnum
.
HEAD_TA
)
||
type
.
equals
(
RoleDetailsDTO
.
TypeEnum
.
TEACHER
)
||
type
.
equals
(
RoleDetailsDTO
.
TypeEnum
.
TEACHER_RO
);
return
Set
.
of
(
RoleDetailsDTO
.
TypeEnum
.
TA
,
RoleDetailsDTO
.
TypeEnum
.
HEAD_TA
,
RoleDetailsDTO
.
TypeEnum
.
TEACHER
,
RoleDetailsDTO
.
TypeEnum
.
TEACHER_RO
).
contains
(
type
);
}
public
boolean
isStaff
(
RolePersonDetailsDTO
role
)
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/nl/tudelft/queue/service/LabStatusServiceTest.java
+
15
−
1
View file @
8efd1cf9
...
...
@@ -24,6 +24,7 @@ import java.util.Set;
import
javax.transaction.Transactional
;
import
nl.tudelft.labracore.api.dto.EditionDetailsDTO
;
import
nl.tudelft.queue.model.LabRequest
;
import
nl.tudelft.queue.model.labs.RegularLab
;
...
...
@@ -51,6 +52,10 @@ class LabStatusServiceTest {
RegularLab
oopNowRegularLab1
;
RegularLab
rlOopNowSharedLab
;
EditionDetailsDTO
oopNow
;
LabRequest
[]
oopNowRegularLab1Requests
;
@BeforeEach
...
...
@@ -59,6 +64,8 @@ class LabStatusServiceTest {
oopNowRegularLab1
=
db
.
getOopNowRegularLab1
();
oopNowRegularLab1Requests
=
db
.
getOopNowRegularLab1Requests
();
rlOopNowSharedLab
=
db
.
getRlOopNowSharedLab
();
oopNow
=
db
.
getOopNow
();
}
...
...
@@ -67,7 +74,7 @@ class LabStatusServiceTest {
var
result
=
sessionStatusService
.
getTimeSinceLastRequestTA
(
oopNowRegularLab1
,
new
HashSet
<>());
assertThat
(
result
).
hasSize
(
db
.
getOopNowHeadTAs
().
length
+
db
.
getOopNowTAs
().
length
+
1
);
// 1 for teacher
assertThat
(
result
.
get
(
"Student 211"
)).
isEqualTo
(
Pair
.
of
(
-
1
L
,
"N/A"
));
assertThat
(
result
.
get
(
"Student 211"
)).
isEqualTo
(
Pair
.
of
(
0
L
,
"N/A"
));
assertThat
(
result
.
get
(
"Student 200"
).
getKey
()).
isGreaterThan
(
0L
).
isLessThan
(
10L
);
assertThat
(
result
.
get
(
"Student 200"
).
getValue
()).
isNotEqualTo
(
"N/A"
);
}
...
...
@@ -79,4 +86,11 @@ class LabStatusServiceTest {
assertThat
(
result
).
isEmpty
();
}
@Test
void
filterYieldsOnlyRespectiveCourseStaff
()
throws
Exception
{
var
result
=
sessionStatusService
.
getTimeSinceLastRequestTA
(
rlOopNowSharedLab
,
Set
.
of
(
oopNow
.
getId
()));
assertThat
(
result
).
hasSize
(
db
.
getOopNowHeadTAs
().
length
+
db
.
getOopNowTAs
().
length
+
1
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment