Skip to content

Commit c7915d8

Browse files
lalepeejreynard-code
authored andcommitted
fix test use the new repository find function in findAllDatasets
1 parent 364520e commit c7915d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dataset/src/test/kotlin/com/cosmotech/dataset/service/DatasetServiceImplTests.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import org.junit.jupiter.api.assertThrows
4444
import org.junit.jupiter.api.extension.ExtendWith
4545
import org.springframework.core.io.ByteArrayResource
4646
import org.springframework.data.domain.Page
47-
import org.springframework.data.domain.Pageable
47+
import org.springframework.data.domain.PageRequest
4848
import org.springframework.web.context.request.RequestContextHolder
4949
import org.springframework.web.context.request.ServletRequestAttributes
5050
import redis.clients.jedis.UnifiedJedis
@@ -104,7 +104,9 @@ class DatasetServiceImplTests {
104104
@Test
105105
fun `findAllDatasets should return empty list when no dataset exists`() {
106106
every { organizationService.getVerifiedOrganization(ORGANIZATION_ID) } returns Organization()
107-
every { datasetRepository.findAll(any<Pageable>()) } returns Page.empty()
107+
every {
108+
datasetRepository.findByOrganizationIdNoSecurity(any<String>(), any<PageRequest>())
109+
} returns Page.empty()
108110

109111
val result = datasetService.findAllDatasets(ORGANIZATION_ID, null, null)
110112
assertEquals(emptyList(), result)

0 commit comments

Comments
 (0)