Search in sources :

Example 1 with TranslationUtilsService

use of com.qcadoo.view.api.utils.TranslationUtilsService in project qcadoo by qcadoo.

the class TranslationUtilsServiceTest method init.

@Before
public final void init() {
    translationService = mock(TranslationService.class);
    item = mock(Entity.class);
    category = mock(Entity.class);
    locale = Locale.getDefault();
    when(item.getStringField("pluginIdentifier")).thenReturn(PLUGIN_IDENTIFIER);
    when(category.getStringField("pluginIdentifier")).thenReturn(PLUGIN_IDENTIFIER);
    when(item.getStringField("name")).thenReturn(ITEM_NAME);
    when(category.getStringField("name")).thenReturn(CATEGORY_NAME);
    when(item.getBelongsToField("category")).thenReturn(category);
    translationUtilsService = new TranslationUtilsService();
    ReflectionTestUtils.setField(translationUtilsService, "translationService", translationService);
}
Also used : Entity(com.qcadoo.model.api.Entity) TranslationUtilsService(com.qcadoo.view.api.utils.TranslationUtilsService) TranslationService(com.qcadoo.localization.api.TranslationService) Before(org.junit.Before)

Aggregations

TranslationService (com.qcadoo.localization.api.TranslationService)1 Entity (com.qcadoo.model.api.Entity)1 TranslationUtilsService (com.qcadoo.view.api.utils.TranslationUtilsService)1 Before (org.junit.Before)1