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();
}
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();
}
Aggregations