Search in sources :

Example 1 with MappingLocator

use of org.ovirt.engine.api.restapi.types.MappingLocator in project ovirt-engine by oVirt.

the class AbstractBackendBaseTest method setUp.

@Before
public void setUp() {
    interactions.clear();
    DbUser currentUser = new DbUser();
    currentUser.setFirstName(USER);
    currentUser.setLastName(USER);
    currentUser.setDomain(DOMAIN);
    currentUser.setNamespace(NAMESPACE);
    currentUser.setId(GUIDS[0]);
    Current current = new Current();
    current.setUser(currentUser);
    current.setSessionId(SESSION_ID);
    current.setRoot(URI_ROOT);
    current.setPrefix(BASE_PATH);
    current.setPath("");
    current.setVersion("4");
    current.setVersionSource(VersionSource.DEFAULT);
    current.setBackend(backend);
    CurrentManager.put(current);
    locales = new ArrayList<>();
    when(httpHeaders.getAcceptableLanguages()).thenReturn(locales);
    accepts = new ArrayList<>();
    when(httpHeaders.getRequestHeader("Accept")).thenReturn(accepts);
    List<String> filterValue = new ArrayList<>();
    filterValue.add("false");
    when(httpHeaders.getRequestHeader(USER_FILTER_HEADER)).thenReturn(filterValue);
    mapperLocator = new MappingLocator();
    mapperLocator.populate();
    locale = Locale.getDefault();
    Locale.setDefault(Locale.GERMANY);
    messageBundle = new MessageBundle();
    messageBundle.setPath(BUNDLE_PATH);
    messageBundle.populate();
    init();
}
Also used : MessageBundle(org.ovirt.engine.api.restapi.logging.MessageBundle) ArrayList(java.util.ArrayList) Current(org.ovirt.engine.api.restapi.invocation.Current) MappingLocator(org.ovirt.engine.api.restapi.types.MappingLocator) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser) Before(org.junit.Before)

Example 2 with MappingLocator

use of org.ovirt.engine.api.restapi.types.MappingLocator in project ovirt-engine by oVirt.

the class BackendApiResource method init.

private void init() {
    // Create and populate the message bundle:
    messageBundle = new MessageBundle();
    messageBundle.setPath(Messages.class.getName());
    messageBundle.populate();
    // Create and populate the mapping locator:
    mappingLocator = new MappingLocator();
    mappingLocator.populate();
}
Also used : MessageBundle(org.ovirt.engine.api.restapi.logging.MessageBundle) Messages(org.ovirt.engine.api.restapi.logging.Messages) MappingLocator(org.ovirt.engine.api.restapi.types.MappingLocator)

Aggregations

MessageBundle (org.ovirt.engine.api.restapi.logging.MessageBundle)2 MappingLocator (org.ovirt.engine.api.restapi.types.MappingLocator)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 Current (org.ovirt.engine.api.restapi.invocation.Current)1 Messages (org.ovirt.engine.api.restapi.logging.Messages)1 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)1