Search in sources :

Example 6 with InstanceRequest

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);
}
Also used : CollectionRequest(org.apache.atlas.catalog.CollectionRequest) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Request(org.apache.atlas.catalog.Request) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Test(org.testng.annotations.Test)

Example 7 with InstanceRequest

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);
}
Also used : CollectionRequest(org.apache.atlas.catalog.CollectionRequest) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Request(org.apache.atlas.catalog.Request) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Test(org.testng.annotations.Test)

Example 8 with InstanceRequest

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);
}
Also used : CollectionRequest(org.apache.atlas.catalog.CollectionRequest) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Request(org.apache.atlas.catalog.Request) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Test(org.testng.annotations.Test)

Example 9 with InstanceRequest

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);
}
Also used : CollectionRequest(org.apache.atlas.catalog.CollectionRequest) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Request(org.apache.atlas.catalog.Request) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Test(org.testng.annotations.Test)

Example 10 with InstanceRequest

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);
}
Also used : CollectionRequest(org.apache.atlas.catalog.CollectionRequest) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Request(org.apache.atlas.catalog.Request) InstanceRequest(org.apache.atlas.catalog.InstanceRequest) Test(org.testng.annotations.Test)

Aggregations

InstanceRequest (org.apache.atlas.catalog.InstanceRequest)24 CollectionRequest (org.apache.atlas.catalog.CollectionRequest)20 Request (org.apache.atlas.catalog.Request)20 Test (org.testng.annotations.Test)20 HashMap (java.util.HashMap)8 Path (javax.ws.rs.Path)4 Produces (javax.ws.rs.Produces)4 AtlasPerfTracer (org.apache.atlas.utils.AtlasPerfTracer)4 GET (javax.ws.rs.GET)2 Result (org.apache.atlas.catalog.Result)2 DELETE (javax.ws.rs.DELETE)1 POST (javax.ws.rs.POST)1 BaseRequest (org.apache.atlas.catalog.BaseRequest)1 TermPath (org.apache.atlas.catalog.TermPath)1