Setup/Expect dataset by method besides annotation
See original GitHub issueBesides annotation setup/expect
@Test
@DataSet(provider = UserDataSetProvider.class, cleanBefore = true)
public void shouldSeedDatabaseProgrammatically() {
List<User> users = EntityManagerProvider.em().createQuery("select u from User u ").getResultList();
assertThat(users).
isNotNull().
isNotEmpty().hasSize(3).
extracting("name").
contains("@dbunit", "@dbrider", "@new row");
}
It will be great to have possibility to setup/expect by a method
@Test
public void shouldSeedDatabaseProgrammatically() {
dbSetup(UserDataSetProvider.class)
List<User> users = EntityManagerProvider.em().createQuery("select u from User u ").getResultList();
assertThat(users).
isNotNull().
isNotEmpty().hasSize(3).
extracting("name").
contains("@dbunit", "@dbrider", "@new row");
}
In this case the library can be used in used in other use-cases, not just for testing. Also, the method can be more easily extended/override than the annotation. Method is more flexible, we can pass as parameter even a lambda. And if besides database in the test we need also to ensure that a notification was sent into a queue, we also are doing it by a method, not an annotation, this will be more consistent.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Method: projects.locations.datasets.dataItems.annotations.list
Used to assign specific AnnotationSpec to a particular area of a DataItem or the whole part of the DataItem. JSON representation ...
Read more >GTCreator: a flexible annotation tool for image-based datasets
Methods : We introduce GTCreator, a flexible annotation tool for providing image and text annotations to image-based datasets. It keeps the main basic ......
Read more >Annotating Datasets — FiftyOne 0.18.0 documentation - Voxel51
Use the annotate() method on your dataset or view to upload the samples and optionally their existing labels to the annotation backend.
Read more >An Information Retrieval Approach to Building Datasets for ...
I think it is important to release other meta-data with the tweets besides the binary labels. I would like that all the annotated...
Read more >Annotated-VocalSet: A Singing Voice Dataset - MDPI
available datasets that includes a variety of vocal techniques (n = 17) and ... (except for the F0 annotation) [5], were annotated manually....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi again @raderio,
I’ve just added such feature to RiderDSL, you can find some examples here.
You can try with latest snapshot or wait until
v1.15.0
.Thank you for the idea.
Great! Thank you.