anchor.diff:     meck:new(erlcloud_aws, [passthrough]),
      meck:expect(erlcloud_aws, auto_config, fun() -> {ok, #aws_config{}} end),
   
  -   {ok, Config} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),   
  +   {ok, Ddb} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),   
   
      meck:unload(erlcloud_aws),
   
  -   {ddb, AwsCfg, <<"oauth2pubkey">>, <<"access">>} = Config,
  -   "http://" = AwsCfg#aws_config.ddb_scheme,
  -   "localhost" = AwsCfg#aws_config.ddb_host,
  -   8000 = AwsCfg#aws_config.ddb_port.
  +   {ddb, Config, <<"oauth2pubkey">>, <<"access">>} = Ddb,
  +   "http://" = Config#aws_config.ddb_scheme,
  +   "localhost" = Config#aws_config.ddb_host,
  +   8000 = Config#aws_config.ddb_port.
   
  +%%
  +put(_Config) ->
  +   meck:new(erlcloud_aws, [passthrough]),
  +   meck:expect(erlcloud_aws, auto_config, fun() -> {ok, #aws_config{}} end),
  +   meck:new(erlcloud_ddb2, [passthrough]),
  +   meck:expect(erlcloud_ddb2, put_item, fun(_, _, _, _) -> ok end),
   
  -   +   {ok, Ddb} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),
  +   {ok, Key} = oauth2_ddb:put(Ddb, #{<<"access">> => <<"access">>, <<"secret">> => <<"secret">>}),
  +
  +   meck:unload(erlcloud_aws),
  +   meck:unload(erlcloud_ddb2),
  +
  +   <<"access">> = Key.
  +
  +%%
  +get(_Config) ->
  +   meck:new(erlcloud_aws, [passthrough]),
  +   meck:expect(erlcloud_aws, auto_config, fun() -> {ok, #aws_config{}} end),
  +   meck:new(erlcloud_ddb2, [passthrough]),
  +   meck:expect(erlcloud_ddb2, get_item, 
  +      fun(_, _, _, _) -> 
  +         {ok, [{<<"access">>, <<"access">>}, {<<"secret">>, <<"secret">>}]} 
  +      end
  +   ),
  +
  +   {ok, Ddb} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),
  +   {ok, Val} = oauth2_ddb:get(Ddb, <<"access">>),
  +
  +   meck:unload(erlcloud_aws),
  +   meck:unload(erlcloud_ddb2),
  +
  +   #{
  +      <<"access">> := <<"access">>
  +     ,<<"secret">> := <<"secret">>
  +   } = Val.
  +
  +%%
  +remove(_Config) ->
  +   meck:new(erlcloud_aws, [passthrough]),
  +   meck:expect(erlcloud_aws, auto_config, fun() -> {ok, #aws_config{}} end),
  +   meck:new(erlcloud_ddb2, [passthrough]),
  +   meck:expect(erlcloud_ddb2, delete_item, fun(_, _, _, _) -> ok end),
  +
  +   {ok, Ddb} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),
  +   {ok, Key} = oauth2_ddb:remove(Ddb, <<"access">>),
  +
  +   meck:unload(erlcloud_aws),
  +   meck:unload(erlcloud_ddb2),
  +
  +   <<"access">> = Key.
  +   
  +%%
  +match(_Config) ->
  +   meck:new(erlcloud_aws, [passthrough]),
  +   meck:expect(erlcloud_aws, auto_config, fun() -> {ok, #aws_config{}} end),
  +   meck:new(erlcloud_ddb2, [passthrough]),
  +   meck:expect(erlcloud_ddb2, q, 
  +      fun(_, _, _, _) -> 
  +         {ok, [
  +            [{<<"access">>, <<"access1">>}, {<<"secret">>, <<"secret1">>}]
  +           ,[{<<"access">>, <<"access2">>}, {<<"secret">>, <<"secret2">>}]
  +         ]} 
  +      end
  +   ),
  +
  +   {ok, Ddb} = oauth2_ddb:new(uri:new("http://localhost:8000/oauth2pubkey?hashkey=access")),
  +   {ok, Val} = oauth2_ddb:match(Ddb, <<"master">>, [{<<"master">>, <<"access">>}]),
  +
  +   meck:unload(erlcloud_aws),
  +   meck:unload(erlcloud_ddb2),
  +
  +   [
  +      #{
  +         <<"access">> := <<"access1">>
  +        ,<<"secret">> := <<"secret1">>
  +      },
  +      #{
  +         <<"access">> := <<"access2">>
  +        ,<<"secret">> := <<"secret2">>
  +      }
  +   ] = Val.
  +
  
positive.code:    [
        %%
        %% 
        {ddb, [parallel], 
           [encode, decode, new]}
     ].
  
  %%%----------------------------------------------------------------------------   
  
negative.code:    end_per_group/2
  ]).
  
  -export([encode/1, decode/1, new/1, put/1, get/1, remove/1, match/1]).
  
  %%%----------------------------------------------------------------------------   
  %%%
  