### Question:
JsonEventLogger implements EventHandler { @Activate @SuppressWarnings("squid:S1149") protected void activate(final Map<String, Object> config) { log.trace("[activate] entered activate method."); this.topics = PropertiesUtil.toStringArray(config.get(OSGI_TOPICS)); this.filter = PropertiesUtil.toString(config.get(OSGI_FILTER), "").trim(); this.category = PropertiesUtil.toString(config.get(OSGI_CATEGORY), "").trim(); this.level = PropertiesUtil.toString(config.get(OSGI_LEVEL), DEFAULT_LEVEL); if (StringUtils.isNotEmpty(this.category)) { this.eventLogger = LoggerFactory.getLogger(this.category); } else { log.warn("No event.logger.category specified. No events will be logged."); } final LogLevel logLevel = LogLevel.fromProperty(this.level); this.logEnabler = logEnablerForLevel(logLevel, this.eventLogger); this.logMapper = logMapperForLevel(logLevel, this.eventLogger); log.trace("[activate] logger state: {}", this); }  @Override void handleEvent(Event event); @Override String toString();  }### Answer:
@Test public void testActivate() { for (String logLevel : Arrays.asList("ERROR", "WARN", "INFO", "DEBUG", "TRACE", null)) { JsonEventLogger eventLogger = new JsonEventLogger(); eventLogger.activate(constructConfig("test", logLevel, null, "some/topic")); Event event = new Event("my/simple/topic", Collections.emptyMap()); eventLogger.handleEvent(event); eventLogger.deactivate(); } JsonEventLogger eventLogger = new JsonEventLogger(); eventLogger.activate(constructConfig(null, "INFO", null, "some/topic")); Event event = new Event("my/simple/topic", Collections.emptyMap()); eventLogger.handleEvent(event); eventLogger.deactivate(); }