Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
naming-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
ics-software
naming-backend
Commits
b7bc541c
Commit
b7bc541c
authored
2 years ago
by
Lars Johansson
Browse files
Options
Downloads
Patches
Plain Diff
Added docker integration test for REST API endpoint - report
parent
2c9057ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/java/org/openepics/names/docker/HealthcheckIT.java
+1
-1
1 addition, 1 deletion
src/test/java/org/openepics/names/docker/HealthcheckIT.java
src/test/java/org/openepics/names/docker/ReportIT.java
+64
-0
64 additions, 0 deletions
src/test/java/org/openepics/names/docker/ReportIT.java
with
65 additions
and
1 deletion
src/test/java/org/openepics/names/docker/HealthcheckIT.java
+
1
−
1
View file @
b7bc541c
...
...
@@ -36,7 +36,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
* with docker-compose.yml / Dockerfile.
*
* <p>
* Focus of this class is
H
ealthcheck endpoint.
* Focus of this class is
h
ealthcheck endpoint.
* In practice, it means means to have Naming and PostgreSQL up and running.
* </p>
*
...
...
This diff is collapsed.
Click to expand it.
src/test/java/org/openepics/names/docker/ReportIT.java
0 → 100644
+
64
−
0
View file @
b7bc541c
/*
* Copyright (C) 2022 European Spallation Source ERIC.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package
org.openepics.names.docker
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
fail
;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.HttpURLConnection
;
import
org.junit.jupiter.api.Test
;
import
org.testcontainers.containers.DockerComposeContainer
;
import
org.testcontainers.containers.wait.strategy.Wait
;
import
org.testcontainers.junit.jupiter.Container
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
/**
* Integration tests for Naming and PostgreSQL that make use of existing dockerization
* with docker-compose.yml / Dockerfile.
*
* <p>
* Focus of this class is report endpoint.
* </p>
*
* @author Lars Johansson
*/
@Testcontainers
class
ReportIT
{
@Container
public
static
final
DockerComposeContainer
<?>
ENVIRONMENT
=
new
DockerComposeContainer
<>(
new
File
(
"docker-compose-integrationtest.yml"
))
.
waitingFor
(
ITUtil
.
NAMING
,
Wait
.
forLogMessage
(
".*Started NamingApplication.*"
,
1
));
@Test
void
readReportAbout
()
{
try
{
String
address
=
ITUtil
.
HTTP_IP_PORT_NAMING
+
"/report/about"
;
int
responseCode
=
ITUtil
.
doGet
(
address
);
assertEquals
(
HttpURLConnection
.
HTTP_OK
,
responseCode
);
}
catch
(
IOException
e
)
{
fail
();
}
}
}
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