Skip to content

Commit

Permalink
#1213 resolved issue with InstrumentsProviderTest failing due to inte…
Browse files Browse the repository at this point in the history
…rface change.
  • Loading branch information
chris committed Dec 13, 2024
1 parent 4f3abea commit 7b8beb6
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.finos.vuu.example.rest.provider

import org.finos.toolbox.json.JsonUtil
import org.finos.vuu.core.table.{Columns, DataTable, RowWithData}
import org.finos.vuu.core.table.{Columns, DataTable, RowData, RowWithData}
import org.finos.toolbox.time.{Clock, TestFriendlyClock}
import org.finos.vuu.api.TableDef
import org.finos.vuu.core.module.ModuleFactory.stringToString
Expand Down Expand Up @@ -29,7 +29,7 @@ class InstrumentsProviderTest extends AnyFeatureSpec with Matchers with MockFact

getInstrumentsProvider(mockBackend).doStart()

(mockTable.processUpdate _).verify(expectedRow.get(KEY_FIELD).toString, expectedRow, *).once
(mockTable.processUpdate(_: String, _: RowData, _ : Long) ).verify(expectedRow.get(KEY_FIELD).toString, expectedRow, *).once
}

Scenario("can correctly make an external call, parse response and update the table WHEN server responds with multiple instruments") {
Expand All @@ -41,7 +41,7 @@ class InstrumentsProviderTest extends AnyFeatureSpec with Matchers with MockFact

getInstrumentsProvider(mockBackend).doStart()

expectedRows.foreach(row => (mockTable.processUpdate _).verify(row.get(KEY_FIELD).toString, row, *).once)
expectedRows.foreach(row => (mockTable.processUpdate(_: String, _: RowData, _ : Long) ).verify(row.get(KEY_FIELD).toString, row, *).once)
}

Scenario("skips updating table when response is not parsable") {
Expand All @@ -50,15 +50,15 @@ class InstrumentsProviderTest extends AnyFeatureSpec with Matchers with MockFact

getInstrumentsProvider(mockBackend).doStart()

(mockTable.processUpdate _).verify(*, *, *).never
(mockTable.processUpdate(_: String, _: RowData, _ : Long) ).verify(*, *, *).never
}

Scenario("skips updating table when response errors") {
val mockBackend = SyncBackendStub.whenAnyRequest.thenRespond(throw new Exception("Some error"))

getInstrumentsProvider(mockBackend).doStart()

(mockTable.processUpdate _).verify(*, *, *).never
(mockTable.processUpdate(_: String, _: RowData, _ : Long) ).verify(*, *, *).never
}
}

Expand Down

0 comments on commit 7b8beb6

Please sign in to comment.