diff --git a/fda-table-service/rest-service/src/test/java/at/tuwien/endpoint/TableEndpointUnitTest.java b/fda-table-service/rest-service/src/test/java/at/tuwien/endpoint/TableEndpointUnitTest.java index deeba0e24bc0c5c67b12e103d2cc04ec3838f439..a2aa475ca8f7ef3d3469cb4e5717588279be2070 100644 --- a/fda-table-service/rest-service/src/test/java/at/tuwien/endpoint/TableEndpointUnitTest.java +++ b/fda-table-service/rest-service/src/test/java/at/tuwien/endpoint/TableEndpointUnitTest.java @@ -1,9 +1,13 @@ package at.tuwien.endpoint; import at.tuwien.BaseUnitTest; +import at.tuwien.config.IndexInitializer; import at.tuwien.config.ReadyConfig; import at.tuwien.endpoints.TableEndpoint; +import at.tuwien.entities.database.table.Table; import at.tuwien.exception.DatabaseNotFoundException; +import at.tuwien.repository.elastic.TableColumnidxRepository; +import at.tuwien.repository.elastic.TableidxRepository; import at.tuwien.service.DatabaseService; import com.rabbitmq.client.Channel; import org.apache.http.auth.BasicUserPrincipal; @@ -16,6 +20,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import javax.ws.rs.NotAllowedException; import java.security.Principal; +import java.util.List; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.*; @@ -36,6 +41,24 @@ public class TableEndpointUnitTest extends BaseUnitTest { @MockBean private Channel channel; + /** + * ElasticSearch not required in this test + */ + @MockBean + private IndexInitializer indexInitializer; + + /** + * ElasticSearch not required in this test + */ + @MockBean + private TableidxRepository tableidxRepository; + + /** + * ElasticSearch not required in this test + */ + @MockBean + private TableColumnidxRepository tableColumnidxRepository; + @MockBean private DatabaseService databaseService; diff --git a/fda-table-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationTest.java b/fda-table-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationTest.java index 572d9155c31fee23d34f4430dea2b6551f8dc217..8adc36c5515250801421e4fa4016a8fe10e65350 100644 --- a/fda-table-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationTest.java +++ b/fda-table-service/rest-service/src/test/java/at/tuwien/service/TableServiceIntegrationTest.java @@ -45,18 +45,33 @@ import static org.mockito.Mockito.when; @ExtendWith(SpringExtension.class) public class TableServiceIntegrationTest extends BaseUnitTest { + /** + * RabbitMQ not required in this test + */ @MockBean private ReadyConfig readyConfig; + /** + * RabbitMQ not required in this test + */ @MockBean private Channel channel; + /** + * ElasticSearch not required in this test + */ @MockBean private IndexInitializer indexInitializer; + /** + * ElasticSearch not required in this test + */ @MockBean private TableidxRepository tableidxRepository; + /** + * ElasticSearch not required in this test + */ @MockBean private TableColumnidxRepository tableColumnidxRepository; @@ -75,12 +90,6 @@ public class TableServiceIntegrationTest extends BaseUnitTest { @Autowired private TableService tableService; - @Autowired - private UserRepository userRepository; - - @Autowired - private ImageEnvironmentRepository imageEnvironmentRepository; - @BeforeAll public static void beforeAll() throws InterruptedException { afterAll();