Skip to content

Commit

Permalink
Fix the issue of ChangeFeedProcessorCodeSnippet (#12894)
Browse files Browse the repository at this point in the history
  • Loading branch information
Melanie-Ma authored Jul 9, 2020
1 parent be3d197 commit 8705591
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.
package com.azure.cosmos;

import com.azure.cosmos.implementation.TestConfigurations;
import com.fasterxml.jackson.databind.JsonNode;

/**
Expand All @@ -11,7 +12,12 @@ public class ChangeFeedProcessorCodeSnippet {

public void changeFeedProcessorBuilderCodeSnippet() {
String hostName = "test-host-name";
CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder().buildAsyncClient();
CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder()
.endpoint(TestConfigurations.HOST)
.key(TestConfigurations.MASTER_KEY)
.contentResponseOnWriteEnabled(true)
.consistencyLevel(ConsistencyLevel.SESSION)
.buildAsyncClient();
CosmosAsyncDatabase cosmosAsyncDatabase = cosmosAsyncClient.getDatabase("testDb");
CosmosAsyncContainer feedContainer = cosmosAsyncDatabase.getContainer("feedContainer");
CosmosAsyncContainer leaseContainer = cosmosAsyncDatabase.getContainer("leaseContainer");
Expand All @@ -31,7 +37,12 @@ public void changeFeedProcessorBuilderCodeSnippet() {

public void handleChangesCodeSnippet() {
String hostName = "test-host-name";
CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder().buildAsyncClient();
CosmosAsyncClient cosmosAsyncClient = new CosmosClientBuilder()
.endpoint(TestConfigurations.HOST)
.key(TestConfigurations.MASTER_KEY)
.contentResponseOnWriteEnabled(true)
.consistencyLevel(ConsistencyLevel.SESSION)
.buildAsyncClient();
CosmosAsyncDatabase cosmosAsyncDatabase = cosmosAsyncClient.getDatabase("testDb");
CosmosAsyncContainer feedContainer = cosmosAsyncDatabase.getContainer("feedContainer");
CosmosAsyncContainer leaseContainer = cosmosAsyncDatabase.getContainer("leaseContainer");
Expand Down

0 comments on commit 8705591

Please sign in to comment.