@Test public void writeParentKeys_noParentKey() { KeyDto keyDto = mock(KeyDto.class); given(keyDto.getParentKey()).willReturn(null); given(keyDto.getKind()).willReturn("some_kind"); given(keyDto.getId()).willReturn(1L); String prettifiedKey = keyPrettifier.prettifyKey(keyDto); assertEquals("some_kind (1)", prettifiedKey); }
public String prettifyKey(KeyDto key) { if (key == null) { return ""; } String parentValue = writeParentKeys(key); String kind = key.getKind(); long id = key.getId(); String name = key.getName(); String idName = getIdName(id, name); return parentValue + appMessages.keyPrettifyTemplate(kind, idName); }
KeyPrettifier { public String prettifyKey(KeyDto key) { if (key == null) { return ""; } String parentValue = writeParentKeys(key); String kind = key.getKind(); long id = key.getId(); String name = key.getName(); String idName = getIdName(id, name); return parentValue + appMessages.keyPrettifyTemplate(kind, idName); } }
KeyPrettifier { public String prettifyKey(KeyDto key) { if (key == null) { return ""; } String parentValue = writeParentKeys(key); String kind = key.getKind(); long id = key.getId(); String name = key.getName(); String idName = getIdName(id, name); return parentValue + appMessages.keyPrettifyTemplate(kind, idName); } @Inject  KeyPrettifier(
            AppMessages appMessages); }
KeyPrettifier { public String prettifyKey(KeyDto key) { if (key == null) { return ""; } String parentValue = writeParentKeys(key); String kind = key.getKind(); long id = key.getId(); String name = key.getName(); String idName = getIdName(id, name); return parentValue + appMessages.keyPrettifyTemplate(kind, idName); } @Inject  KeyPrettifier(
            AppMessages appMessages); String prettifyKey(KeyDto key); }
KeyPrettifier { public String prettifyKey(KeyDto key) { if (key == null) { return ""; } String parentValue = writeParentKeys(key); String kind = key.getKind(); long id = key.getId(); String name = key.getName(); String idName = getIdName(id, name); return parentValue + appMessages.keyPrettifyTemplate(kind, idName); } @Inject  KeyPrettifier(
            AppMessages appMessages); String prettifyKey(KeyDto key);  }