Skip to content

Commit

Permalink
fix that placeholder time:now did not resolve to the current time w…
Browse files Browse the repository at this point in the history
…hen used in a connection's headerMapping

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Jan 24, 2022
1 parent 93b816c commit d3de1e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Expand Up @@ -74,7 +74,7 @@ public static ResourcePlaceholder newResourcePlaceholder() {
/**
* @return the singleton instance of {@link TimePlaceholder}
*/
public static TimePlaceholder newMiscPlaceholder() {
public static TimePlaceholder newTimePlaceholder() {
return TimePlaceholder.getInstance();
}

Expand Down
Expand Up @@ -65,7 +65,7 @@ private Resolvers() {
}),
ResolverCreator.of(ConnectivityPlaceholders.newTopicPathPlaceholder(), (e, s, t, a, c) -> t),
ResolverCreator.of(ConnectivityPlaceholders.newResourcePlaceholder(), (e, s, t, a, c) -> s),
ResolverCreator.of(ConnectivityPlaceholders.newMiscPlaceholder(), (e, s, t, a, c) -> null),
ResolverCreator.of(ConnectivityPlaceholders.newTimePlaceholder(), (e, s, t, a, c) -> new Object()),
ResolverCreator.of(ConnectivityPlaceholders.newRequestPlaceholder(), (e, s, t, a, c) -> a),
ResolverCreator.of(ConnectivityPlaceholders.newConnectionIdPlaceholder(), (e, s, t, a, c) -> c)
);
Expand Down
Expand Up @@ -107,7 +107,7 @@ protected void validateTarget(final Target target, final DittoHeaders dittoHeade
ConnectivityPlaceholders.newThingPlaceholder(),
ConnectivityPlaceholders.newTopicPathPlaceholder(),
ConnectivityPlaceholders.newResourcePlaceholder(),
ConnectivityPlaceholders.newMiscPlaceholder(),
ConnectivityPlaceholders.newTimePlaceholder(),
newHeadersPlaceholder(),
ConnectivityPlaceholders.newFeaturePlaceholder());
validateTargetAddress(target.getAddress(), dittoHeaders, targetDescription);
Expand Down
Expand Up @@ -14,11 +14,11 @@

import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newEntityPlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newFeaturePlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newMiscPlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newPolicyPlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newResourcePlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newSourceAddressPlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newThingPlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newTimePlaceholder;
import static org.eclipse.ditto.connectivity.api.placeholders.ConnectivityPlaceholders.newTopicPathPlaceholder;
import static org.eclipse.ditto.placeholders.PlaceholderFactory.newHeadersPlaceholder;

Expand Down Expand Up @@ -115,7 +115,7 @@ protected void validateTarget(final Target target, final DittoHeaders dittoHeade

validateTargetQoS(qos.get(), dittoHeaders, targetDescription);
validateTemplate(target.getAddress(), dittoHeaders, newThingPlaceholder(), newTopicPathPlaceholder(),
newResourcePlaceholder(), newMiscPlaceholder(), newHeadersPlaceholder(), newFeaturePlaceholder());
newResourcePlaceholder(), newTimePlaceholder(), newHeadersPlaceholder(), newFeaturePlaceholder());
}

/**
Expand Down

0 comments on commit d3de1e8

Please sign in to comment.