@Test public void shoul_accept_class_without_data_source_annotation_but_defined_in_properties() throws Exception { TestEvent testEvent = new TestEvent(new DataSourceExpectedFromDefaultConfiguration(), DataSourceExpectedFromDefaultConfiguration.class.getMethod("shouldPass")); PersistenceExtensionEnabler metadataProvider = new PersistenceExtensionEnabler(testEvent.getTestClass()); boolean persistenceFeatureEnabled = metadataProvider.shouldPersistenceExtensionBeActivated(); assertThat(persistenceFeatureEnabled).isTrue(); }
public boolean shouldPersistenceExtensionBeActivated() { return (hasDataSetAnnotation() || hasApplyScriptAnnotation() || hasPersistenceTestAnnotation() || hasJpaCacheEvictionAnnotation() || hasCreateSchemaAnnotation() || hasCleanupAnnotation() || hasCleanupUsingScriptAnnotation()); }
PersistenceExtensionEnabler { public boolean shouldPersistenceExtensionBeActivated() { return (hasDataSetAnnotation() || hasApplyScriptAnnotation() || hasPersistenceTestAnnotation() || hasJpaCacheEvictionAnnotation() || hasCreateSchemaAnnotation() || hasCleanupAnnotation() || hasCleanupUsingScriptAnnotation()); } }
PersistenceExtensionEnabler { public boolean shouldPersistenceExtensionBeActivated() { return (hasDataSetAnnotation() || hasApplyScriptAnnotation() || hasPersistenceTestAnnotation() || hasJpaCacheEvictionAnnotation() || hasCreateSchemaAnnotation() || hasCleanupAnnotation() || hasCleanupUsingScriptAnnotation()); } PersistenceExtensionEnabler(TestClass testClass);  PersistenceExtensionEnabler(MetadataExtractor metadataExtractor); }
PersistenceExtensionEnabler { public boolean shouldPersistenceExtensionBeActivated() { return (hasDataSetAnnotation() || hasApplyScriptAnnotation() || hasPersistenceTestAnnotation() || hasJpaCacheEvictionAnnotation() || hasCreateSchemaAnnotation() || hasCleanupAnnotation() || hasCleanupUsingScriptAnnotation()); } PersistenceExtensionEnabler(TestClass testClass);  PersistenceExtensionEnabler(MetadataExtractor metadataExtractor); boolean shouldPersistenceExtensionBeActivated(); }
PersistenceExtensionEnabler { public boolean shouldPersistenceExtensionBeActivated() { return (hasDataSetAnnotation() || hasApplyScriptAnnotation() || hasPersistenceTestAnnotation() || hasJpaCacheEvictionAnnotation() || hasCreateSchemaAnnotation() || hasCleanupAnnotation() || hasCleanupUsingScriptAnnotation()); } PersistenceExtensionEnabler(TestClass testClass);  PersistenceExtensionEnabler(MetadataExtractor metadataExtractor); boolean shouldPersistenceExtensionBeActivated();  }