test_class.declarator: userMetricsRepository
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private UserMetricsRepository userMetricsRepository;
test_class.type: UserMetricsRepository
test_class.var_name: userMetricsRepository
test_class.file: mirrorgate-api/src/test/java/com/bbva/arq/devops/ae/mirrorgate/repository/UserMetricsRepositoryImplTest.java
test_class.identifier: UserMetricsRepositoryImplTest
test_case.body: @Test
      public void findUserMetricsByViewIdsTest() {
          final List<String> viewIds1 = Collections.singletonList("AWS/123456789012");
          final List<String> viewIds2 = Collections.singletonList("AWS/123456789012/alb");
          final List<String> viewIds3 = Collections.singletonList("AWS/123456789012/apigateway/restapi");
  
          final List<UserMetric> userMetrics1 = userMetricsRepository.findAllStartingWithViewId(viewIds1);
          final List<UserMetric> userMetrics2 = userMetricsRepository.findAllStartingWithViewId(viewIds2);
          final List<UserMetric> userMetrics3 = userMetricsRepository.findAllStartingWithViewId(viewIds3);
  
          assertEquals(3, userMetrics1.size());
          assertEquals(2, userMetrics2.size());
          assertEquals(1, userMetrics3.size());
  
          assertTrue(userMetrics1.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/alb/alb1"));
          assertTrue(userMetrics1.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/alb/alb2"));
          assertTrue(userMetrics1.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/apigateway/restapi"));
  
          assertTrue(userMetrics2.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/alb/alb1"));
          assertTrue(userMetrics2.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/alb/alb2"));
  
          assertTrue(userMetrics3.stream().map(UserMetric::getViewId).collect(Collectors.toList())
              .contains("AWS/123456789012/apigateway/restapi"));
      }
test_case.class_method_signature: UserMetricsRepositoryImplTest.findUserMetricsByViewIdsTest()
test_case.full_signature: @Test public void findUserMetricsByViewIdsTest()
test_case.identifier: findUserMetricsByViewIdsTest
test_case.invocations: singletonList singletonList singletonList findAllStartingWithViewId findAllStartingWithViewId findAllStartingWithViewId assertEquals size assertEquals size assertEquals size assertTrue contains collect map stream toList assertTrue contains collect map stream toList assertTrue contains collect map stream toList assertTrue contains collect map stream toList assertTrue contains collect map stream toList assertTrue contains collect map stream toList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void findUserMetricsByViewIdsTest()
focal_class.declarator: mongoTemplate
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private MongoTemplate mongoTemplate;
focal_class.type: MongoTemplate
focal_class.var_name: mongoTemplate
focal_class.file: mirrorgate-api/src/main/java/com/bbva/arq/devops/ae/mirrorgate/repository/UserMetricsRepositoryImpl.java
focal_class.identifier: UserMetricsRepositoryImpl
focal_class.interfaces: implements UserMetricsRepositoryCustom
focal_class.class_method_signature: UserMetricsRepositoryImpl.findAllStartingWithViewId(final List<String> viewIds)
focal_class.full_signature: @Override public List<UserMetric> findAllStartingWithViewId(final List<String> viewIds)
focal_class.identifier: findAllStartingWithViewId
focal_class.modifiers: @Override public
focal_class.parameters: (final List<String> viewIds)
focal_class.return: List<UserMetric>
focal_class.signature: List<UserMetric> findAllStartingWithViewId(final List<String> viewIds)
focal_class.class_method_signature: UserMetricsRepositoryImpl.getCriteriaExpressionsForUserMetrics(final List<String> viewIds)
focal_class.full_signature: private Criteria getCriteriaExpressionsForUserMetrics(final List<String> viewIds)
focal_class.identifier: getCriteriaExpressionsForUserMetrics
focal_class.modifiers: private
focal_class.parameters: (final List<String> viewIds)
focal_class.return: Criteria
focal_class.signature: Criteria getCriteriaExpressionsForUserMetrics(final List<String> viewIds)
focal_method.body: @Override
      public List<UserMetric> findAllStartingWithViewId(final List<String> viewIds) {
  
          final Aggregation agg = newAggregation(
              match(getCriteriaExpressionsForUserMetrics(viewIds))
          );
  
          final AggregationResults<UserMetric> aggregationResult
              = mongoTemplate.aggregate(agg, UserMetric.class, UserMetric.class);
  
          return aggregationResult.getMappedResults();
      }
focal_method.class_method_signature: UserMetricsRepositoryImpl.findAllStartingWithViewId(final List<String> viewIds)
focal_method.full_signature: @Override public List<UserMetric> findAllStartingWithViewId(final List<String> viewIds)
focal_method.identifier: findAllStartingWithViewId
focal_method.invocations: newAggregation match getCriteriaExpressionsForUserMetrics aggregate getMappedResults
focal_method.modifiers: @Override public
focal_method.parameters: (final List<String> viewIds)
focal_method.return: List<UserMetric>
focal_method.signature: List<UserMetric> findAllStartingWithViewId(final List<String> viewIds)