use of org.apache.qpid.server.model.preferences.PreferenceImpl in project qpid-broker-j by apache.
the class LatestManagementControllerTest method createPreferences.
private UUID createPreferences(final Subject testSubject, final QueueManagingVirtualHost<?> virtualHost, final String preferenceType, final String preferenceName, final Map<String, Object> preferenceValue) throws Exception {
UUID uuid = UUID.randomUUID();
final Preference preference = new PreferenceImpl(virtualHost, uuid, preferenceName, preferenceType, "Some preference", null, new Date(), new Date(), null, new GenericPreferenceValueFactory().createInstance(preferenceValue));
final List<Preference> preferenceList = Collections.singletonList(preference);
final Future<Void> result = Subject.doAs(testSubject, (PrivilegedAction<Future<Void>>) () -> virtualHost.getUserPreferences().updateOrAppend(preferenceList));
result.get(2000L, TimeUnit.MILLISECONDS);
return uuid;
}
Aggregations