Skip to content

Commit

Permalink
remove setLiveChannelName method from RootRouteHeadersStepBuilder;
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
Stefan Maute committed Sep 29, 2021
1 parent 00a38d5 commit f3f7741
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
import akka.testkit.TestProbe;
import akka.testkit.javadsl.TestKit;

/**
* Tests {@link LiveSignalEnforcement} in context of an {@link EnforcerActor}.
*/
@SuppressWarnings({"squid:S3599", "squid:S1171"})
public final class LiveSignalEnforcementTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
import akka.testkit.javadsl.TestKit;
import scala.concurrent.duration.Duration;

/**
* Tests {@link ThingCommandEnforcement} in context of an {@link EnforcerActor}.
*/
@SuppressWarnings({"squid:S3599", "squid:S1171"})
public final class ThingCommandEnforcementTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,12 @@ private void handleWhoami(final Whoami command) {
}

/**
* Provide an adequate {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.WhoamiResponse} as answer for an {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.Whoami}.
* Provide an adequate {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.WhoamiResponse} as answer
* for an {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.Whoami}.
*
* @param request the request which should be answered.
* @return the correct {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.WhoamiResponse} for the {@code request}.
* @return the correct {@link org.eclipse.ditto.gateway.service.endpoints.routes.whoami.WhoamiResponse} for
* the {@code request}.
*/
// intentionally protected to allow overwriting this in extensions
protected WhoamiResponse createWhoamiResponse(final Whoami request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import org.eclipse.ditto.base.model.headers.DittoHeadersSizeChecker;
import org.eclipse.ditto.base.model.signals.commands.exceptions.GatewayDuplicateHeaderException;
import org.eclipse.ditto.protocol.HeaderTranslator;
import org.eclipse.ditto.protocol.TopicPath;

import akka.http.javadsl.model.HttpHeader;
import akka.http.javadsl.model.HttpMessage;
Expand Down Expand Up @@ -170,7 +169,6 @@ BuildStep withQueryParameters(final Map<String, String> queryParameters) {
avoidConflictingHeaders(headersFromQueryParameters);
dittoHeadersBuilder.putHeaders(filteredExternalHeaders);
dittoHeadersBuilder.putHeaders(headersFromQueryParameters);
setLiveChannelName(queryParameters);

return new BuildStep(dittoHeadersBuilder, requestContext);
}
Expand All @@ -192,18 +190,6 @@ private GatewayDuplicateHeaderException getDuplicateHeaderException(final String
.build();
}

/*
* If the "live" query param was set - no matter what the value was - use live channel.
*/
private void setLiveChannelName(final Map<String, String> queryParameters) {
final String liveChannelName = TopicPath.Channel.LIVE.getName();
if (null != queryParameters.get(liveChannelName)) {
dittoHeadersBuilder.channel(liveChannelName);
} else {
dittoHeadersBuilder.channel(null);
}
}

}

/**
Expand Down

0 comments on commit f3f7741

Please sign in to comment.