Skip to content

Commit

Permalink
Address @garyluoex's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Jun 7, 2017
1 parent 98b63c8 commit 350efed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void processResponse(JsonNode json, DruidAggregationQuery<?> druidQuery,
} else if (statusCode == Status.OK.getStatusCode()) { // If response is a OK, cache it, including etag
// make sure JSON response comes with etag
if (!json.has(DruidJsonResponseContentKeys.ETAG.getName())) {
logAndGetErrorCallback(ErrorMessageFormat.ETAG_MISSING_FROM_RESPONSE.format(), druidQuery);
LOG.warn(ErrorMessageFormat.ETAG_MISSING_FROM_RESPONSE.format());
} else {
try {
dataCache.set(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module

import org.slf4j.Logger

import spock.lang.Specification

class EtagCacheResponseProcessorSpec extends Specification {
Expand Down Expand Up @@ -83,11 +85,6 @@ class EtagCacheResponseProcessorSpec extends Specification {
etagCacheResponseProcessor.processResponse(json, druidAggregationQuery, Mock(LoggingContext))

then:
1 * httpErrorCallback.dispatch(
INTERNAL_SERVER_ERROR_STATUS_CODE,
ErrorMessageFormat.INTERNAL_SERVER_ERROR_REASON_PHRASE.format(),
ErrorMessageFormat.ETAG_MISSING_FROM_RESPONSE.format()
)
1 * next.processResponse(null, druidAggregationQuery, _ as LoggingContext)
}

Expand Down

0 comments on commit 350efed

Please sign in to comment.