コード例 #1
0
  @Test(expected = InvalidParameterException.class)
  public void shouldThrowExceptionIfNegativeValue() throws Exception {
    final String method = "populateExpiration02";
    final Class<? extends Annotation> expected = UpdateAssignCache.class;
    final Method targetMethod =
        new Mirror().on(AnnotationDataDummy.class).reflect().method(method).withArgs(String.class);
    final Annotation annotation =
        new Mirror()
            .on(AnnotationDataDummy.class)
            .reflect()
            .annotation(expected)
            .atMethod(method)
            .withArgs(String.class);

    builder.populate(data, annotation, expected, targetMethod);
  }
コード例 #2
0
  @Test
  public void shouldPopulateExpiration() throws Exception {
    final String method = "populateExpiration03";
    final Class<? extends Annotation> expected = UpdateAssignCache.class;
    final Method targetMethod =
        new Mirror().on(AnnotationDataDummy.class).reflect().method(method).withArgs(String.class);
    final Annotation annotation =
        new Mirror()
            .on(AnnotationDataDummy.class)
            .reflect()
            .annotation(expected)
            .atMethod(method)
            .withArgs(String.class);

    builder.populate(data, annotation, expected, targetMethod);

    assertEquals(AnnotationDataDummy.SAMPLE_EXP, data.getExpiration());
  }