public IntegrationTestMetadata(
      final String identifier,
      final JavaType aspectName,
      final PhysicalTypeMetadata governorPhysicalTypeMetadata,
      final IntegrationTestAnnotationValues annotationValues,
      final DataOnDemandMetadata dataOnDemandMetadata,
      final MethodMetadata identifierAccessorMethod,
      final MethodMetadata versionAccessorMethod,
      final MemberTypeAdditions countMethod,
      final MemberTypeAdditions findMethod,
      final MemberTypeAdditions findAllMethod,
      final MemberTypeAdditions findEntriesMethod,
      final MemberTypeAdditions flushMethod,
      final MemberTypeAdditions mergeMethod,
      final MemberTypeAdditions persistMethod,
      final MemberTypeAdditions removeMethod,
      final String transactionManager,
      final boolean hasEmbeddedIdentifier,
      final boolean entityHasSuperclass,
      final boolean isGaeEnabled) {
    super(identifier, aspectName, governorPhysicalTypeMetadata);
    Assert.isTrue(
        isValid(identifier),
        "Metadata identification string '" + identifier + "' does not appear to be a valid");
    Assert.notNull(annotationValues, "Annotation values required");
    Assert.notNull(dataOnDemandMetadata, "Data on demand metadata required");

    if (!isValid()) {
      return;
    }

    this.annotationValues = annotationValues;
    this.dataOnDemandMetadata = dataOnDemandMetadata;
    this.transactionManager = transactionManager;
    this.hasEmbeddedIdentifier = hasEmbeddedIdentifier;
    this.entityHasSuperclass = entityHasSuperclass;

    addRequiredIntegrationTestClassIntroductions(
        DataOnDemandMetadata.getJavaType(dataOnDemandMetadata.getId()));

    // Add GAE LocalServiceTestHelper instance and @BeforeClass/@AfterClass
    // methods if GAE is enabled
    if (isGaeEnabled) {
      isGaeSupported = true;
      addOptionalIntegrationTestClassIntroductions();
    }

    builder.addMethod(getCountMethodTest(countMethod));
    builder.addMethod(getFindMethodTest(findMethod, identifierAccessorMethod));
    builder.addMethod(getFindAllMethodTest(findAllMethod, countMethod));
    builder.addMethod(getFindEntriesMethodTest(countMethod, findEntriesMethod));
    if (flushMethod != null) {
      builder.addMethod(
          getFlushMethodTest(
              versionAccessorMethod, identifierAccessorMethod, flushMethod, findMethod));
    }
    builder.addMethod(
        getMergeMethodTest(
            mergeMethod, findMethod, flushMethod, versionAccessorMethod, identifierAccessorMethod));
    builder.addMethod(getPersistMethodTest(persistMethod, flushMethod, identifierAccessorMethod));
    builder.addMethod(
        getRemoveMethodTest(removeMethod, findMethod, flushMethod, identifierAccessorMethod));

    itdTypeDetails = builder.build();
  }