Skip to content

Commit

Permalink
Addresing comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
codingwhatever committed Oct 18, 2016
1 parent bfebe62 commit 4caa0eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ protected DruidWebService buildDruidWebService(DruidServiceConfig druidServiceCo
protected Supplier<Map<String, String>> buildDruidWebServiceHeaderSupplier() {
Supplier<Map<String, String>> supplier = HashMap::new;
String customSupplierClassString = SYSTEM_CONFIG.getStringProperty(DRUID_HEADER_SUPPLIER_CLASS, null);
if (customSupplierClassString != null && customSupplierClassString != "") {
if (customSupplierClassString != null && customSupplierClassString.equals("")) {
try {
Class<?> c = Class.forName(customSupplierClassString);
Constructor<?> constructor = c.getConstructor();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.druid.client.impl

import com.yahoo.bard.webservice.druid.client.DruidClientConfigHelper
Expand All @@ -20,7 +22,7 @@ class AsyncDruidWebServiceImplSpec extends Specification {
queryContext.numberOfQueries() >> { 1 }
queryContext.getSequenceNumber() >> { 1 }

when:
and:
Map<String, String> expectedHeaders = new HashMap<>()
expectedHeaders.put("k1", "v1")
expectedHeaders.put("k2", "v2")
Expand All @@ -30,12 +32,13 @@ class AsyncDruidWebServiceImplSpec extends Specification {
return expectedHeaders
}
}

AsyncDruidWebServiceImplWrapper webServiceImplWrapper = new AsyncDruidWebServiceImplWrapper(
DruidClientConfigHelper.getNonUiServiceConfig(),
new ObjectMapper(),
supplier
)

when:
webServiceImplWrapper.postDruidQuery(
null,
null,
Expand All @@ -47,7 +50,7 @@ class AsyncDruidWebServiceImplSpec extends Specification {
then:
HttpHeaders actualHeaders = webServiceImplWrapper.getHeaders()
for (Map.Entry<String, String> header : expectedHeaders) {
actualHeaders.get(header.getKey()) == header.getValue()
assert actualHeaders.get(header.getKey()) == header.getValue()
}
}
}

0 comments on commit 4caa0eb

Please sign in to comment.