@Test void testEventServiceDisabled() { final NotificationsConfiguration c = new NotificationsConfiguration(); c.set("batch.size", "1000"); c.set("retries", "10"); c.set("key.serializer", "some.bogus.key.serializer"); c.setConnectionString("localhost:9092"); c.setEnabled(false); c.setType(NotificationsConfiguration.Type.KAFKA); final EventService svc = AppUtils.getNotificationService(c, mockEnv); assertNotNull(svc, "Missing EventService!"); assertTrue(svc instanceof NoopEventService, "EventService didn't default to No-op service!"); }
public static EventService getNotificationService(final NotificationsConfiguration config, final Environment environment) { if (config.getEnabled()) { if (KAFKA.equals(config.getType())) { return buildKafkaEventService(config, environment); } else if (JMS.equals(config.getType())) { try { return buildJmsEventService(config, environment); } catch (final JMSException ex) { throw new TrellisRuntimeException(ex); } } } final String status = "notifications will be disabled"; LOGGER.info("Using no-op event service: {}", status); return new NoopEventService(); }
AppUtils { public static EventService getNotificationService(final NotificationsConfiguration config, final Environment environment) { if (config.getEnabled()) { if (KAFKA.equals(config.getType())) { return buildKafkaEventService(config, environment); } else if (JMS.equals(config.getType())) { try { return buildJmsEventService(config, environment); } catch (final JMSException ex) { throw new TrellisRuntimeException(ex); } } } final String status = "notifications will be disabled"; LOGGER.info("Using no-op event service: {}", status); return new NoopEventService(); } }
AppUtils { public static EventService getNotificationService(final NotificationsConfiguration config, final Environment environment) { if (config.getEnabled()) { if (KAFKA.equals(config.getType())) { return buildKafkaEventService(config, environment); } else if (JMS.equals(config.getType())) { try { return buildJmsEventService(config, environment); } catch (final JMSException ex) { throw new TrellisRuntimeException(ex); } } } final String status = "notifications will be disabled"; LOGGER.info("Using no-op event service: {}", status); return new NoopEventService(); } private  AppUtils(); }
AppUtils { public static EventService getNotificationService(final NotificationsConfiguration config, final Environment environment) { if (config.getEnabled()) { if (KAFKA.equals(config.getType())) { return buildKafkaEventService(config, environment); } else if (JMS.equals(config.getType())) { try { return buildJmsEventService(config, environment); } catch (final JMSException ex) { throw new TrellisRuntimeException(ex); } } } final String status = "notifications will be disabled"; LOGGER.info("Using no-op event service: {}", status); return new NoopEventService(); } private  AppUtils(); static Properties getKafkaProperties(final NotificationsConfiguration config); static ActiveMQConnectionFactory getJmsFactory(final NotificationsConfiguration config); static EventService getNotificationService(final NotificationsConfiguration config,
            final Environment environment); }
AppUtils { public static EventService getNotificationService(final NotificationsConfiguration config, final Environment environment) { if (config.getEnabled()) { if (KAFKA.equals(config.getType())) { return buildKafkaEventService(config, environment); } else if (JMS.equals(config.getType())) { try { return buildJmsEventService(config, environment); } catch (final JMSException ex) { throw new TrellisRuntimeException(ex); } } } final String status = "notifications will be disabled"; LOGGER.info("Using no-op event service: {}", status); return new NoopEventService(); } private  AppUtils(); static Properties getKafkaProperties(final NotificationsConfiguration config); static ActiveMQConnectionFactory getJmsFactory(final NotificationsConfiguration config); static EventService getNotificationService(final NotificationsConfiguration config,
            final Environment environment);  }