Search in sources :

Example 1 with Tenant

use of org.apache.dolphinscheduler.dao.entity.Tenant in project dolphinscheduler by apache.

the class ResourcesServiceTest method getTenant.

private Tenant getTenant() {
    Tenant tenant = new Tenant();
    tenant.setTenantCode("123");
    return tenant;
}
Also used : Tenant(org.apache.dolphinscheduler.dao.entity.Tenant)

Example 2 with Tenant

use of org.apache.dolphinscheduler.dao.entity.Tenant in project dolphinscheduler by apache.

the class UsersServiceTest method getTenant.

/**
 * get tenant
 * @return tenant
 */
private Tenant getTenant() {
    Tenant tenant = new Tenant();
    tenant.setId(1);
    return tenant;
}
Also used : Tenant(org.apache.dolphinscheduler.dao.entity.Tenant)

Example 3 with Tenant

use of org.apache.dolphinscheduler.dao.entity.Tenant in project dolphinscheduler by apache.

the class TenantServiceTest method getTenant.

/**
 * get   tenant
 * @return
 */
private Tenant getTenant(int id) {
    Tenant tenant = new Tenant();
    tenant.setId(id);
    tenant.setTenantCode(tenantCode);
    tenant.setTenantName(tenantName);
    return tenant;
}
Also used : Tenant(org.apache.dolphinscheduler.dao.entity.Tenant)

Example 4 with Tenant

use of org.apache.dolphinscheduler.dao.entity.Tenant in project dolphinscheduler by apache.

the class ResourceMapperTest method testQueryTenantCodeByResourceName.

/**
 * test query tenant code by resource name
 */
@Test
public void testQueryTenantCodeByResourceName() {
    Tenant tenant = new Tenant();
    tenant.setTenantName("ut tenant ");
    tenant.setTenantCode("ut tenant code for resource");
    tenantMapper.insert(tenant);
    User user = new User();
    user.setTenantId(tenant.getId());
    user.setUserName("ut user");
    userMapper.insert(user);
    Resource resource = insertOne();
    resource.setUserId(user.getId());
    resourceMapper.updateById(resource);
    String resource1 = resourceMapper.queryTenantCodeByResourceName(resource.getFullName(), ResourceType.FILE.ordinal());
    Assert.assertEquals("ut tenant code for resource", resource1);
}
Also used : Tenant(org.apache.dolphinscheduler.dao.entity.Tenant) ResourcesUser(org.apache.dolphinscheduler.dao.entity.ResourcesUser) User(org.apache.dolphinscheduler.dao.entity.User) Resource(org.apache.dolphinscheduler.dao.entity.Resource) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with Tenant

use of org.apache.dolphinscheduler.dao.entity.Tenant in project dolphinscheduler by apache.

the class TenantMapperTest method testQuery.

/**
 * test query
 */
@Test
public void testQuery() {
    Tenant tenant = insertOne();
    // query
    List<Tenant> tenants = tenantMapper.selectList(null);
    Assert.assertNotEquals(tenants.size(), 0);
}
Also used : Tenant(org.apache.dolphinscheduler.dao.entity.Tenant) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

Tenant (org.apache.dolphinscheduler.dao.entity.Tenant)14 Test (org.junit.Test)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 Date (java.util.Date)4 HashMap (java.util.HashMap)3 Queue (org.apache.dolphinscheduler.dao.entity.Queue)2 User (org.apache.dolphinscheduler.dao.entity.User)2 Transactional (org.springframework.transaction.annotation.Transactional)2 IPage (com.baomidou.mybatisplus.core.metadata.IPage)1 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)1 ProcessDefinition (org.apache.dolphinscheduler.dao.entity.ProcessDefinition)1 ProcessInstance (org.apache.dolphinscheduler.dao.entity.ProcessInstance)1 Resource (org.apache.dolphinscheduler.dao.entity.Resource)1 ResourcesUser (org.apache.dolphinscheduler.dao.entity.ResourcesUser)1