PathMetadataDynamoDBTranslation { static DDBPathMetadata itemToPathMetadata(Item item, String username) throws IOException { return itemToPathMetadata(item, username, false); } private  PathMetadataDynamoDBTranslation();   }
@Test public void testItemToPathMetadata() throws IOException { final String user = UserGroupInformation.getCurrentUser().getShortUserName(); assertNull(itemToPathMetadata(null, user)); verify(TEST_DIR_ITEM, itemToPathMetadata(TEST_DIR_ITEM, user)); verify(TEST_FILE_ITEM, itemToPathMetadata(TEST_FILE_ITEM, user)); }
@Test public void testIsAuthoritativeCompatibilityItemToPathMetadata() throws Exception { Item item = Mockito.spy(TEST_DIR_ITEM); item.withBoolean(IS_AUTHORITATIVE, true); final String user = UserGroupInformation.getCurrentUser().getShortUserName(); DDBPathMetadata meta = itemToPathMetadata(item, user, true); Mockito.verify(item, Mockito.never()).getBoolean(IS_AUTHORITATIVE); assertFalse(meta.isAuthoritativeDir()); }