use of com.google.protobuf.Descriptors.FieldDescriptor in project core-java by SpineEventEngine.
the class FieldShould method pass_the_null_tolerance_check.
@Test
public void pass_the_null_tolerance_check() {
final FieldDescriptor defaultFieldDescriptor = StringValue.getDefaultInstance().getDescriptorForType().getFields().get(0);
new NullPointerTester().setDefault(TypeUrl.class, TypeUrl.of(StringValue.class)).setDefault(FieldDescriptor.class, defaultFieldDescriptor).testAllPublicStaticMethods(Messages.class);
}
use of com.google.protobuf.Descriptors.FieldDescriptor in project core-java by SpineEventEngine.
the class FieldValidatorFactoryShould method create_Boolean_field_validator.
@Test
public void create_Boolean_field_validator() {
final FieldDescriptor field = BoolValue.getDescriptor().getFields().get(0);
final FieldValidator validator = FieldValidatorFactory.create(field, new Object(), FIELD_PATH);
assertTrue(validator instanceof BooleanFieldValidator);
}
use of com.google.protobuf.Descriptors.FieldDescriptor in project core-java by SpineEventEngine.
the class FieldValidatorFactoryShould method create_String_field_validator.
@Test
public void create_String_field_validator() {
final FieldDescriptor field = StringValue.getDescriptor().getFields().get(0);
final FieldValidator validator = FieldValidatorFactory.create(field, "", FIELD_PATH);
assertTrue(validator instanceof StringFieldValidator);
}
use of com.google.protobuf.Descriptors.FieldDescriptor in project core-java by SpineEventEngine.
the class FieldValidatorFactoryShould method create_float_field_validator.
@Test
public void create_float_field_validator() {
final FieldDescriptor field = FloatValue.getDescriptor().getFields().get(0);
final FieldValidator validator = FieldValidatorFactory.create(field, 0, FIELD_PATH);
assertTrue(validator instanceof FloatFieldValidator);
}
use of com.google.protobuf.Descriptors.FieldDescriptor in project core-java by SpineEventEngine.
the class FieldValidatorFactoryShould method create_message_field_validator.
@Test
public void create_message_field_validator() {
final FieldDescriptor field = RequiredMsgFieldValue.getDescriptor().getFields().get(0);
final FieldValidator validator = FieldValidatorFactory.create(field, StringValue.getDefaultInstance(), FIELD_PATH);
assertTrue(validator instanceof MessageFieldValidator);
}
Aggregations