Skip to content

Commit

Permalink
resolve properties fix
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
  • Loading branch information
senivam committed Sep 24, 2020
1 parent 3b1d207 commit f8ae767
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -167,7 +167,7 @@ public <T> T resolveProperty(final String name, final T defaultValue) {

private <T> T resolveProperty(final String name, Object defaultValue, final Class<T> type) {
// Check runtime configuration first
Object result = clientConfig.getProperty(name);
Object result = getConfiguration().getProperty(name);
if (result != null) {
defaultValue = result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,13 @@ public Object run() throws NoSuchFieldException,
}
}

private void processExpect100Continue(ClientRequest request, HttpURLConnection uc,
private static void processExpect100Continue(ClientRequest request, HttpURLConnection uc,
long length, RequestEntityProcessing entityProcessing) {

final Boolean expectContinueActivated = ClientProperties.getValue(request.getConfiguration().getProperties(),
final Boolean expectContinueActivated = request.resolveProperty(
ClientProperties.EXPECT_100_CONTINUE, Boolean.class);
final Long expectContinueSizeThreshold = ClientProperties.getValue(
request.getConfiguration().getProperties(),
final Long expectContinueSizeThreshold = request.resolveProperty(
ClientProperties.EXPECT_100_CONTINUE_THRESHOLD_SIZE,
ClientProperties.DEFAULT_EXPECT_100_CONTINUE_THRESHOLD_SIZE, Long.class);
ClientProperties.DEFAULT_EXPECT_100_CONTINUE_THRESHOLD_SIZE);

final boolean allowStreaming = length > expectContinueSizeThreshold
|| entityProcessing == RequestEntityProcessing.CHUNKED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ protected Application configure() {
return new ResourceConfig(Expect100ContinueTest.Expect100ContinueResource.class);
}

@Override
protected void configureClient(ClientConfig config) {
config.connectorProvider(new HttpUrlConnectorProvider());
}

@Test
public void testExpect100Continue() {
final Response response = target(RESOURCE_PATH).request().post(Entity.text(ENTITY_STRING));
Expand Down

0 comments on commit f8ae767

Please sign in to comment.