Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Reference and Helper Services
CRS Catalog
Commits
02dbf564
Commit
02dbf564
authored
Aug 16, 2021
by
Dmitrii Novikov (EPAM)
Committed by
Rostislav Dublin (EPAM)
Aug 16, 2021
Browse files
Added new version info endpoint (GONRG-2811)
parent
384154dd
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
NOTICE
View file @
02dbf564
This diff is collapsed.
Click to expand it.
crs-catalog-core/src/main/java/org/opengroup/osdu/crs/api/InfoApi.java
0 → 100644
View file @
02dbf564
/*
* Copyright 2021 Google LLC
* Copyright 2021 EPAM Systems, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.opengroup.osdu.crs.api
;
import
java.io.IOException
;
import
org.opengroup.osdu.core.common.info.VersionInfoBuilder
;
import
org.opengroup.osdu.core.common.model.info.VersionInfo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
public
class
InfoApi
{
@Autowired
private
VersionInfoBuilder
versionInfoBuilder
;
@GetMapping
(
value
=
"/info"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
VersionInfo
info
()
throws
IOException
{
return
versionInfoBuilder
.
buildVersionInfo
();
}
}
\ No newline at end of file
crs-catalog-core/src/test/java/org/opengroup/osdu/crs/api/InfoApiTest.java
0 → 100644
View file @
02dbf564
/*
* Copyright 2021 Google LLC
* Copyright 2021 EPAM Systems, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.opengroup.osdu.crs.api
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
java.io.IOException
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.mockito.InjectMocks
;
import
org.mockito.Mock
;
import
org.mockito.junit.MockitoJUnitRunner
;
import
org.opengroup.osdu.core.common.info.VersionInfoBuilder
;
import
org.opengroup.osdu.core.common.model.info.VersionInfo
;
@RunWith
(
MockitoJUnitRunner
.
class
)
public
class
InfoApiTest
{
@InjectMocks
private
InfoApi
sut
;
@Mock
private
VersionInfoBuilder
versionInfoBuilder
;
@Test
public
void
should_return200_getVersionInfo
()
throws
IOException
{
VersionInfo
versionInfo
=
VersionInfo
.
builder
()
.
groupId
(
"group"
)
.
artifactId
(
"artifact"
)
.
version
(
"0.1.0"
)
.
buildTime
(
"1000"
)
.
branch
(
"master"
)
.
commitId
(
"7777"
)
.
commitMessage
(
"Merge commit"
)
.
build
();
when
(
versionInfoBuilder
.
buildVersionInfo
()).
thenReturn
(
versionInfo
);
VersionInfo
response
=
this
.
sut
.
info
();
assertEquals
(
versionInfo
,
response
);
}
}
pom.xml
View file @
02dbf564
...
...
@@ -9,7 +9,7 @@
<docker.image.prefix>
org.opengroup.osdu
</docker.image.prefix>
<powermock.version>
2.0.6
</powermock.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<os-core-common.version>
0.1
0
.0
</os-core-common.version>
<os-core-common.version>
0.1
1
.0
-SNAPSHOT
</os-core-common.version>
<snakeyaml.version>
1.26
</snakeyaml.version>
<nimbus-jose-jwt.version>
7.9
</nimbus-jose-jwt.version>
</properties>
...
...
@@ -108,10 +108,38 @@
<goal>
repackage
</goal>
</goals>
</execution>
<execution>
<id>
build-info
</id>
<goals>
<goal>
build-info
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>
pl.project13.maven
</groupId>
<artifactId>
git-commit-id-plugin
</artifactId>
<version>
4.0.5
</version>
<executions>
<execution>
<goals>
<goal>
revision
</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>
true
</verbose>
<dateFormat>
yyyy-MM-dd'T'HH:mm:ssZ
</dateFormat>
<generateGitPropertiesFile>
true
</generateGitPropertiesFile>
<generateGitPropertiesFilename>
${project.build.outputDirectory}/git.properties
</generateGitPropertiesFilename>
</configuration>
</plugin>
</plugins>
</build>
</project>
provider/crs-catalog-aws/src/main/java/org/opengroup/osdu/crs/security/AuthSecurityConfig.java
View file @
02dbf564
...
...
@@ -57,6 +57,7 @@ public class AuthSecurityConfig extends WebSecurityConfigurerAdapter implements
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui.html"
,
"/info"
,
"/webjars/**"
,
"/csrf"
,
"/api/crs/catalog/actuator"
,
...
...
provider/crs-catalog-azure/crs-catalog-aks/src/main/java/org/opengroup/osdu/crs/security/SecurityConfig.java
View file @
02dbf564
...
...
@@ -43,6 +43,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter implements Acc
"/configuration/security"
,
"/swagger"
,
"/swagger-ui.html"
,
"/info"
,
"/webjars/**"
,
"/csrf"
};
...
...
provider/crs-catalog-gcp/crs-catalog-gke/pom.xml
View file @
02dbf564
...
...
@@ -143,24 +143,24 @@
</configuration>
</plugin>
<plugin>
<groupId>
org.jacoco
</groupId>
<artifactId>
jacoco-maven-plugin
</artifactId>
<version>
0.7.7.201606060606
</version>
<executions>
<execution>
<goals>
<goal>
prepare-agent
</goal>
</goals>
</execution>
<execution>
<id>
report
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
report
</goal>
</goals>
</execution>
</executions>
</plugin>
<groupId>
org.jacoco
</groupId>
<artifactId>
jacoco-maven-plugin
</artifactId>
<version>
0.7.7.201606060606
</version>
<executions>
<execution>
<goals>
<goal>
prepare-agent
</goal>
</goals>
</execution>
<execution>
<id>
report
</id>
<phase>
prepare-package
</phase>
<goals>
<goal>
report
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
provider/crs-catalog-gcp/crs-catalog-gke/src/main/java/org/opengroup/osdu/crs/security/AuthSecurityConfig.java
View file @
02dbf564
...
...
@@ -57,6 +57,7 @@ public class AuthSecurityConfig extends WebSecurityConfigurerAdapter implements
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui.html"
,
"/info"
,
"/webjars/**"
,
"/csrf"
,
"/api/crs/catalog/actuator"
,
...
...
provider/crs-catalog-ibm/crs-catalog-ocp/src/main/java/org/opengroup/osdu/crs/security/SecurityConfig.java
View file @
02dbf564
...
...
@@ -45,6 +45,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter implements Acce
"/swagger-resources/**"
,
"/configuration/security"
,
"/swagger-ui.html"
,
"/info"
,
"/webjars/**"
,
"/csrf"
,
"/api/crs/catalog/actuator"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment