Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alfa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
alfa
Merge requests
!16
Ozg 3936 refactor user profile url provider
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Ozg 3936 refactor user profile url provider
OZG-3936-refactor-UserProfileUrlProvider
into
main
Overview
24
Commits
21
Changes
11
Merged
Ozg 3936 refactor user profile url provider
Felix Reichenbach
requested to merge
OZG-3936-refactor-UserProfileUrlProvider
into
main
4 months ago
Overview
24
Commits
21
Changes
11
0
0
Merge request reports
Viewing commit
a32aa1f8
Prev
Next
Show latest version
11 files
+
224
−
149
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
11
a32aa1f8
OZG-3936 move tests for linked resources to own test classes
· a32aa1f8
Felix Reichenbach
authored
4 months ago
alfa-service/src/test/java/de/ozgcloud/alfa/bescheid/BescheidLinkedResourceTest.java
0 → 100644
+
40
−
0
View file @ a32aa1f8
Edit in single-file editor
Open in Web IDE
package
de.ozgcloud.alfa.bescheid
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
import
org.junit.jupiter.api.Nested
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.params.ParameterizedTest
;
import
org.junit.jupiter.params.provider.NullAndEmptySource
;
import
org.mockito.InjectMocks
;
import
org.springframework.hateoas.EntityModel
;
import
org.springframework.hateoas.Link
;
import
de.ozgcloud.alfa.common.LinkedResourceProcessor
;
class
BescheidLinkedResourceTest
{
@InjectMocks
private
LinkedResourceProcessor
<
Bescheid
>
processor
;
@Nested
class
TestEntityModelProcessing
{
private
static
final
String
REL_BESCHEID_DOCUMENT
=
"bescheidDocument"
;
@Test
void
shouldHaveBescheidDocumentLink
()
{
var
model
=
processor
.
process
(
EntityModel
.
of
(
BescheidTestFactory
.
create
()));
assertThat
(
model
.
getLink
(
REL_BESCHEID_DOCUMENT
)).
isPresent
().
get
().
extracting
(
Link:
:
getHref
)
.
isEqualTo
(
String
.
format
(
"%s/%s"
,
DocumentController
.
PATH
,
BescheidTestFactory
.
BESCHEID_DOCUMENT
));
}
@ParameterizedTest
@NullAndEmptySource
void
shouldNotHaveBescheidDocumentLinkIfNoDocumentAvailable
(
String
documentId
)
{
var
model
=
processor
.
process
(
EntityModel
.
of
(
BescheidTestFactory
.
createBuilder
().
bescheidDocument
(
documentId
).
build
()));
assertThat
(
model
.
getLink
(
REL_BESCHEID_DOCUMENT
)).
isEmpty
();
}
}
}
Loading