Merge branch 'master' of github.com:thingsboard/thingsboard

This commit is contained in:
Igor Kulikov 2020-07-15 15:41:00 +03:00
commit c7f6ea2b54
3 changed files with 3 additions and 22 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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[]{}));
};
}
} }