Search in sources :

Example 1 with ExternalProviders

use of org.ovirt.engine.api.model.ExternalProviders in project ovirt-engine by oVirt.

the class BackendExternalProviderHelperTest method completeExternalProvidersTest.

@Test
public void completeExternalProvidersTest() {
    setUpQueryExpectations();
    ExternalProviders providers = getExternalProviders(PROVIDER_COUNT);
    BackendExternalProviderHelper.completeExternalProviders(resource, providers);
    List<ExternalProvider> providerList = providers.getExternalProviders();
    for (int i = 0; i < PROVIDER_COUNT; i++) {
        verifyModel(providerList.get(i), i);
    }
}
Also used : ExternalProvider(org.ovirt.engine.api.model.ExternalProvider) ExternalProviders(org.ovirt.engine.api.model.ExternalProviders) Test(org.junit.Test)

Example 2 with ExternalProviders

use of org.ovirt.engine.api.model.ExternalProviders in project ovirt-engine by oVirt.

the class BackendExternalProviderHelperTest method completeExternalProvidersNoNameTest.

@Test
public void completeExternalProvidersNoNameTest() {
    ExternalProviders providers = getExternalProviders(1);
    providers.getExternalProviders().get(0).setName(null);
    try {
        BackendExternalProviderHelper.completeExternalProviders(resource, providers);
        fail("expected WebApplicationException");
    } catch (WebApplicationException wae) {
        verifyFault(wae, Response.Status.BAD_REQUEST.getStatusCode());
    }
}
Also used : ExternalProviders(org.ovirt.engine.api.model.ExternalProviders) WebApplicationException(javax.ws.rs.WebApplicationException) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ExternalProviders (org.ovirt.engine.api.model.ExternalProviders)2 WebApplicationException (javax.ws.rs.WebApplicationException)1 ExternalProvider (org.ovirt.engine.api.model.ExternalProvider)1