question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setup/Expect dataset by method besides annotation

See original GitHub issue

Besides 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:closed
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rmpestanocommented, Jul 1, 2020

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.

0reactions
raderiocommented, Jul 5, 2020

Great! Thank you.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found