Search in sources :

Example 1 with TestUtils.randomString

use of org.apache.atlas.TestUtils.randomString in project incubator-atlas by apache.

the class AtlasEntityStoreV1Test method testCreateRequiredAttrNull.

@Test(expectedExceptions = AtlasBaseException.class)
public void testCreateRequiredAttrNull() throws Exception {
    //Update required attribute
    Map<String, AtlasEntity> tableCloneMap = new HashMap<>();
    AtlasEntity tableEntity = new AtlasEntity(TABLE_TYPE);
    tableEntity.setAttribute(TestUtilsV2.NAME, "table_" + TestUtils.randomString());
    tableCloneMap.put(tableEntity.getGuid(), tableEntity);
    entityStore.createOrUpdate(new InMemoryMapEntityStream(tableCloneMap), false);
    Assert.fail("Expected exception while creating with required attribute null");
}
Also used : HashMap(java.util.HashMap) AtlasEntity(org.apache.atlas.model.instance.AtlasEntity) TestUtils.randomString(org.apache.atlas.TestUtils.randomString) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

HashMap (java.util.HashMap)1 TestUtils.randomString (org.apache.atlas.TestUtils.randomString)1 AtlasEntity (org.apache.atlas.model.instance.AtlasEntity)1 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1