use of org.apache.qpid.server.model.ConfiguredObjectFactoryImpl in project qpid-broker-j by apache.
the class HttpManagementTest method setUp.
@Before
public void setUp() throws Exception {
_id = UUID.randomUUID();
_broker = mock(Broker.class);
ConfiguredObjectFactory objectFactory = new ConfiguredObjectFactoryImpl(BrokerModel.getInstance());
when(_broker.getObjectFactory()).thenReturn(objectFactory);
when(_broker.getModel()).thenReturn(objectFactory.getModel());
when(_broker.getCategoryClass()).thenReturn(Broker.class);
when(_broker.getEventLogger()).thenReturn(mock(EventLogger.class));
TaskExecutor taskExecutor = new TaskExecutorImpl();
taskExecutor.start();
when(_broker.getTaskExecutor()).thenReturn(taskExecutor);
when(_broker.getChildExecutor()).thenReturn(taskExecutor);
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, false);
attributes.put(HttpManagement.HTTPS_BASIC_AUTHENTICATION_ENABLED, true);
attributes.put(HttpManagement.HTTP_SASL_AUTHENTICATION_ENABLED, false);
attributes.put(HttpManagement.HTTPS_SASL_AUTHENTICATION_ENABLED, true);
attributes.put(HttpManagement.NAME, getTestName());
attributes.put(HttpManagement.TIME_OUT, 10000l);
attributes.put(ConfiguredObject.ID, _id);
attributes.put(HttpManagement.DESIRED_STATE, State.QUIESCED);
_management = new HttpManagement(attributes, _broker);
_management.open();
}
Aggregations