Compare commits
3 Commits
be4898474c
...
e934726c4b
Author | SHA1 | Date | |
---|---|---|---|
|
e934726c4b | ||
|
880b2aa99a | ||
|
38c51cbf7b |
@ -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 {
|
||||||
|
@ -69,7 +69,7 @@ class HsOfficeCoopAssetsTransactionRepositoryIntegrationTest extends ContextBase
|
|||||||
final var newCoopAssetsTransaction = HsOfficeCoopAssetsTransactionEntity.builder()
|
final var newCoopAssetsTransaction = HsOfficeCoopAssetsTransactionEntity.builder()
|
||||||
.membership(givenMembership)
|
.membership(givenMembership)
|
||||||
.transactionType(HsOfficeCoopAssetsTransactionType.DEPOSIT)
|
.transactionType(HsOfficeCoopAssetsTransactionType.DEPOSIT)
|
||||||
.assetValue(new BigDecimal("6,400.00"))
|
.assetValue(new BigDecimal("6400.00"))
|
||||||
.valueDate(LocalDate.parse("2022-10-18"))
|
.valueDate(LocalDate.parse("2022-10-18"))
|
||||||
.reference("temp ref A")
|
.reference("temp ref A")
|
||||||
.build();
|
.build();
|
||||||
|
@ -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 Object value, final Resolver resolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static Pattern pattern = Pattern.compile(",(\\s*})", Pattern.MULTILINE);
|
private final static Pattern pattern = Pattern.compile(",(\\s*})", Pattern.MULTILINE);
|
||||||
@ -150,12 +150,12 @@ public class TemplateResolver {
|
|||||||
} else if (nameExpression.contains(IF_NOT_FOUND_SYMBOL)) {
|
} else if (nameExpression.contains(IF_NOT_FOUND_SYMBOL)) {
|
||||||
final var parts = StringUtils.split(nameExpression, IF_NOT_FOUND_SYMBOL);
|
final var parts = StringUtils.split(nameExpression, IF_NOT_FOUND_SYMBOL);
|
||||||
return Arrays.stream(parts).filter(Objects::nonNull).findFirst().orElseGet(() -> {
|
return Arrays.stream(parts).filter(Objects::nonNull).findFirst().orElseGet(() -> {
|
||||||
if ( parts[parts.length-1].isEmpty() ) {
|
if ( parts[parts.length-1].isEmpty() ) {
|
||||||
// => whole expression ends with IF_NOT_FOUND_SYMBOL, thus last null element was optional
|
// => whole expression ends with IF_NOT_FOUND_SYMBOL, thus last null element was optional
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// => last alternative element in expression was null and not optional
|
// => last alternative element in expression was null and not optional
|
||||||
throw new IllegalStateException("Missing required value in property-chain: " + nameExpression);
|
throw new IllegalStateException("Missing required value in property-chain: " + nameExpression);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
final var val = properties.get(nameExpression);
|
final var val = properties.get(nameExpression);
|
||||||
|
Loading…
Reference in New Issue
Block a user