/** * Tests the {@link SystemIn}. */ @Test public void SystemInformationPersistingCmrProcessor() { // only Timer Data SystemInformationPersistingCmrProcessor processor = new SystemInformationPersistingCmrProcessor(); // don't fail on null processor.process((DefaultData) null, entityManager); verifyZeroInteractions(entityManager); // don't process wrong classes processor.process(new SqlStatementData(), entityManager); processor.process(new HttpTimerData(), entityManager); verifyZeroInteractions(entityManager); // yes for correct class SystemInformationData systemInformationData = new SystemInformationData(); processor.process(systemInformationData, entityManager); verify(entityManager, times(1)).persist(systemInformationData); // also when influx is active processor.influxActive = true; processor.process(systemInformationData, entityManager); verify(entityManager, times(2)).persist(systemInformationData); }