test_class.declarator: repository
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HistoricUserMetricRepository repository;
test_class.type: HistoricUserMetricRepository
test_class.var_name: repository
test_class.declarator: service
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HistoricUserMetricServiceImpl service;
test_class.type: HistoricUserMetricServiceImpl
test_class.var_name: service
test_class.declarator: userMetrics
test_class.modifier: private static
test_class.original_string: private static Iterable<UserMetric> userMetrics;
test_class.type: Iterable<UserMetric>
test_class.var_name: userMetrics
test_class.file: mirrorgate-api/src/test/java/com/bbva/arq/devops/ae/mirrorgate/service/HistoricUserMetricServiceImplTest.java
test_class.identifier: HistoricUserMetricServiceImplTest
test_case.body: @Test
      public void testAvailabilityRate() {
          service.addToCurrentPeriod(userMetrics);
  
          final HistoricUserMetric result = repository.findById(
              HistoricUserMetricMapper.generateId(
                  "AWSAvailabilityRate",
                  ChronoUnit.HOURS,
                  LocalDateTimeHelper.getTimestampPeriod(TODAY, ChronoUnit.HOURS)
              )
          );
  
          assertEquals("AWSAvailabilityRate", result.getIdentifier());
          assertEquals((long) result.getTimestamp(), LocalDateTimeHelper.getTimestampPeriod(TODAY, ChronoUnit.HOURS));
          assertEquals(2, (long) result.getSampleSize());
          assertEquals(175, result.getValue(), 0.0);
          assertEquals(result.getHistoricType(), ChronoUnit.HOURS);
      }
