use of io.qameta.allure.Issue in project atsd-api-test by axibase.
the class LengthTest method testMaxLengthOverflow.
@Issue("2412")
@Test
public void testMaxLengthOverflow() throws Exception {
final Message message = new Message("e-message-max-len-overflow", "t-message-max-len-overflow");
message.setDate(getCurrentDate());
message.setSeverity(Severity.MAJOR.name());
message.setMessage("");
MessageCommand command = new MessageCommand(message);
Integer currentLength = command.compose().length();
String newMessage = new String(new char[MAX_LENGTH - currentLength + 1]).replace("\0", "m");
message.setMessage(newMessage);
command = new MessageCommand(message);
assertTrue("Command must have overflow length", command.compose().length() > MAX_LENGTH);
CommandSendingResult expectedResult = new CommandSendingResult(1, 0);
String assertMessage = String.format("Result must contain one failed command with length %s", command.compose().length());
assertEquals(assertMessage, expectedResult, CommandMethod.send(command));
}
use of io.qameta.allure.Issue in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsWhiteSpace.
@Issue("1278")
@Test
public void testMetricNameContainsWhiteSpace() throws Exception {
final Metric metric = new Metric("createreplace metric-1");
Response response = createOrReplaceMetric(metric);
assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), response.getStatus());
}
use of io.qameta.allure.Issue in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsCyrillic.
@Issue("1278")
@Test
public void testMetricNameContainsCyrillic() throws Exception {
final Metric metric = new Metric("createreplacйёmetric-3");
metric.setDataType(DataType.DECIMAL);
Response response = createOrReplaceMetric(metric);
assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to check metric inserted", metricExist(metric));
}
use of io.qameta.allure.Issue in project atsd-api-test by axibase.
the class MetricCreateOrReplaceTest method testMetricNameContainsSlash.
@Issue("1278")
@Test
public void testMetricNameContainsSlash() throws Exception {
final Metric metric = new Metric("createreplace/metric-2");
metric.setDataType(DataType.DECIMAL);
Response response = createOrReplaceMetric(metric);
assertEquals("Fail to execute createOrReplaceEntityGroup method", OK.getStatusCode(), response.getStatus());
assertTrue("Fail to check metric inserted", metricExist(metric));
}
use of io.qameta.allure.Issue in project atsd-api-test by axibase.
the class MetricGetTest method testURLEncodeNameWhiteSpace.
@Issue("1278")
@Test
public void testURLEncodeNameWhiteSpace() throws Exception {
final String name = "get metric-1";
Response response = queryMetric(name);
assertEquals("Method should fail if metricName contains whitespace", BAD_REQUEST.getStatusCode(), response.getStatus());
assertTrue(response.readEntity(String.class).contains("Invalid metric name"));
}
Aggregations