Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Legal
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
Service Desk
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
Security and Compliance
Legal
Commits
cdf84379
Commit
cdf84379
authored
4 years ago
by
Aalekh Jain
Browse files
Options
Downloads
Patches
Plain Diff
Used helper function ValidateAppException in `LegalTagRepositoryImplTest.java`
parent
fc40591b
No related branches found
No related tags found
1 merge request
!61
Improve code coverage
Pipeline
#9827
failed
4 years ago
Stage: review
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/tags/dataaccess/LegalTagRepositoryImplTest.java
+7
-4
7 additions, 4 deletions
...gal/azure/tags/dataaccess/LegalTagRepositoryImplTest.java
with
7 additions
and
4 deletions
provider/legal-azure/src/test/java/org/opengroup/osdu/legal/azure/tags/dataaccess/LegalTagRepositoryImplTest.java
+
7
−
4
View file @
cdf84379
...
@@ -73,8 +73,7 @@ public class LegalTagRepositoryImplTest {
...
@@ -73,8 +73,7 @@ public class LegalTagRepositoryImplTest {
}
catch
(
AppException
e
)
{
}
catch
(
AppException
e
)
{
int
errorCode
=
409
;
int
errorCode
=
409
;
String
errorMessage
=
"LegalTag already exists"
;
String
errorMessage
=
"LegalTag already exists"
;
assertEquals
(
errorCode
,
e
.
getError
().
getCode
());
validateAppException
(
e
,
errorCode
,
errorMessage
);
assertThat
(
e
.
getError
().
getMessage
(),
containsString
(
errorMessage
));
throw
(
e
);
throw
(
e
);
}
}
}
}
...
@@ -158,8 +157,7 @@ public class LegalTagRepositoryImplTest {
...
@@ -158,8 +157,7 @@ public class LegalTagRepositoryImplTest {
}
catch
(
AppException
e
)
{
}
catch
(
AppException
e
)
{
int
errorCode
=
404
;
int
errorCode
=
404
;
String
errorMessage
=
"Cannot update a LegalTag that does not exist"
;
String
errorMessage
=
"Cannot update a LegalTag that does not exist"
;
assertEquals
(
errorCode
,
e
.
getError
().
getCode
());
validateAppException
(
e
,
errorCode
,
errorMessage
);
assertThat
(
e
.
getError
().
getMessage
(),
containsString
(
errorMessage
));
throw
(
e
);
throw
(
e
);
}
}
}
}
...
@@ -214,4 +212,9 @@ public class LegalTagRepositoryImplTest {
...
@@ -214,4 +212,9 @@ public class LegalTagRepositoryImplTest {
legalTag
.
setId
(
id
);
legalTag
.
setId
(
id
);
return
legalTag
;
return
legalTag
;
}
}
private
void
validateAppException
(
AppException
e
,
int
errorCode
,
String
errorMessage
)
{
assertEquals
(
errorCode
,
e
.
getError
().
getCode
());
assertThat
(
e
.
getError
().
getMessage
(),
containsString
(
errorMessage
));
}
}
}
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