use of org.thingsboard.server.dao.model.ModelConstants.NULL_UUID in project thingsboard by thingsboard.
the class JpaUserDaoTest method saveUser.
private void saveUser(UUID tenantId, UUID customerId) {
User user = new User();
UUID id = UUIDs.timeBased();
user.setId(new UserId(id));
user.setTenantId(new TenantId(tenantId));
user.setCustomerId(new CustomerId(customerId));
if (customerId == NULL_UUID) {
user.setAuthority(Authority.TENANT_ADMIN);
} else {
user.setAuthority(Authority.CUSTOMER_USER);
}
String idString = id.toString();
String email = idString.substring(0, idString.indexOf('-')) + "@thingsboard.org";
user.setEmail(email);
userDao.save(user);
}
Aggregations