use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class TradeEntityTest method prepareData.
@BeforeClass
public void prepareData() throws Exception {
Entity entity = new Entity();
entity.setName(entity());
Entity entityTwo = new Entity();
entityTwo.setName(entityTwo());
Trade tradeOne = fromISOString("2020-06-15T10:21:49.123456Z").setPrice(BigDecimal.ONE);
Trade tradeTwo = fromISOString("2020-06-15T12:21:49.123456Z").setSymbol(symbolTwo()).setPrice(BigDecimal.TEN);
insert(tradeOne, tradeTwo);
Checker.check(new EntityCheck(entity));
Checker.check(new EntityCheck(entityTwo));
entity.setTags(TestUtil.createTags("a", "10", "b", "abc"));
entity.setLabel("entity1");
EntityMethod.updateEntity(entity);
entityTwo.setEnabled(false);
entityTwo.setLabel("entity2");
entityTwo.setTags(TestUtil.createTags("a", "15", "b", "def"));
EntityMethod.updateEntity(entityTwo);
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class SqlInsertNonExistentEntityTest method testEntityCreationWithAtsdSeriesWhenInserting.
@Test(description = "Tests that entity is created after INSERT INTO command with atsd_series if it did not exist.")
@Issue("5962")
public void testEntityCreationWithAtsdSeriesWhenInserting() {
Entity entity = new Entity(Mocks.entity());
String sqlQuery = insertionType.insertionQuery("atsd_series", ImmutableMap.of("entity", entity.getName(), "datetime", ISO_TIME, String.format("\"%s\"", metric), VALUE));
assertOkRequest("Insertion of series with nonexistent entity via atsd_series failed!", sqlQuery);
Checker.check(new EntityCheck(entity));
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class SqlInsertNonExistentEntityTest method testEntityCreationWhenInserting.
@Test(description = "Tests that entity is created after INSERT INTO command if it did not exist.")
@Issue("5962")
public void testEntityCreationWhenInserting() {
Entity entity = new Entity(Mocks.entity());
String sqlQuery = insertionType.insertionQuery(metric, ImmutableMap.of("entity", entity.getName(), "datetime", ISO_TIME, "value", VALUE));
assertOkRequest("Insertion of series with nonexistent entity failed!", sqlQuery);
Checker.check(new EntityCheck(entity));
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class TokenEntityTest method testUpdateMethod.
@Test(description = "Tests entity update endpoint.")
@Issue("6052")
public void testUpdateMethod() throws Exception {
String entityName = Mocks.entity();
String url = "/entities/" + entityName;
String token = TokenRepository.getToken(username, "PATCH", url);
Entity entity = new Entity(entityName);
createOrReplaceEntityCheck(entity);
entity.setLabel(Mocks.LABEL);
updateEntity(entity, token);
Checker.check(new EntityCheck(entity));
}
use of com.axibase.tsd.api.method.checks.EntityCheck in project atsd-api-test by axibase.
the class DualTokenTest method testFirstUrl.
@Test(description = "Tests work of first url with dual token.")
@Issue("6052")
public void testFirstUrl() {
Entity entity = new Entity(entityName);
EntityMethod.createOrReplaceEntity(entity, token);
Checker.check(new EntityCheck(entity));
}
Aggregations