use of org.apache.atlas.catalog.InstanceRequest in project incubator-atlas by apache.
the class TermResourceDefinitionTest method testValidate_invalidTermName.
@Test(expectedExceptions = InvalidPayloadException.class)
public void testValidate_invalidTermName() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put("name", "NotQualifiedTermName");
properties.put("description", "foo");
properties.put("available_as_tag", true);
Request request = new InstanceRequest(properties);
ResourceDefinition termDefinition = new TermResourceDefinition();
termDefinition.validateCreatePayload(request);
}
use of org.apache.atlas.catalog.InstanceRequest in project incubator-atlas by apache.
the class TermResourceDefinitionTest method testValidate_invalidProperty.
@Test(expectedExceptions = InvalidPayloadException.class)
public void testValidate_invalidProperty() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put("name", "foo");
properties.put("unknownProperty", "value");
Request request = new InstanceRequest(properties);
ResourceDefinition termDefinition = new TermResourceDefinition();
termDefinition.validateCreatePayload(request);
}
use of org.apache.atlas.catalog.InstanceRequest in project incubator-atlas by apache.
the class EntityTagResourceDefinitionTest method testValidate.
@Test
public void testValidate() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put("name", "taxonomy1.termName");
Request request = new InstanceRequest(properties);
ResourceDefinition entityTagDefinition = new EntityTagResourceDefinition();
entityTagDefinition.validateCreatePayload(request);
}
use of org.apache.atlas.catalog.InstanceRequest in project incubator-atlas by apache.
the class EntityTagResourceDefinitionTest method testValidate_missingName.
@Test(expectedExceptions = InvalidPayloadException.class)
public void testValidate_missingName() throws Exception {
Map<String, Object> properties = new HashMap<>();
Request request = new InstanceRequest(properties);
ResourceDefinition entityTagDefinition = new EntityTagResourceDefinition();
entityTagDefinition.validateCreatePayload(request);
}
use of org.apache.atlas.catalog.InstanceRequest in project incubator-atlas by apache.
the class EntityTagResourceDefinitionTest method testValidate_invalidProperty.
@Test(expectedExceptions = InvalidPayloadException.class)
public void testValidate_invalidProperty() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put("name", "foo");
properties.put("description", "desc");
Request request = new InstanceRequest(properties);
ResourceDefinition entityTagDefinition = new EntityTagResourceDefinition();
entityTagDefinition.validateCreatePayload(request);
}
Aggregations