Skip to content

Commit

Permalink
rename numerical methods
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed Nov 21, 2023
1 parent d618b19 commit 83da53c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HttpClient private (baseUrl: Uri, httpExt: HttpExt)(implicit
)(implicit um: FromEntityUnmarshaller[A]): IO[Assertion] =
requestAssert(POST, url, Some(body), identity, extraHeaders)(assertResponse)

def post2[A](url: String, body: IO[Json], identity: Identity, extraHeaders: Seq[HttpHeader] = jsonHeaders)(
def postIO[A](url: String, body: IO[Json], identity: Identity, extraHeaders: Seq[HttpHeader] = jsonHeaders)(
assertResponse: (A, HttpResponse) => Assertion
)(implicit um: FromEntityUnmarshaller[A]): IO[Assertion] = {
body.flatMap(body => requestAssert(POST, url, Some(body), identity, extraHeaders)(assertResponse))
Expand All @@ -66,7 +66,7 @@ class HttpClient private (baseUrl: Uri, httpExt: HttpExt)(implicit
)(implicit um: FromEntityUnmarshaller[A]): IO[Assertion] =
requestAssert(PUT, url, Some(body), identity, extraHeaders)(assertResponse)

def put2[A](url: String, body: IO[Json], identity: Identity, extraHeaders: Seq[HttpHeader] = jsonHeaders)(
def putIO[A](url: String, body: IO[Json], identity: Identity, extraHeaders: Seq[HttpHeader] = jsonHeaders)(
assertResponse: (A, HttpResponse) => Assertion
)(implicit um: FromEntityUnmarshaller[A]): IO[Assertion] = {
body.flatMap(body => requestAssert(PUT, url, Some(body), identity, extraHeaders)(assertResponse))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class SchemasSpec extends BaseIntegrationSpec {
root.shapes.index(0).minCount.int.getOption(json) shouldEqual Some(value)

for {
_ <- deltaClient.post2[Json](s"/schemas/$project", withMinCount(schemaId, minCount = 1), Rick) { expectCreated }
_ <- deltaClient.postIO[Json](s"/schemas/$project", withMinCount(schemaId, minCount = 1), Rick) {
expectCreated
}
_ <-
deltaClient
.put2[Json](
.putIO[Json](
s"/schemas/$project/${UrlUtils.encode(schemaId)}?rev=1",
withMinCount(schemaId, minCount = 2),
Rick
Expand Down Expand Up @@ -81,13 +83,13 @@ class SchemasSpec extends BaseIntegrationSpec {
)

for {
_ <- deltaClient.post2[Json](
_ <- deltaClient.postIO[Json](
s"/schemas/$project",
withPowerLevelShape(id = powerLevelSchemaId, maxPowerLevel = 10000),
Rick
) { expectCreated }
_ <- deltaClient
.post2[Json](
.postIO[Json](
s"/schemas/$project",
withImportOfPowerLevelShape(id = schemaId, importedSchemaId = powerLevelSchemaId),
Rick
Expand All @@ -99,7 +101,7 @@ class SchemasSpec extends BaseIntegrationSpec {
Rick
) { expectCreated }
_ <- deltaClient
.put2[Json](
.putIO[Json](
s"/schemas/$project/${UrlUtils.encode(powerLevelSchemaId)}?rev=1",
withPowerLevelShape(id = powerLevelSchemaId, maxPowerLevel = 9000),
Rick
Expand Down

0 comments on commit 83da53c

Please sign in to comment.