use of io.spine.users.UserId in project core-java by SpineEventEngine.
the class TestsShould method create_UserId_by_string.
@Test
public void create_UserId_by_string() {
final String testIdString = "12345";
final UserId userId = newUserId(testIdString);
final UserId expected = UserId.newBuilder().setValue(testIdString).build();
assertEquals(expected, userId);
}
use of io.spine.users.UserId in project core-java by SpineEventEngine.
the class StringifiersShould method convert_from_message_to_json.
@Test
public void convert_from_message_to_json() {
final String idValue = newUuid();
final UserId userId = UserId.newBuilder().setValue(idValue).build();
final Stringifier<UserId> messageStringifier = StringifierRegistry.getStringifier(UserId.class);
final String convertedMessage = messageStringifier.convert(userId);
assertNotNull(convertedMessage);
assertTrue(convertedMessage.contains(idValue));
}
use of io.spine.users.UserId in project core-java by SpineEventEngine.
the class JsonShould method parse_from_json.
@Test
public void parse_from_json() {
final String idValue = newUuid();
final String jsonMessage = String.format("{value:%s}", idValue);
final UserId userId = fromJson(jsonMessage, UserId.class);
assertNotNull(userId);
assertEquals(idValue, userId.getValue());
}
Aggregations