Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TAM
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
TAM
Commits
3e88386f
Commit
3e88386f
authored
2 months ago
by
Rūta Giedrytė
Browse files
Options
Downloads
Patches
Plain Diff
add test
parent
6ca32b79
No related branches found
No related tags found
1 merge request
!421
Teachers without edition can now also access TAM
Pipeline
#1238614
passed
2 months ago
Stage: build
Stage: static analysis
Stage: test
Stage: report
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java
+27
-0
27 additions, 0 deletions
...ava/nl/tudelft/tam/controller/JobOfferControllerTest.java
with
27 additions
and
0 deletions
src/test/java/nl/tudelft/tam/controller/JobOfferControllerTest.java
+
27
−
0
View file @
3e88386f
...
...
@@ -343,6 +343,33 @@ class JobOfferControllerTest {
verify
(
coordinatorDefaultService
).
addDefaultsToEditionsWithJobsAndWork
(
anyList
());
}
@Test
@WithUserDetails
(
"teacher"
)
void
getManagerPortalTeacherWithNoEditionsTest
()
throws
Exception
{
String
q
=
"edi"
;
when
(
personService
.
getRolesForPerson
(
anyLong
())).
thenReturn
(
List
.
of
());
when
(
editionService
.
getEditionsWithJobsAndWork
(
anyList
())).
thenReturn
(
List
.
of
());
when
(
editionService
.
filter
(
anyList
(),
anyString
())).
thenReturn
(
List
.
of
());
when
(
authService
.
isStaff
()).
thenReturn
(
true
);
when
(
courseService
.
getManagingCourses
(
any
())).
thenReturn
(
List
.
of
());
when
(
cohortService
.
getAllCohorts
()).
thenReturn
(
List
.
of
());
doNothing
().
when
(
coordinatorDefaultService
).
addDefaultsToEditionsWithJobsAndWork
(
anyList
());
mvc
.
perform
(
get
(
"/job-offer/manage"
).
param
(
"q"
,
q
).
with
(
csrf
()))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
view
().
name
(
"job_offer/manage"
))
.
andExpect
(
model
().
attribute
(
"editions"
,
List
.
of
()))
.
andExpect
(
model
().
attribute
(
"managed"
,
List
.
of
()))
.
andExpect
(
model
().
attribute
(
"cohorts"
,
List
.
of
()));
verify
(
editionService
).
getAllEditionIdsThatPersonIsAMangerOf
(
anyLong
());
verify
(
courseService
).
getManagingCourses
(
any
());
verify
(
editionService
).
getEditionsWithJobsAndWork
(
List
.
of
());
verify
(
editionService
).
filter
(
List
.
of
(),
q
);
verify
(
coordinatorDefaultService
).
addDefaultsToEditionsWithJobsAndWork
(
anyList
());
}
@Test
@WithUserDetails
(
"admin"
)
void
getManagerPortalTestWithHidePrev
()
throws
Exception
{
...
...
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