Search in sources :

Example 1 with ExternalNetworkProviderConfigurations

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

the class BackendExternalProviderHelperTest method completeExternalNetworkProviderConfigurationsNoNameTest.

@Test
public void completeExternalNetworkProviderConfigurationsNoNameTest() {
    ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations(1);
    configurations.getExternalNetworkProviderConfigurations().get(0).getExternalNetworkProvider().setName(null);
    try {
        BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations(resource, configurations);
        fail("expected WebApplicationException");
    } catch (WebApplicationException wae) {
        verifyFault(wae, Response.Status.BAD_REQUEST.getStatusCode());
    }
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) ExternalNetworkProviderConfigurations(org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations) Test(org.junit.Test)

Example 2 with ExternalNetworkProviderConfigurations

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

the class BackendExternalProviderHelperTest method completeExternalNetworkProviderConfigurationsTest.

@Test
public void completeExternalNetworkProviderConfigurationsTest() {
    setUpQueryExpectations();
    ExternalNetworkProviderConfigurations configurations = getExternalNetworkProviderConfigurations(PROVIDER_COUNT);
    BackendExternalProviderHelper.completeExternalNetworkProviderConfigurations(resource, configurations);
    List<ExternalNetworkProviderConfiguration> configurationList = configurations.getExternalNetworkProviderConfigurations();
    for (int i = 0; i < PROVIDER_COUNT; i++) {
        verifyModel(configurationList.get(i).getExternalNetworkProvider(), i);
    }
}
Also used : ExternalNetworkProviderConfiguration(org.ovirt.engine.api.model.ExternalNetworkProviderConfiguration) ExternalNetworkProviderConfigurations(org.ovirt.engine.api.model.ExternalNetworkProviderConfigurations) Test(org.junit.Test)

Aggregations

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