Skip to content

Commit

Permalink
Merge pull request #1292 from bosch-io/bugfix/time-placeholder-in-hea…
Browse files Browse the repository at this point in the history
…der-mapping

fix that placeholder `time:now` did not resolve to the current time
  • Loading branch information
Stefan Maute committed Jan 25, 2022
2 parents 93b816c + d3de1e8 commit b9b609b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 b9b609b

Please sign in to comment.