Skip to content

Commit

Permalink
Merge pull request #231 from kit-data-manager/development
Browse files Browse the repository at this point in the history
PR for next release
  • Loading branch information
ThomasJejkal committed Apr 22, 2024
2 parents 445b210 + 14479e6 commit 96cd821
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/lib/
/bin/
**/application.properties
**/.DS_Store
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@ Fixed

Security

## [1.5.5] - 2024-04-22
Added
* Added new search endpoint '/api/v1/{index}/_search' to match default Elastic endpoints

Fixed
* Fixed accessibility of Swagger-UI ([#229](https://github.com/kit-data-manager/base-repo/issues/229))
* Fixed issue with internal authentication using JWT ([#261](https://github.com/kit-data-manager/service-base/pull/261))

Security
* Bump org.springframework.boot to 3.2.4
* Bump org.owasp.dependencycheck to 9.1.0
* Bump postgresql to 42.7.3
* Bump spring-messaging to 6.1.6
* Bump spring-data-elasticsearch to 5.2.5
* Bump spring-boot-admin-starter-client to 3.2.3
* Bump spring-cloud-gateway-mvc to 4.1.2
* Bump spring-cloud-starter-config to 4.1.1
* Bump spring-cloud-starter-netflix-eureka-client to 4.1.1
* Bump service-base to 1.3.1

## [1.5.4] - 2024-04-03
Added
* Allow builds outside Git repository, e.g., when building from release packages
Expand Down Expand Up @@ -243,7 +263,8 @@ Added

- First public version

[Unreleased]: https://github.com/kit-data-manager/base-repo/compare/v1.5.4...HEAD
[Unreleased]: https://github.com/kit-data-manager/base-repo/compare/v1.5.5...HEAD
[1.5.5]: https://github.com/kit-data-manager/base-repo/compare/v1.5.4...v1.5.5
[1.5.4]: https://github.com/kit-data-manager/base-repo/compare/v1.5.3...v1.5.4
[1.5.3]: https://github.com/kit-data-manager/base-repo/compare/v1.5.2...v1.5.3
[1.5.2]: https://github.com/kit-data-manager/base-repo/compare/v1.5.1...v1.5.2
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repositories {
ext {
set('javersVersion', "7.3.7")
set('springBootVersion', "3.2.1")
set('springDocVersion', "2.3.0")
set('springDocVersion', "2.5.0")
set('keycloakVersion', "19.0.0")

// directory for generated code snippets during tests
Expand Down Expand Up @@ -60,9 +60,9 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-mail"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation 'org.springframework.data:spring-data-elasticsearch:5.2.4'
implementation 'org.springframework.data:spring-data-elasticsearch:5.2.5'

implementation "org.springframework:spring-messaging:6.1.5"
implementation "org.springframework:spring-messaging:6.1.6"

// cloud support
implementation "org.springframework.cloud:spring-cloud-starter-config:4.1.1"
Expand All @@ -76,7 +76,7 @@ dependencies {
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:${springDocVersion}"

implementation "edu.kit.datamanager:repo-core:1.2.2"
implementation "edu.kit.datamanager:service-base:1.2.1"
implementation "edu.kit.datamanager:service-base:1.3.1"

//implementation "com.github.victools:jsonschema-generator:4.23.0"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,14 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.restdocs.RestDocsMockMvcConfigurationCustomizer;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentationConfigurer;
import org.springframework.restdocs.templates.TemplateFormats;
import org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestExecutionListeners;
Expand Down Expand Up @@ -146,7 +141,7 @@ public class DataResourceControllerTest {
private DataResource otherResource;
private DataResource revokedResource;
private DataResource fixedResource;

@Before
public void setUp() throws JsonProcessingException {
contentInformationAuditService = repositoryConfig.getContentInformationAuditService();
Expand Down Expand Up @@ -1793,10 +1788,10 @@ public void testCreateGetDeleteOfContentWithVersion() throws Exception {
this.mockMvc.perform(get("/api/v1/audit/" + resourceId + "/data/file.txt").header(HttpHeaders.AUTHORIZATION,
"Bearer " + userToken).header(HttpHeaders.ACCEPT, "application/vnd.datamanager.audit+json")).andDo(print()).andExpect(status().isOk()).andExpect(MockMvcResultMatchers.header().exists("Resource-Version")).andExpect(MockMvcResultMatchers.header().string("Resource-Version", "2"));

//get ETag
//get ETag
etag = this.mockMvc.perform(get("/api/v1/dataresources/" + resourceId + "/data/file.txt").header(HttpHeaders.AUTHORIZATION,
"Bearer " + userToken).header(HttpHeaders.ACCEPT, "application/vnd.datamanager.content-information+json")).andDo(print()).andExpect(status().isOk()).andExpect(MockMvcResultMatchers.jsonPath("$.tags[0]").value("success")).andReturn().getResponse().getHeader("ETag");

//delete content
this.mockMvc.perform(delete("/api/v1/dataresources/" + resourceId + "/data/file.txt").header(HttpHeaders.AUTHORIZATION,
"Bearer " + userToken).header("If-Match", etag).header(HttpHeaders.ACCEPT, "application/vnd.datamanager.content-information+json")).andDo(print()).andExpect(status().isNoContent());
Expand All @@ -1808,6 +1803,16 @@ public void testCreateGetDeleteOfContentWithVersion() throws Exception {
"Bearer " + userToken).header(HttpHeaders.ACCEPT, "application/vnd.datamanager.content-information+json")).andDo(print()).andExpect(status().isNotFound());
}

@Test
public void testSwaggerUI() throws Exception {

// Test for swagger definition
this.mockMvc.perform(get("/v3/api-docs"))
.andDo(print())
.andExpect(status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$.info.title", Matchers.startsWith("Repository")));
}

// @Test
// public void testObtainHealthInformation() throws Exception{
// this.mockMvc.perform(get("/actuator/health")).andDo(print()).andExpect(status().isOk()).andExpect(MockMvcResultMatchers.jsonPath("$.status").value("UP"));
Expand Down

0 comments on commit 96cd821

Please sign in to comment.