try {
Properties chefConfig = new Properties();
chefConfig.put(ChefProperties.CHEF_VALIDATOR_NAME, validator);
chefConfig.put(ChefProperties.CHEF_VALIDATOR_CREDENTIAL, credentialForClient(validator));
ContextBuilder builder = ContextBuilder.newBuilder(new ChefApiMetadata()) //
.credentials(client, credentialForClient(client)) //
.modules(ImmutableSet.<Module> of(new SLF4JLoggingModule())) //
.overrides(chefConfig); //
System.out.printf(">> initializing %s%n", builder.getApiMetadata());