PatrykGala / deltaspike-data-h2-cdi-testing

Example usage DeltaSpike Data with Junit Tests in CDI cointainer and H2 Database
0 stars 0 forks source link

save method is not working #1

Open mookkiah opened 5 years ago

mookkiah commented 5 years ago

When I adde below method in BookRepositoryTest, I got error.

@Test public void saveBook() { Book book = new Book("Clean Code"); repo.save(book); assertNotNull(book.getId()); }

Error: Tests in error: saveBook(pl.patrykgala.ee.testing.jpa.repository.BookRepositoryTest): Failed calling Repository: [Repository=pl.patrykgala.ee.testing.jpa.repository.BookRepository,entity=pl.patrykgala.ee.testing.jpa.entity.Book,method=save,exception=class javax.naming.NoInitialContextException,message=Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

mvera commented 3 years ago

Hi,

I face the same problem.