test_class.declarator: service = new AlertService()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final AlertService service = new AlertService();
test_class.type: AlertService
test_class.var_name: service
test_class.declarator: seyrenRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SeyrenRepository seyrenRepository;
test_class.type: SeyrenRepository
test_class.var_name: seyrenRepository
test_class.file: services/src/test/java/com/vsct/supervision/notification/service/AlertServiceTest.java
test_class.identifier: AlertServiceTest
test_case.body: @Test
      public void getStatNoTypeChangeTest() throws Exception {
  
          final Alert.Alerts alerts = new Alerts();
          final List<Alert> listAlerts = new ArrayList<>();
  
          Alert alert = TestUtils.getDefaultAlert();
          alert.setTimestamp(Instant.now().minus(30, ChronoUnit.DAYS));
          listAlerts.add(alert);
  
          alert = TestUtils.getDefaultAlert();
          alert.setFromType(alert.getToType());
          listAlerts.add(alert);
  
          alert = TestUtils.getDefaultAlertNoChanged();
          alert.setTimestamp(Instant.now().minus(30, ChronoUnit.DAYS));
          listAlerts.add(alert);
  
          alert = TestUtils.getDefaultAlertNoChanged();
          alert.setFromType(alert.getToType());
          listAlerts.add(alert);
  
          alerts.setValues(listAlerts);
  
          when(seyrenRepository.getAlerts(0, 50)).thenReturn(alerts);
          final List<Stat> statsM = service.getStatNoTypeChange("2m");
          final List<Stat> statsD = service.getStatNoTypeChange("2d");
          final List<Stat> statsH = service.getStatNoTypeChange("2h");
          assertNotNull(statsM);
          assertNotNull(statsD);
          assertNotNull(statsH);
          assertEquals(statsM.size(), 0);
          assertEquals(statsD.size(), 0);
          assertEquals(statsH.size(), 0);
      }
test_case.class_method_signature: AlertServiceTest.getStatNoTypeChangeTest()
test_case.full_signature: @Test public void getStatNoTypeChangeTest()
test_case.identifier: getStatNoTypeChangeTest
test_case.invocations: getDefaultAlert setTimestamp minus now add getDefaultAlert setFromType getToType add getDefaultAlertNoChanged setTimestamp minus now add getDefaultAlertNoChanged setFromType getToType add setValues thenReturn when getAlerts getStatNoTypeChange getStatNoTypeChange getStatNoTypeChange assertNotNull assertNotNull assertNotNull assertEquals size assertEquals size assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getStatNoTypeChangeTest()
focal_class.declarator: DEFAULT_NB_ITEMS_ALERTS = 20
focal_class.modifier: public static final
focal_class.original_string: public static final int DEFAULT_NB_ITEMS_ALERTS = 20;
focal_class.type: int
focal_class.var_name: DEFAULT_NB_ITEMS_ALERTS
focal_class.declarator: NB_ITEMS_GET_FOR_ALERTS = 50
focal_class.modifier: private static final
focal_class.original_string: private static final int NB_ITEMS_GET_FOR_ALERTS = 50;
focal_class.type: int
focal_class.var_name: NB_ITEMS_GET_FOR_ALERTS
focal_class.declarator: seyrenRepository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SeyrenRepository seyrenRepository;
focal_class.type: SeyrenRepository
focal_class.var_name: seyrenRepository
focal_class.file: services/src/main/java/com/vsct/supervision/notification/service/AlertService.java
focal_class.identifier: AlertService
focal_class.class_method_signature: AlertService.getAlerts()
focal_class.full_signature: public Alert.Alerts getAlerts()
focal_class.identifier: getAlerts
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlerts()
focal_class.class_method_signature: AlertService.getAlerts(final int nbItem)
focal_class.full_signature: public Alert.Alerts getAlerts(final int nbItem)
focal_class.identifier: getAlerts
focal_class.modifiers: public
focal_class.parameters: (final int nbItem)
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlerts(final int nbItem)
focal_class.class_method_signature: AlertService.getAlerts(final int nbItem, final int start)
focal_class.full_signature: public Alert.Alerts getAlerts(final int nbItem, final int start)
focal_class.identifier: getAlerts
focal_class.modifiers: public
focal_class.parameters: (final int nbItem, final int start)
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlerts(final int nbItem, final int start)
focal_class.class_method_signature: AlertService.getStatNoTypeChange(final String from)
focal_class.full_signature: public List<Stat> getStatNoTypeChange(final String from)
focal_class.identifier: getStatNoTypeChange
focal_class.modifiers: public
focal_class.parameters: (final String from)
focal_class.return: List<Stat>
focal_class.signature: List<Stat> getStatNoTypeChange(final String from)
focal_class.class_method_signature: AlertService.getStatTypeChange(final String from)
focal_class.full_signature: public List<Stat> getStatTypeChange(final String from)
focal_class.identifier: getStatTypeChange
focal_class.modifiers: public
focal_class.parameters: (final String from)
focal_class.return: List<Stat>
focal_class.signature: List<Stat> getStatTypeChange(final String from)
focal_class.class_method_signature: AlertService.getAlerts(final String from)
focal_class.full_signature: public Collection<Alert> getAlerts(final String from)
focal_class.identifier: getAlerts
focal_class.modifiers: public
focal_class.parameters: (final String from)
focal_class.return: Collection<Alert>
focal_class.signature: Collection<Alert> getAlerts(final String from)
focal_class.class_method_signature: AlertService.getAlarmAlerts(final String id)
focal_class.full_signature: public Alert.Alerts getAlarmAlerts(final String id)
focal_class.identifier: getAlarmAlerts
focal_class.modifiers: public
focal_class.parameters: (final String id)
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlarmAlerts(final String id)
focal_class.class_method_signature: AlertService.olderThan(final Collection<Alert> result, final Instant limit, final Alerts alerts)
focal_class.full_signature: private boolean olderThan(final Collection<Alert> result, final Instant limit, final Alerts alerts)
focal_class.identifier: olderThan
focal_class.modifiers: private
focal_class.parameters: (final Collection<Alert> result, final Instant limit, final Alerts alerts)
focal_class.return: boolean
focal_class.signature: boolean olderThan(final Collection<Alert> result, final Instant limit, final Alerts alerts)
focal_class.class_method_signature: AlertService.calcFromInstant(final String from)
focal_class.full_signature: private Instant calcFromInstant(final String from)
focal_class.identifier: calcFromInstant
focal_class.modifiers: private
focal_class.parameters: (final String from)
focal_class.return: Instant
focal_class.signature: Instant calcFromInstant(final String from)
focal_method.body: public List<Stat> getStatNoTypeChange(final String from) {
          final Collection<Alert> alerts = this.getAlerts(from);
  
          final Stat.StatBuilder stat = new Stat.StatBuilder();
  
          for (final Alert a : alerts) {
              if (a.getFromType() == a.getToType()) {
                  stat.increment(a.getAlarmId(), a.getToType());
              } else {
                  stat.removeAndIgnore(a.getAlarmId());
              }
          }
  
          return stat.build();
      }
focal_method.class_method_signature: AlertService.getStatNoTypeChange(final String from)
focal_method.full_signature: public List<Stat> getStatNoTypeChange(final String from)
focal_method.identifier: getStatNoTypeChange
focal_method.invocations: getAlerts getFromType getToType increment getAlarmId getToType removeAndIgnore getAlarmId build
focal_method.modifiers: public
focal_method.parameters: (final String from)
focal_method.return: List<Stat>
focal_method.signature: List<Stat> getStatNoTypeChange(final String from)