use of com.google.protobuf.Message in project core-java by SpineEventEngine.
the class ValidateShould method verify_that_message_is_not_in_default_state.
@Test
public void verify_that_message_is_not_in_default_state() {
final Message msg = Wrapper.forString("check_if_message_is_not_in_default_state");
assertTrue(isNotDefault(msg));
assertFalse(isNotDefault(StringValue.getDefaultInstance()));
}
use of com.google.protobuf.Message in project core-java by SpineEventEngine.
the class ValidateShould method verify_that_message_is_in_default_state.
@Test
public void verify_that_message_is_in_default_state() {
final Message nonDefault = newUuidValue();
assertTrue(isDefault(StringValue.getDefaultInstance()));
assertFalse(isDefault(nonDefault));
}
use of com.google.protobuf.Message in project core-java by SpineEventEngine.
the class MessageValidatorShould method minDecimalNumberTest.
/*
* Utility methods.
*/
private void minDecimalNumberTest(double value, boolean inclusive, boolean isValid) {
final Message msg = inclusive ? DecimalMinIncNumberFieldValue.newBuilder().setValue(value).build() : DecimalMinNotIncNumberFieldValue.newBuilder().setValue(value).build();
validate(msg);
assertIsValid(isValid);
}
use of com.google.protobuf.Message in project core-java by SpineEventEngine.
the class MessageValidatorShould method digitsCountTest.
private void digitsCountTest(double value, boolean isValid) {
final Message msg = DigitsCountNumberFieldValue.newBuilder().setValue(value).build();
validate(msg);
assertIsValid(isValid);
}
use of com.google.protobuf.Message in project core-java by SpineEventEngine.
the class RecordBasedRepositoryShould method assertMatches.
private static <E extends AbstractVersionableEntity<?, ?>> void assertMatches(E entity, FieldMask fieldMask) {
final Message state = entity.getState();
Tests.assertMatchesMask(state, fieldMask);
}
Aggregations