This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SearchResponse getSearchResponseFromJson(String jsonResponse) throws IOException { | |
var parser = JsonXContent.jsonXContent.createParser( | |
getDefaultNamedXContentRegistry(), | |
LoggingDeprecationHandler.INSTANCE, | |
jsonResponse); | |
return SearchResponse.fromXContent(parser); | |
} | |
private NamedXContentRegistry getDefaultNamedXContentRegistry() { | |
List<NamedXContentRegistry.Entry> entries = new ArrayList<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<profiles> | |
<profile> | |
<!-- Profil dédié pour la génération du json OpenAPI --> | |
<id>springdocs</id> | |
<activation> | |
<activeByDefault>false</activeByDefault> | |
</activation> | |
<properties> | |
<springdocs.host>http://localhost</springdocs.host> | |
<springdocs.port>9191</springdocs.port> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.NoArgsConstructor; | |
import lombok.extern.slf4j.Slf4j; | |
import org.jetbrains.annotations.NotNull; | |
import org.springframework.boot.test.util.TestPropertyValues; | |
import org.springframework.context.ConfigurableApplicationContext; | |
import org.springframework.test.context.ActiveProfiles; | |
import org.springframework.test.context.ContextConfiguration; | |
import org.testcontainers.containers.GenericContainer; | |
import org.testcontainers.utility.DockerImageName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unbind ZSH keys occupying VIM-like navigation shortcuts. | |
bindkey -r '^H' # Unbind Ctrl-h | |
bindkey -r '^J' # Unbind Ctrl-j | |
bindkey -r '^K' # Unbind Ctrl-k | |
bindkey -r '^L' # Unbind Ctrl-l | |
# Define functions calling Tmux pane navigation. | |
function tmux-navigate-left() { | |
tmux select-pane -L | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Compile if needed. | |
#mvn package -DskipTests | |
# Remove Maven logs and trim leading and trailing whitespaces with xargs. | |
cp=$(mvn -q dependency:build-classpath \ | |
-DincludeTypes=jar \ | |
-Dmdep.outputFile=/dev/stderr \ | |
2>&1 >/dev/null | grep -v -E '(DEBUG|INFO|WARNING)' | xargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:20 | |
EXPOSE 9090 | |
EXPOSE 9091 | |
EXPOSE 9092 | |
COPY /target/${project_name}-*.jar /app/app.jar | |
WORKDIR /app | |
# Enable remote debugging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Normalizes a {@link CharSequence} using the {@link Normalizer.Form#NFKC} method; | |
* It is a Unicode normalization form that replaces characters with their | |
* compatibility equivalents and then applies canonical composition. | |
* This method is useful for ensuring that strings containing different | |
* representations of the same characters are treated as equal. | |
* <p> | |
* Example 1: | |
* Input: "№123" | |
* Output: "No123" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filters the characters of a given CharSequence based on a provided IntPredicate. | |
* This method is useful for removing unwanted characters from a string, such as non-alphanumeric characters. | |
* | |
* @param cs The input CharSequence to be filtered. | |
* @param characterFilter The IntPredicate to determine which characters should be kept. | |
* @return A new String containing only the characters that satisfy the characterFilter. | |
*/ | |
private String filterCharacters(final CharSequence cs, final IntPredicate characterFilter) { | |
return cs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Utility for iterating over a folder located in the resources folder.<br> | |
* Methods using this method are responsible for closing or operate on the stream. | |
*/ | |
private static Stream<Path> getResourceFolderFiles (String folder) throws IOException, URISyntaxException { | |
final ClassLoader loader = Thread.currentThread().getContextClassLoader(); | |
final URI uri = Objects.requireNonNull(loader.getResource(folder)).toURI(); | |
final String path = Paths.get(uri).toString(); | |
return Files.walk(Paths.get(path)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test PRs' | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: |
NewerOlder