test_class.file: hystrix-contrib/hystrix-javanica/src/test/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContextFactoryTest.java
test_class.identifier: CacheInvocationContextFactoryTest
test_case.body: @Test
      public void testCreateCacheResultInvocationContext_givenMethodAnnotatedWithCacheResult_shouldCreateCorrectCacheKeyInvocationContext()
              throws NoSuchMethodException {
          // given
          TestCacheClass testCacheClass = new TestCacheClass();
          String param1 = "val_1";
          String param2 = "val_2";
          Integer param3 = 3;
          MetaHolder metaHolder = MetaHolder.builder()
                  .method(TestCacheClass.class.getMethod("cacheResultMethod", String.class, String.class, Integer.class))
                  .args(new Object[]{param1, param2, param3})
                  .obj(testCacheClass).build();
          // when
          CacheInvocationContext<CacheResult> context = CacheInvocationContextFactory.createCacheResultInvocationContext(metaHolder);
  
          // then
          assertNotNull(context.getKeyParameters());
          assertEquals(2, context.getKeyParameters().size());
          assertEquals(String.class, context.getKeyParameters().get(0).getRawType());
          assertEquals(0, context.getKeyParameters().get(0).getPosition());
          assertEquals(param1, context.getKeyParameters().get(0).getValue());
          assertTrue(isAnnotationPresent(context.getKeyParameters().get(0), CacheKey.class));
  
          assertEquals(Integer.class, context.getKeyParameters().get(1).getRawType());
          assertEquals(2, context.getKeyParameters().get(1).getPosition());
          assertEquals(param3, context.getKeyParameters().get(1).getValue());
          assertTrue(isAnnotationPresent(context.getKeyParameters().get(1), CacheKey.class));
      }
test_case.class_method_signature: CacheInvocationContextFactoryTest.testCreateCacheResultInvocationContext_givenMethodAnnotatedWithCacheResult_shouldCreateCorrectCacheKeyInvocationContext()
test_case.full_signature: @Test public void testCreateCacheResultInvocationContext_givenMethodAnnotatedWithCacheResult_shouldCreateCorrectCacheKeyInvocationContext()
test_case.identifier: testCreateCacheResultInvocationContext_givenMethodAnnotatedWithCacheResult_shouldCreateCorrectCacheKeyInvocationContext
test_case.invocations: build obj args method builder getMethod createCacheResultInvocationContext assertNotNull getKeyParameters assertEquals size getKeyParameters assertEquals getRawType get getKeyParameters assertEquals getPosition get getKeyParameters assertEquals getValue get getKeyParameters assertTrue isAnnotationPresent get getKeyParameters assertEquals getRawType get getKeyParameters assertEquals getPosition get getKeyParameters assertEquals getValue get getKeyParameters assertTrue isAnnotationPresent get getKeyParameters
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCreateCacheResultInvocationContext_givenMethodAnnotatedWithCacheResult_shouldCreateCorrectCacheKeyInvocationContext()
focal_class.file: hystrix-contrib/hystrix-javanica/src/main/java/com/netflix/hystrix/contrib/javanica/cache/CacheInvocationContextFactory.java
focal_class.identifier: CacheInvocationContextFactory
focal_class.class_method_signature: CacheInvocationContextFactory.createCacheResultInvocationContext(MetaHolder metaHolder)
focal_class.full_signature: public static CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder)
focal_class.identifier: createCacheResultInvocationContext
focal_class.modifiers: public static
focal_class.parameters: (MetaHolder metaHolder)
focal_class.return: CacheInvocationContext<CacheResult>
focal_class.signature: CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder)
focal_class.class_method_signature: CacheInvocationContextFactory.createCacheRemoveInvocationContext(MetaHolder metaHolder)
focal_class.full_signature: public static CacheInvocationContext<CacheRemove> createCacheRemoveInvocationContext(MetaHolder metaHolder)
focal_class.identifier: createCacheRemoveInvocationContext
focal_class.modifiers: public static
focal_class.parameters: (MetaHolder metaHolder)
focal_class.return: CacheInvocationContext<CacheRemove>
focal_class.signature: CacheInvocationContext<CacheRemove> createCacheRemoveInvocationContext(MetaHolder metaHolder)
focal_class.class_method_signature: CacheInvocationContextFactory.createCacheKeyAction(String method, MetaHolder metaHolder)
focal_class.full_signature: private static MethodExecutionAction createCacheKeyAction(String method, MetaHolder metaHolder)
focal_class.identifier: createCacheKeyAction
focal_class.modifiers: private static
focal_class.parameters: (String method, MetaHolder metaHolder)
focal_class.return: MethodExecutionAction
focal_class.signature: MethodExecutionAction createCacheKeyAction(String method, MetaHolder metaHolder)
focal_method.body: public static CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder) {
          Method method = metaHolder.getMethod();
          if (method.isAnnotationPresent(CacheResult.class)) {
              CacheResult cacheResult = method.getAnnotation(CacheResult.class);
              MethodExecutionAction cacheKeyMethod = createCacheKeyAction(cacheResult.cacheKeyMethod(), metaHolder);
              return new CacheInvocationContext<CacheResult>(cacheResult, cacheKeyMethod, metaHolder.getObj(), method, metaHolder.getArgs());
          }
          return null;
      }
focal_method.class_method_signature: CacheInvocationContextFactory.createCacheResultInvocationContext(MetaHolder metaHolder)
focal_method.full_signature: public static CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder)
focal_method.identifier: createCacheResultInvocationContext
focal_method.invocations: getMethod isAnnotationPresent getAnnotation createCacheKeyAction cacheKeyMethod getObj getArgs
focal_method.modifiers: public static
focal_method.parameters: (MetaHolder metaHolder)
focal_method.return: CacheInvocationContext<CacheResult>
focal_method.signature: CacheInvocationContext<CacheResult> createCacheResultInvocationContext(MetaHolder metaHolder)