Merge branch 'master' of github.com:thingsboard/thingsboard
This commit is contained in:
commit
c7f6ea2b54
@ -423,7 +423,7 @@ public abstract class AbstractWebTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected <T> ResultActions doPost(String urlTemplate, T content, String... params) throws Exception {
|
protected <T> ResultActions doPost(String urlTemplate, T content, String... params) throws Exception {
|
||||||
MockHttpServletRequestBuilder postRequest = post(urlTemplate);
|
MockHttpServletRequestBuilder postRequest = post(urlTemplate, params);
|
||||||
setJwtToken(postRequest);
|
setJwtToken(postRequest);
|
||||||
String json = json(content);
|
String json = json(content);
|
||||||
postRequest.contentType(contentType).content(json);
|
postRequest.contentType(contentType).content(json);
|
||||||
@ -431,7 +431,7 @@ public abstract class AbstractWebTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected <T> ResultActions doPostAsync(String urlTemplate, T content, Long timeout, String... params) throws Exception {
|
protected <T> ResultActions doPostAsync(String urlTemplate, T content, Long timeout, String... params) throws Exception {
|
||||||
MockHttpServletRequestBuilder postRequest = post(urlTemplate);
|
MockHttpServletRequestBuilder postRequest = post(urlTemplate, params);
|
||||||
setJwtToken(postRequest);
|
setJwtToken(postRequest);
|
||||||
String json = json(content);
|
String json = json(content);
|
||||||
postRequest.contentType(contentType).content(json);
|
postRequest.contentType(contentType).content(json);
|
||||||
|
|||||||
@ -114,6 +114,7 @@ public class BaseEntityService extends AbstractEntityService implements EntitySe
|
|||||||
return this.entityQueryDao.findEntityDataByQuery(tenantId, customerId, query);
|
return this.entityQueryDao.findEntityDataByQuery(tenantId, customerId, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: 3.1 Remove this from project.
|
||||||
@Override
|
@Override
|
||||||
public ListenableFuture<String> fetchEntityNameAsync(TenantId tenantId, EntityId entityId) {
|
public ListenableFuture<String> fetchEntityNameAsync(TenantId tenantId, EntityId entityId) {
|
||||||
log.trace("Executing fetchEntityNameAsync [{}]", entityId);
|
log.trace("Executing fetchEntityNameAsync [{}]", entityId);
|
||||||
|
|||||||
@ -182,24 +182,4 @@ public class JpaBaseEventDao extends JpaAbstractDao<EventEntity, Event> implemen
|
|||||||
return Optional.of(DaoUtil.getData(eventInsertRepository.saveOrUpdate(entity)));
|
return Optional.of(DaoUtil.getData(eventInsertRepository.saveOrUpdate(entity)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Specification<EventEntity> getEntityFieldsSpec(UUID tenantId, EntityId entityId, String eventType) {
|
|
||||||
return (root, criteriaQuery, criteriaBuilder) -> {
|
|
||||||
List<Predicate> predicates = new ArrayList<>();
|
|
||||||
if (tenantId != null) {
|
|
||||||
Predicate tenantIdPredicate = criteriaBuilder.equal(root.get("tenantId"), tenantId);
|
|
||||||
predicates.add(tenantIdPredicate);
|
|
||||||
}
|
|
||||||
if (entityId != null) {
|
|
||||||
Predicate entityTypePredicate = criteriaBuilder.equal(root.get("entityType"), entityId.getEntityType());
|
|
||||||
predicates.add(entityTypePredicate);
|
|
||||||
Predicate entityIdPredicate = criteriaBuilder.equal(root.get("entityId"), entityId.getId());
|
|
||||||
predicates.add(entityIdPredicate);
|
|
||||||
}
|
|
||||||
if (eventType != null) {
|
|
||||||
Predicate eventTypePredicate = criteriaBuilder.equal(root.get("eventType"), eventType);
|
|
||||||
predicates.add(eventTypePredicate);
|
|
||||||
}
|
|
||||||
return criteriaBuilder.and(predicates.toArray(new Predicate[]{}));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user