Search in sources :

Example 6 with Language

use of org.molgenis.data.i18n.model.Language in project molgenis by molgenis.

the class LanguageRepositoryDecoratorTest method testDeleteById.

@Test(expectedExceptions = MolgenisDataException.class, expectedExceptionsMessageRegExp = MESSAGE_DELETE_NOT_ALLOWED)
public void testDeleteById() {
    Language language = getMockLanguage(LANGUAGE_CODE_NL);
    when(delegateRepository.findOneById(LANGUAGE_CODE_NL)).thenReturn(language);
    languageRepositoryDecorator.deleteById(LANGUAGE_CODE_NL);
}
Also used : Language(org.molgenis.data.i18n.model.Language) Test(org.testng.annotations.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Example 7 with Language

use of org.molgenis.data.i18n.model.Language in project molgenis by molgenis.

the class LanguageRepositoryDecoratorTest method testAddUnknownLanguage.

@Test(expectedExceptions = MolgenisDataException.class, expectedExceptionsMessageRegExp = MESSAGE_ADD_NOT_ALLOWED)
public void testAddUnknownLanguage() {
    Language language = getMockLanguage("unknownLanguage");
    languageRepositoryDecorator.add(Stream.of(language));
}
Also used : Language(org.molgenis.data.i18n.model.Language) Test(org.testng.annotations.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Example 8 with Language

use of org.molgenis.data.i18n.model.Language in project molgenis by molgenis.

the class LanguageRepositoryDecoratorTest method testAddExistingLanguage.

@Test
public void testAddExistingLanguage() {
    Language language = getMockLanguage(LANGUAGE_CODE_NL);
    languageRepositoryDecorator.add(Stream.of(language));
    verify(delegateRepository).add(language);
}
Also used : Language(org.molgenis.data.i18n.model.Language) Test(org.testng.annotations.Test) AbstractMockitoTest(org.molgenis.test.AbstractMockitoTest)

Aggregations

Language (org.molgenis.data.i18n.model.Language)8 AbstractMockitoTest (org.molgenis.test.AbstractMockitoTest)5 Test (org.testng.annotations.Test)5