OfficeScenarioTests CoopShares+Assets #121

Merged
hsh-michaelhoennig merged 39 commits from feature/use-case-acceptance-tests-4 into master 2024-11-15 11:54:19 +01:00
2 changed files with 6 additions and 8 deletions
Showing only changes of commit 38c51cbf7b - Show all commits

View File

@ -3,7 +3,6 @@ package net.hostsharing.hsadminng.config;
import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.openapitools.jackson.nullable.JsonNullableModule; import org.openapitools.jackson.nullable.JsonNullableModule;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -11,7 +10,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import java.math.BigDecimal;
@Configuration @Configuration
public class JsonObjectMapperConfiguration { public class JsonObjectMapperConfiguration {

View File

@ -22,25 +22,25 @@ public class TemplateResolver {
enum PlaceholderPrefix { enum PlaceholderPrefix {
RAW('%') { RAW('%') {
@Override @Override
String convert(final Object value, final Resolver resolver) { String convert(final String value, final Resolver resolver) {
return value != null ? value.toString() : ""; return value != null ? value.toString() : "";
} }
}, },
JSON_QUOTED('$'){ JSON_QUOTED('$'){
@Override @Override
String convert(final Object value, final Resolver resolver) { String convert(final String value, final Resolver resolver) {
return jsonQuoted(value); return jsonQuoted(value);
} }
}, },
URI_ENCODED('&'){ URI_ENCODED('&'){
@Override @Override
String convert(final Object value, final Resolver resolver) { String convert(final String value, final Resolver resolver) {
return value != null ? URLEncoder.encode(value.toString(), StandardCharsets.UTF_8) : ""; return value != null ? URLEncoder.encode(value.toString(), StandardCharsets.UTF_8) : "";
} }
}, },
COMMENT('#'){ COMMENT('#'){
@Override @Override
String convert(final Object value, final Resolver resolver) { String convert(final String value, final Resolver resolver) {
return resolver == DROP_COMMENTS ? "" : value.toString(); return resolver == DROP_COMMENTS ? "" : value.toString();
} }
}; };
@ -59,7 +59,7 @@ public class TemplateResolver {
return Arrays.stream(values()).filter(p -> p.prefixChar == givenChar).findFirst().orElseThrow(); return Arrays.stream(values()).filter(p -> p.prefixChar == givenChar).findFirst().orElseThrow();
} }
abstract String convert(final Object value, final Resolver resolver); // FIXME: why Object and not String? abstract String convert(final String value, final Resolver resolver); // FIXME: why Object and not String?
} }
private final static Pattern pattern = Pattern.compile(",(\\s*})", Pattern.MULTILINE); private final static Pattern pattern = Pattern.compile(",(\\s*})", Pattern.MULTILINE);
@ -136,7 +136,7 @@ public class TemplateResolver {
} }
} }
final var content = new TemplateResolver(placeholder.toString(), properties).resolve(resolver); final var content = new TemplateResolver(placeholder.toString(), properties).resolve(resolver);
final var value = intro != '#' ? propVal(content) : content; final var value = intro != '#' ? propVal(content).toString() : content;
resolved.append( resolved.append(
PlaceholderPrefix.ofPrefixChar(intro).convert(value, resolver) PlaceholderPrefix.ofPrefixChar(intro).convert(value, resolver)
); );