Skip to content

Commit 65ba487

Browse files
committed
re-enable async processing in index trigger tests
1 parent f56e7e9 commit 65ba487

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/test/java/org/fairdatateam/fairdatapoint/acceptance/index/admin/List_Trigger_POST.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
import org.junit.jupiter.api.DisplayName;
3535
import org.junit.jupiter.api.Test;
3636
import org.springframework.beans.factory.annotation.Autowired;
37+
import org.springframework.boot.test.context.TestConfiguration;
3738
import org.springframework.core.ParameterizedTypeReference;
3839
import org.springframework.http.HttpHeaders;
3940
import org.springframework.http.HttpStatus;
4041
import org.springframework.http.RequestEntity;
4142
import org.springframework.http.ResponseEntity;
43+
import org.springframework.scheduling.annotation.EnableAsync;
4244

4345
import java.net.URI;
4446
import java.util.List;
@@ -202,4 +204,16 @@ public void res404_triggerOne() {
202204
assertThat("One AdminTrigger event is created", events.size(), is(equalTo(1)));
203205
assertThat("Records correct client URL", events.get(0).getAdminTrigger().getClientUrl(), is(equalTo(entry.getClientUrl())));
204206
}
207+
208+
/**
209+
* Enables asynchronous request processing.
210+
* This reproduces the exception handling behaviour of the production config,
211+
* which causes RDF parsing exceptions to be ignored by the ExceptionControllerAdvice,
212+
* because they occur in worker threads.
213+
* The parsing exceptions should be reflected in the resulting IndexEntryState instead.
214+
*/
215+
@TestConfiguration
216+
@EnableAsync
217+
public static class AsyncConfig {
218+
}
205219
}

0 commit comments

Comments
 (0)