Search in sources :

Example 1 with ShowcaseTypeAdapter

use of com.yandex.money.api.typeadapters.model.showcase.ShowcaseTypeAdapter in project yandex-money-sdk-java by yandex-money.

the class ModelTests method testShowcase.

@Test
public void testShowcase() {
    ShowcaseTypeAdapter adapter = ShowcaseTypeAdapter.getInstance();
    checkTypeAdapter("/showcase/showcase-1.json", adapter);
}
Also used : ShowcaseTypeAdapter(com.yandex.money.api.typeadapters.model.showcase.ShowcaseTypeAdapter) Test(org.testng.annotations.Test)

Example 2 with ShowcaseTypeAdapter

use of com.yandex.money.api.typeadapters.model.showcase.ShowcaseTypeAdapter in project yandex-money-sdk-java by yandex-money.

the class ShowcaseTypeAdapterTest method testShowcase.

private static void testShowcase(String fileName) {
    ShowcaseTypeAdapter adapter = ShowcaseTypeAdapter.getInstance();
    check(fileName, adapter);
    try {
        Showcase showcase = adapter.fromJson(Resources.load(getPath(fileName)));
        Object allowedMoneySource = showcase.moneySources.get(0);
        assertEquals(allowedMoneySource.getClass(), AllowedMoneySource.class);
    } catch (FileNotFoundException e) {
        fail();
    }
}
Also used : ShowcaseTypeAdapter(com.yandex.money.api.typeadapters.model.showcase.ShowcaseTypeAdapter) Showcase(com.yandex.money.api.model.showcase.Showcase) FileNotFoundException(java.io.FileNotFoundException)

Aggregations

ShowcaseTypeAdapter (com.yandex.money.api.typeadapters.model.showcase.ShowcaseTypeAdapter)2 Showcase (com.yandex.money.api.model.showcase.Showcase)1 FileNotFoundException (java.io.FileNotFoundException)1 Test (org.testng.annotations.Test)1