test_case.class_method_signature: HistoricUserMetricServiceImplTest.testAvailabilityRate()
test_case.full_signature: @Test public void testAvailabilityRate()
test_case.identifier: testAvailabilityRate
test_case.invocations: addToCurrentPeriod findById generateId getTimestampPeriod assertEquals getIdentifier assertEquals getTimestamp getTimestampPeriod assertEquals getSampleSize assertEquals getValue assertEquals getHistoricType
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAvailabilityRate()
focal_class.declarator: LOG = LoggerFactory.getLogger(HistoricUserMetricServiceImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = LoggerFactory.getLogger(HistoricUserMetricServiceImpl.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: ONE_HOUR_PERIOD = 60
focal_class.modifier: private static final
focal_class.original_string: private static final int ONE_HOUR_PERIOD = 60;
focal_class.type: int
focal_class.var_name: ONE_HOUR_PERIOD
focal_class.declarator: EIGHT_HOURS_PERIOD = 8
focal_class.modifier: private static final
focal_class.original_string: private static final int EIGHT_HOURS_PERIOD = 8;
focal_class.type: int
focal_class.var_name: EIGHT_HOURS_PERIOD
focal_class.declarator: ONE_DAY_PERIOD = 24
focal_class.modifier: private static final
focal_class.original_string: private static final int ONE_DAY_PERIOD = 24;
focal_class.type: int
focal_class.var_name: ONE_DAY_PERIOD
focal_class.declarator: SEVEN_DAYS_PERIOD = 7
focal_class.modifier: private static final
focal_class.original_string: private static final int SEVEN_DAYS_PERIOD = 7;
focal_class.type: int
focal_class.var_name: SEVEN_DAYS_PERIOD
focal_class.declarator: THIRTY_DAYS_PERIOD = 30
focal_class.modifier: private static final
focal_class.original_string: private static final int THIRTY_DAYS_PERIOD = 30;
focal_class.type: int
focal_class.var_name: THIRTY_DAYS_PERIOD
focal_class.declarator: NINETY_DAYS_PERIOD = 90
focal_class.modifier: private static final
focal_class.original_string: private static final int NINETY_DAYS_PERIOD = 90;
focal_class.type: int
focal_class.var_name: NINETY_DAYS_PERIOD
focal_class.declarator: userMetricsRepository
focal_class.modifier: private final
focal_class.original_string: private final UserMetricsRepository userMetricsRepository;
focal_class.type: UserMetricsRepository
focal_class.var_name: userMetricsRepository
focal_class.declarator: historicUserMetricRepository
focal_class.modifier: private final
focal_class.original_string: private final HistoricUserMetricRepository historicUserMetricRepository;
focal_class.type: HistoricUserMetricRepository
focal_class.var_name: historicUserMetricRepository
focal_class.file: mirrorgate-api/src/main/java/com/bbva/arq/devops/ae/mirrorgate/service/HistoricUserMetricServiceImpl.java
focal_class.identifier: HistoricUserMetricServiceImpl
focal_class.interfaces: implements HistoricUserMetricService
focal_class.class_method_signature: HistoricUserMetricServiceImpl.HistoricUserMetricServiceImpl(
          final UserMetricsRepository userMetricsRepository,
          final HistoricUserMetricRepository historicUserMetricRepository
      )
focal_class.full_signature: @Autowired public  HistoricUserMetricServiceImpl(
          final UserMetricsRepository userMetricsRepository,
          final HistoricUserMetricRepository historicUserMetricRepository
      )
focal_class.identifier: HistoricUserMetricServiceImpl
focal_class.modifiers: @Autowired public
focal_class.parameters: (
          final UserMetricsRepository userMetricsRepository,
          final HistoricUserMetricRepository historicUserMetricRepository
      )
focal_class.signature:  HistoricUserMetricServiceImpl(
          final UserMetricsRepository userMetricsRepository,
          final HistoricUserMetricRepository historicUserMetricRepository
      )
focal_class.class_method_signature: HistoricUserMetricServiceImpl.addToCurrentPeriod(final Iterable<UserMetric> saved)
focal_class.full_signature: @Override public void addToCurrentPeriod(final Iterable<UserMetric> saved)
focal_class.identifier: addToCurrentPeriod
focal_class.modifiers: @Override public
focal_class.parameters: (final Iterable<UserMetric> saved)
focal_class.return: void
focal_class.signature: void addToCurrentPeriod(final Iterable<UserMetric> saved)
focal_class.class_method_signature: HistoricUserMetricServiceImpl.getHistoricMetrics(final List<String> views)
focal_class.full_signature: @Override public List<UserMetricDTO> getHistoricMetrics(final List<String> views)
focal_class.identifier: getHistoricMetrics
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> views)
focal_class.return: List<UserMetricDTO>
focal_class.signature: List<UserMetricDTO> getHistoricMetrics(final List<String> views)
focal_class.class_method_signature: HistoricUserMetricServiceImpl.addToTendency(final UserMetric userMetric, final ChronoUnit unit)
focal_class.full_signature: private void addToTendency(final UserMetric userMetric, final ChronoUnit unit)
focal_class.identifier: addToTendency
focal_class.modifiers: private
focal_class.parameters: (final UserMetric userMetric, final ChronoUnit unit)
focal_class.return: void
focal_class.signature: void addToTendency(final UserMetric userMetric, final ChronoUnit unit)
focal_class.class_method_signature: HistoricUserMetricServiceImpl.createNextPeriod(final UserMetric userMetric, final ChronoUnit unit)
focal_class.full_signature: private HistoricUserMetric createNextPeriod(final UserMetric userMetric, final ChronoUnit unit)
focal_class.identifier: createNextPeriod
focal_class.modifiers: private
focal_class.parameters: (final UserMetric userMetric, final ChronoUnit unit)
focal_class.return: HistoricUserMetric
focal_class.signature: HistoricUserMetric createNextPeriod(final UserMetric userMetric, final ChronoUnit unit)
focal_method.body: @Override
      public void addToCurrentPeriod(final Iterable<UserMetric> saved) {
          saved.forEach(s -> {
              addToTendency(s, ChronoUnit.MINUTES);
              addToTendency(s, ChronoUnit.HOURS);
              addToTendency(s, ChronoUnit.DAYS);
          });
      }
focal_method.class_method_signature: HistoricUserMetricServiceImpl.addToCurrentPeriod(final Iterable<UserMetric> saved)
focal_method.full_signature: @Override public void addToCurrentPeriod(final Iterable<UserMetric> saved)
focal_method.identifier: addToCurrentPeriod
focal_method.invocations: forEach addToTendency addToTendency addToTendency
focal_method.modifiers: @Override public
focal_method.parameters: (final Iterable<UserMetric> saved)
focal_method.return: void
focal_method.signature: void addToCurrentPeriod(final Iterable<UserMetric> saved)