Skip to content

Commit

Permalink
Merge pull request #271 from dearrudam/fix/integration-tests
Browse files Browse the repository at this point in the history
Fixed Integration tests
  • Loading branch information
otaviojava authored Mar 13, 2024
2 parents 6cdc65d + 0d3ab0a commit 557faed
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ void shouldUpdate() {
}

@Test
void shouldRemoveEntityByName() {
void shouldRemoveEntityByName() throws InterruptedException {
CommunicationEntity documentEntity = entityManager.insert(getEntity());

Thread.sleep(1_000L);
Element name = documentEntity.find("name").get();
SelectQuery query = select().from(COLLECTION_PERSON_NAME).where(name.name()).eq(name.get()).build();
DeleteQuery deleteQuery = delete().from(COLLECTION_PERSON_NAME)
.where(name.name()).eq(name.get()).build();
entityManager.delete(deleteQuery);
Thread.sleep(1_000L);
assertTrue(entityManager.select(query).collect(Collectors.toList()).isEmpty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
import jakarta.inject.Inject;
import jakarta.nosql.Template;
import org.eclipse.jnosql.databases.couchbase.communication.CouchbaseUtil;
import jakarta.nosql.Convert;
import org.eclipse.jnosql.databases.couchbase.communication.Database;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
import org.eclipse.jnosql.mapping.reflection.Reflections;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;
import org.jboss.weld.junit5.auto.AddExtensions;
import org.jboss.weld.junit5.auto.AddPackages;
Expand All @@ -42,7 +42,7 @@
import static org.eclipse.jnosql.communication.driver.IntegrationTest.NAMED;

@EnableAutoWeld
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(value = {Database.class, Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(Book.class)
@AddExtensions({EntityMetadataExtension.class,
DocumentExtension.class})
Expand Down
2 changes: 1 addition & 1 deletion jnosql-couchbase/src/test/resources/couchbase.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jnosql.couchbase.host=couchbase://localhost
jnosql.couchbase.user=root
jnosql.couchbase.password=123456
jnosql.couchbase.collections=Book,person,AppointmentBook,jnosql
jnosql.couchbase.index=Book
jnosql.couchbase.index=Book,person,AppointmentBook,jnosql
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.jnosql.databases.elasticsearch.communication.ElasticsearchConfigurations;
import org.eclipse.jnosql.databases.elasticsearch.mapping.ElasticsearchTemplate;
import org.eclipse.jnosql.mapping.Database;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.core.config.MappingConfigurations;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
Expand All @@ -47,7 +48,7 @@
import static org.eclipse.jnosql.communication.driver.IntegrationTest.NAMED;

@EnableAutoWeld
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(value = {Database.class, Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(Book.class)
@AddPackages(ElasticsearchTemplate.class)
@AddExtensions({EntityMetadataExtension.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import org.eclipse.jnosql.databases.elasticsearch.communication.DocumentDatabase;
import org.eclipse.jnosql.databases.elasticsearch.communication.ElasticsearchConfigurations;
import org.eclipse.jnosql.databases.elasticsearch.mapping.ElasticsearchTemplate;
import jakarta.nosql.Convert;
import org.eclipse.jnosql.mapping.Database;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.core.config.MappingConfigurations;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
import org.eclipse.jnosql.mapping.reflection.Reflections;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;
import org.jboss.weld.junit5.auto.AddExtensions;
import org.jboss.weld.junit5.auto.AddPackages;
Expand All @@ -51,7 +51,7 @@
import static org.eclipse.jnosql.communication.driver.IntegrationTest.NAMED;

@EnableAutoWeld
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(value = {Database.class, Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(Book.class)
@AddPackages(ElasticsearchTemplate.class)
@AddExtensions({EntityMetadataExtension.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
import org.awaitility.Awaitility;
import org.eclipse.jnosql.databases.elasticsearch.communication.DocumentDatabase;
import org.eclipse.jnosql.databases.elasticsearch.communication.ElasticsearchConfigurations;
import jakarta.nosql.Convert;
import org.eclipse.jnosql.mapping.Database;
import org.eclipse.jnosql.mapping.core.Converters;
import org.eclipse.jnosql.mapping.core.config.MappingConfigurations;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.document.DocumentTemplate;
import org.eclipse.jnosql.mapping.document.spi.DocumentExtension;
import org.eclipse.jnosql.mapping.reflection.Reflections;
import org.eclipse.jnosql.mapping.core.spi.EntityMetadataExtension;
import org.eclipse.jnosql.mapping.semistructured.EntityConverter;
import org.jboss.weld.junit5.auto.AddExtensions;
import org.jboss.weld.junit5.auto.AddPackages;
Expand All @@ -47,7 +47,7 @@
import static org.eclipse.jnosql.communication.driver.IntegrationTest.NAMED;

@EnableAutoWeld
@AddPackages(value = {Database.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(value = {Database.class, Converters.class, EntityConverter.class, DocumentTemplate.class})
@AddPackages(Book.class)
@AddPackages(Reflections.class)
@AddExtensions({EntityMetadataExtension.class,
Expand Down

0 comments on commit 557faed

Please sign in to comment.