Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
4d0b5c7
remove @ComponentScan in favor of @SpringBootApplication
dennisvang May 6, 2026
872bffa
remove @EnableWebMvc in favor of the existing WebConfig (WebMvcConfig…
dennisvang May 6, 2026
e5396aa
remove @EnableAsync in favor of the existing AsyncConfig class
dennisvang May 6, 2026
182a883
remove redundant package name from @ConfigurationPropertiesScan
dennisvang May 6, 2026
0fcf75e
move the rdf4j sparql component scan to a separate Rdf4jConfig class
dennisvang May 6, 2026
91ab365
rename WebConfig to WebMvcConfig
dennisvang May 6, 2026
7cb7dd5
rename Rdf4jConfig to Rdf4jSparqlConfig
dennisvang May 6, 2026
9325090
add license to Rdf4jSparqlConfig.java
dennisvang May 6, 2026
6c23d15
remove unused imports from Application.java
dennisvang May 7, 2026
b341379
Merge branch 'support/1.19.x' into fix/887-application-annotations
dennisvang May 8, 2026
122df78
Merge branch 'support/1.19.x' into fix/887-application-annotations
dennisvang May 21, 2026
bdc7144
remove allow-bean-definition-overriding from BaseIntegrationTest
dennisvang May 21, 2026
243d700
remove SpringExtension from test base classes
dennisvang May 21, 2026
f56e7e9
Merge branch 'master' into fix/887-application-annotations
dennisvang Jun 9, 2026
65ba487
re-enable async processing in index trigger tests
dennisvang Jun 9, 2026
efb83c5
re-enable async request processing for index.ping.List_POST tests
dennisvang Jun 10, 2026
ea8ddbf
remove unused @AutoConfigureMockMvc from WebIntegrationTest class
dennisvang Jun 10, 2026
385300c
switch to WebEnvironment.RANDOM_PORT in WebIntegrationTest class
dennisvang Jun 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/main/java/org/fairdatateam/fairdatapoint/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@SpringBootApplication
@EnableWebMvc
@EnableAsync
@ComponentScan(basePackages = {
"org.eclipse.rdf4j.http.server.readonly.sparql",
"org.fairdatateam.fairdatapoint.*"
})
@ConfigurationPropertiesScan("org.fairdatateam.fairdatapoint.config.*")
@ConfigurationPropertiesScan
public class Application {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* The MIT License
* Copyright © 2017 FAIR Data Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.fairdatateam.fairdatapoint.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
* Make sure the SparqlQueryEvaluator implementation bean can be found (SparqlQueryEvaluatorDefault)
*/
@Configuration
@ComponentScan("org.eclipse.rdf4j.http.server.readonly.sparql")
public class Rdf4jSparqlConfig {
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

@Configuration
public class WebConfig implements WebMvcConfigurer {
public class WebMvcConfig implements WebMvcConfigurer {

@Autowired
private List<ErrorConverter> errorConverters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@
*/
package org.fairdatateam.fairdatapoint;

import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@ActiveProfiles(Profiles.TESTING)
@SpringBootTest(properties = {"spring.main.allow-bean-definition-overriding=true"})
@SpringBootTest
public abstract class BaseIntegrationTest {
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@
import org.fairdatateam.fairdatapoint.database.mongo.migration.development.MigrationRunner;
import org.fairdatateam.fairdatapoint.database.rdf.migration.development.RdfDevelopmentMigrationRunner;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@ActiveProfiles(Profiles.TESTING)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
@AutoConfigureMockMvc
// todo: in most cases we can probably use WebEnvironment.MOCK with MockMvc instead of TestRestTemplate (see #862)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public abstract class WebIntegrationTest {

public static final String ADMIN_TOKEN = "Bearer eyJhbGciOiJIUzUxMiJ9" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.EnableAsync;

import java.net.URI;
import java.util.List;
Expand Down Expand Up @@ -202,4 +204,16 @@ public void res404_triggerOne() {
assertThat("One AdminTrigger event is created", events.size(), is(equalTo(1)));
assertThat("Records correct client URL", events.get(0).getAdminTrigger().getClientUrl(), is(equalTo(entry.getClientUrl())));
}

/**
* Enables asynchronous request processing.
* This reproduces the exception handling behaviour of the production config,
* which causes RDF parsing exceptions to be ignored by the ExceptionControllerAdvice,
* because they occur in worker threads.
* The parsing exceptions should be reflected in the resulting IndexEntryState instead.
*/
@TestConfiguration
@EnableAsync
public static class AsyncConfig {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.EnableAsync;

import java.net.URI;
import java.util.HashMap;
Expand Down Expand Up @@ -177,4 +179,16 @@ public void res400_differentBody() {
// THEN
assertThat("Correct response code is received", result.getStatusCode(), is(equalTo(HttpStatus.BAD_REQUEST)));
}

/**
* Enables asynchronous request processing.
* This reproduces the exception handling behaviour of the production config,
* which causes RDF parsing exceptions to be ignored by the ExceptionControllerAdvice,
* because they occur in worker threads.
* The parsing exceptions should be reflected in the resulting IndexEntryState instead.
*/
@TestConfiguration
@EnableAsync
public static class AsyncConfig {
}
}
Loading