use of com.endava.cats.model.generator.PayloadGenerator in project cats by Endava.
the class PayloadGeneratorTest method shouldReturnNotEmailWhenSchemaNull.
@Test
void shouldReturnNotEmailWhenSchemaNull() {
PayloadGenerator generator = new PayloadGenerator(globalContext, true);
Assertions.assertThat(generator.isEmailAddress(new Schema<>(), "field")).isFalse();
}
use of com.endava.cats.model.generator.PayloadGenerator in project cats by Endava.
the class PayloadGeneratorTest method shouldRecognizeIpAddressFromPropertyName.
@ParameterizedTest
@CsvSource({ "ip,true", "ipaddress,true", "hostIp,true", "something,false" })
void shouldRecognizeIpAddressFromPropertyName(String property, boolean expected) {
StringSchema schema = new StringSchema();
PayloadGenerator generator = new PayloadGenerator(globalContext, true);
boolean isIp = generator.isIPV4(schema, property);
Assertions.assertThat(isIp).isEqualTo(expected);
}
use of com.endava.cats.model.generator.PayloadGenerator in project cats by Endava.
the class PayloadGeneratorTest method shouldRecognizeIpAddressFromFormat.
@ParameterizedTest
@CsvSource({ "ip,true", "ipv4,true", "hostIp,false", "something,false" })
void shouldRecognizeIpAddressFromFormat(String format, boolean expected) {
StringSchema schema = new StringSchema();
schema.setFormat(format);
PayloadGenerator generator = new PayloadGenerator(globalContext, true);
boolean isIp = generator.isIPV4(schema, "field");
Assertions.assertThat(isIp).isEqualTo(expected);
}
use of com.endava.cats.model.generator.PayloadGenerator in project cats by Endava.
the class PayloadGeneratorTest method shouldRecognizeIpV6AddressFromPropertyFormat.
@Test
void shouldRecognizeIpV6AddressFromPropertyFormat() {
StringSchema schema = new StringSchema();
schema.setFormat("ipv6");
PayloadGenerator generator = new PayloadGenerator(globalContext, true);
boolean isIp = generator.isIPV6(schema, "something");
Assertions.assertThat(isIp).isTrue();
}
Aggregations