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;
}
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;
}
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;
}
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);
}
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);
}
Aggregations