Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ internal data class ApiRemoteEventQuery(
val moduleId: String? = null,
val subjectId: String? = null,
val lastEventId: String? = null,
val modes: List<ApiModes>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ internal class EventRemoteDataSource @Inject constructor(
moduleId = query.moduleId,
attendantId = query.userId,
subjectId = query.subjectId,
modes = query.modes,
lastEventId = query.lastEventId
)
}
Expand Down Expand Up @@ -125,7 +124,6 @@ internal class EventRemoteDataSource @Inject constructor(
moduleId = query.moduleId,
attendantId = query.userId,
subjectId = query.subjectId,
modes = query.modes,
lastEventId = query.lastEventId
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ internal interface EventRemoteInterface : SimRemoteInterface {
@Query("l_moduleId") moduleId: String?,
@Query("l_attendantId") attendantId: String?,
@Query("l_subjectId") subjectId: String?,
@Query("l_mode") modes: List<ApiModes>,
@Query("lastEventId") lastEventId: String?,
): Response<Void>

Expand All @@ -44,7 +43,6 @@ internal interface EventRemoteInterface : SimRemoteInterface {
@Query("l_moduleId") moduleId: String?,
@Query("l_attendantId") attendantId: String?,
@Query("l_subjectId") subjectId: String?,
@Query("l_mode") modes: List<ApiModes>,
@Query("lastEventId") lastEventId: String?,
): Response<ResponseBody>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.simprints.infra.eventsync.status.down.domain
import androidx.annotation.Keep
import com.simprints.core.domain.modality.Modes
import com.simprints.infra.eventsync.event.remote.ApiRemoteEventQuery
import com.simprints.infra.eventsync.event.remote.fromDomainToApi


@Keep
Expand All @@ -22,7 +21,6 @@ internal data class RemoteEventQuery(
moduleId = moduleId,
subjectId = subjectId,
lastEventId = lastEventId,
modes = modes.map { it.fromDomainToApi() },
)
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ class EventRemoteDataSourceTest {
moduleId = DEFAULT_MODULE_ID.value,
subjectId = GUID1,
lastEventId = GUID2,
modes = listOf(ApiModes.FACE, ApiModes.FINGERPRINT),
)

@Before
Expand All @@ -87,7 +86,7 @@ class EventRemoteDataSourceTest {
@Test
fun count_shouldMakeANetworkRequest() = runTest {
coEvery {
eventRemoteInterface.countEvents(any(), any(), any(), any(), any(), any())
eventRemoteInterface.countEvents(any(), any(), any(), any(), any())
} returns Response.success(
null,
mapOf("x-event-count" to "6", "x-event-count-is-lower-bound" to "true").toHeaders()
Expand All @@ -102,7 +101,6 @@ class EventRemoteDataSourceTest {
moduleId = DEFAULT_MODULE_ID.value,
attendantId = DEFAULT_USER_ID.value,
subjectId = GUID1,
modes = listOf(ApiModes.FACE, ApiModes.FINGERPRINT),
lastEventId = GUID2
)
}
Expand All @@ -117,7 +115,6 @@ class EventRemoteDataSourceTest {
any(),
any(),
any(),
any()
)
} throws Throwable("Request issue")

Expand Down Expand Up @@ -177,7 +174,6 @@ class EventRemoteDataSourceTest {
any(),
any(),
any(),
any()
)
} throws exception

Expand Down Expand Up @@ -206,7 +202,6 @@ class EventRemoteDataSourceTest {
any(),
any(),
any(),
any()
)
} throws exception

Expand All @@ -226,7 +221,6 @@ class EventRemoteDataSourceTest {
any(),
any(),
any(),
any()
)
} returns Response.success("".toResponseBody())

Expand All @@ -237,7 +231,7 @@ class EventRemoteDataSourceTest {
with(query) {
coVerify {
eventRemoteInterface.downloadEvents(
GUID1, projectId, moduleId, userId, subjectId, modes, lastEventId
GUID1, projectId, moduleId, userId, subjectId, lastEventId
)
}
}
Expand All @@ -246,7 +240,7 @@ class EventRemoteDataSourceTest {
@Test
fun getEvents_shouldReturnCorrectTotalHeader() = runTest {
coEvery {
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any(), any())
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any())
} returns Response.success(
"".toResponseBody(),
mapOf("x-event-count" to "22").toHeaders()
Expand All @@ -263,7 +257,7 @@ class EventRemoteDataSourceTest {
@Test
fun getEvents_shouldReturnCorrectStatus() = runTest {
coEvery {
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any(), any())
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any())
} returns Response.success(205, "".toResponseBody())

val mockedScope: CoroutineScope = mockk()
Expand All @@ -275,7 +269,7 @@ class EventRemoteDataSourceTest {
@Test
fun getEvents_shouldNotReturnTotalHeaderWhenLowerBound() = runTest {
coEvery {
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any(), any())
eventRemoteInterface.downloadEvents(any(), any(), any(), any(), any(), any())
} returns Response.success(
"".toResponseBody(),
mapOf("x-event-count" to "22", "x-event-count-is-lower-bound" to "true").toHeaders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.simprints.infra.events.sampledata.SampleDefaults.DEFAULT_PROJECT_ID
import com.simprints.infra.events.sampledata.SampleDefaults.DEFAULT_USER_ID
import com.simprints.infra.events.sampledata.SampleDefaults.GUID1
import com.simprints.infra.events.sampledata.SampleDefaults.GUID2
import com.simprints.infra.eventsync.event.remote.fromDomainToApi
import org.junit.Test

class RemoteEventQueryTest {
Expand All @@ -29,7 +28,6 @@ class RemoteEventQueryTest {
assertThat(moduleId).isEqualTo(DEFAULT_MODULE_ID.value)
assertThat(subjectId).isEqualTo(GUID1)
assertThat(lastEventId).isEqualTo(GUID2)
assertThat(modes).isEqualTo(DEFAULT_MODES.map { it.fromDomainToApi() })
}
}
}