Skip to content

Commit

Permalink
upgrade dependencies
Browse files Browse the repository at this point in the history
this contains a workaround in EditorialContentController during procedural
route mapping creation. Once Spring v5.3.14 is released, the static
method from the workaround can be replaced with a call to the
`RequestMappingInfo.BuilderConfiguration` getter introduced in
spring-projects/spring-framework#27723
  • Loading branch information
JKatzwinkel committed Dec 10, 2021
1 parent dea6bd0 commit a0f0967
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![build](https://github.com/JKatzwinkel/tla-web/workflows/build/badge.svg)
![deploy](https://github.com/JKatzwinkel/tla-web/workflows/deploy/badge.svg)
![LINE](https://img.shields.io/badge/line--coverage-91.75%25-brightgreen.svg)
![METHOD](https://img.shields.io/badge/method--coverage-85.66%25-brightgreen.svg)
![LINE](https://img.shields.io/badge/line--coverage-91.82%25-brightgreen.svg)
![METHOD](https://img.shields.io/badge/method--coverage-85.69%25-brightgreen.svg)

TLA web frontend.

Expand Down
40 changes: 20 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ plugins {
id 'jacoco'
id 'application'
id 'maven-publish'
id 'co.uzzu.dotenv.gradle' version '1.1.0'
id 'co.uzzu.dotenv.gradle' version '1.2.0'
id 'de.undercouch.download' version '4.1.2'
id 'org.springframework.boot' version '2.5.3'
id 'org.springframework.boot' version '2.6.1'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'com.github.dawnwords.jacoco.badge' version '0.2.4'
}

group = 'org.bbaw.aaew.tla'
version = '0.0.821'
version = '0.0.822'
sourceCompatibility = '11'

ext {
Expand Down Expand Up @@ -71,30 +71,30 @@ configurations {
}

dependencies {
implementation 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
implementation 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'

implementation 'org.modelmapper:modelmapper:2.4.4'
implementation 'org.modelmapper:modelmapper:2.4.5'
implementation 'org.jooq:jool:0.9.14'

implementation 'org.springframework.boot:spring-boot-starter-web:2.6.0-M1'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.6.0-M1'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:2.5.3'
implementation 'org.slf4j:slf4j-simple:2.0.0-alpha2'
implementation 'org.springframework.boot:spring-boot-starter-web:2.6.1'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:2.6.1'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.0.0'
implementation 'org.slf4j:slf4j-simple:2.0.0-alpha5'
implementation 'org.apache.commons:commons-lang3:3.12.0'

implementation 'com.github.jkatzwinkel:tla-common:master-SNAPSHOT'
implementation 'com.github.jkatzwinkel:tla-common:main-SNAPSHOT'
implementation 'com.github.rosmord.jsesh:jsesh:release-7.5.5'

testImplementation 'org.seleniumhq.selenium:selenium-remote-driver:4.0.0-beta-4'
testImplementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.0.0-beta-4'
testImplementation 'org.seleniumhq.selenium:selenium-support:4.0.0-beta-4'
testImplementation 'org.testcontainers:selenium:1.16.0'
testImplementation 'org.testcontainers:junit-jupiter:1.16.0'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.0-M1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.0-M1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.0-M1'
testImplementation 'org.seleniumhq.selenium:selenium-remote-driver:4.1.0'
testImplementation 'org.seleniumhq.selenium:selenium-chrome-driver:4.1.0'
testImplementation 'org.seleniumhq.selenium:selenium-support:4.1.0'
testImplementation 'org.testcontainers:selenium:1.16.2'
testImplementation 'org.testcontainers:junit-jupiter:1.16.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.6.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}

task installAssets {
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
environment:
ES_JAVA_OPTS: -Xms512m -Xmx512m
discovery.type: single-node
xpack.security.enabled: "false"
ingest.geoip.downloader.enabled: "false"
ports:
- ${ES_PORT:-9200}:9200
stdin_open: true
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/tla/web/mvc/EditorialContentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.RequestMappingInfo.BuilderConfiguration;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -192,6 +193,20 @@ public String renderEditorial(
return "editorial";
}


// TODO: this is a workaround snatched from
// TODO: https://github.com/qaware/openapi-generator-for-spring/blob/5b95aefe436fc5e4c9e36a5df829e0f43c2ca5aa/openapi-generator-for-spring-webmvc/src/main/java/de/qaware/openapigeneratorforspring/autoconfigure/OpenApiGeneratorWebMvcAutoConfiguration.java#L61-L76
// TODO: once spring 5.3.14 is out, replace with RequestMappingHandlerMapping#getRequestMappingInfoBuilderConfiguration from
// TODO: https://github.com/spring-projects/spring-framework/pull/27723/files
public static BuilderConfiguration handlerMappingBuilderConfig(RequestMappingHandlerMapping handlerMapping) {
BuilderConfiguration config = new BuilderConfiguration();
config.setTrailingSlashMatch(handlerMapping.useTrailingSlashMatch());
config.setContentNegotiationManager(handlerMapping.getContentNegotiationManager());
config.setPatternParser(handlerMapping.getPatternParser());
return config;
}


/**
* Creates request handler mappings for editorial pages previously registered in the
* {@link EditorialRegistry}.
Expand All @@ -210,7 +225,9 @@ public void onApplicationReady(ApplicationReadyEvent event) throws NoSuchMethodE
this.editorialRegistry.getLangSupport().forEach(
(path, supportedLanguages) -> {
handlerMapping.registerMapping(
RequestMappingInfo.paths(path).methods(RequestMethod.GET).build(),
RequestMappingInfo.paths(path).methods(RequestMethod.GET).options(
handlerMappingBuilderConfig(handlerMapping)
).build(),
this,
handlerMethod
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tla/web/mvc/MvcConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;

import nz.net.ultraq.thymeleaf.LayoutDialect;
import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect;
import tla.web.config.ApplicationProperties;
import tla.web.model.mappings.BTSMarkupConverter;
import tla.web.model.mappings.LanguageFromStringConverter;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/tla/web/mvc/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ public void onApplicationReady(ApplicationReadyEvent event) {
handlerMapping.registerMapping(
RequestMappingInfo.paths(
this.getSearchResultsPageRoute(controller)
).methods(RequestMethod.GET).build(),
).methods(RequestMethod.GET).options(
EditorialContentController.handlerMappingBuilderConfig(handlerMapping)
).build(),
controller,
method
);
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/tla/web/mvc/LemmaDetailsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void testLemmaDetails_hieratic(Language lang) throws Exception {
xpath("//div[@id='passport-properties']").doesNotExist()
).andExpect(
xpath("//div[contains(@class,'bibliography')]/p/span/span[contains(@class,'bibliographic-reference')]").nodeCount(3)
).andExpect(
).andExpect(
xpath("//div[contains(@class,'bibliography')]/p/span/span[contains(@class,'bibliographic-reference')]/text()").string(
"Wb 1, 130.1-5"
)
Expand Down

0 comments on commit a0f0967

Please sign in to comment.