Skip to content

Commit

Permalink
#85 MkRegion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Nov 19, 2016
1 parent bcf7a07 commit 1b3c552
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/jcabi/dynamo/mock/MkItem.java
Expand Up @@ -99,8 +99,13 @@ public AttributeValue get(final String name) throws IOException {
}

@Override
public boolean has(final String name) {
return this.attributes.containsKey(name.toUpperCase(Locale.ENGLISH));
public boolean has(final String name) throws IOException {
return this.data.iterate(
this.table,
new Conditions().withAttributes(
this.attributes.only(this.data.keys(this.table))
)
).iterator().next().containsKey(name.toLowerCase(Locale.ENGLISH));
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/jcabi/dynamo/mock/MkRegionTest.java
Expand Up @@ -66,6 +66,7 @@ public void storesAndReadsAttributes() throws Exception {
.with(attr, "first value to \n\t€ save")
);
final Item item = table.frame().iterator().next();
MatcherAssert.assertThat(item.has(attr), Matchers.is(true));
MatcherAssert.assertThat(
item.get(attr).getS(),
Matchers.containsString("\n\t\u20ac save")
Expand Down

0 comments on commit 1b3c552

Please sign in to comment.