Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Borys Tkachenko authored and Borys Tkachenko committed Jan 13, 2025
1 parent db0291f commit c7dd542
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3513,6 +3513,19 @@ Stream<Arguments> createAndGetCost() {
podamFactory.manufacturePojo(BigDecimal.class).abs().setScale(8, RoundingMode.DOWN)));
}

@Test
void createSpanFaiWithNegativeManualCost() {
var expectedSpan = podamFactory.manufacturePojo(Span.class).toBuilder()
.totalEstimatedCost(
podamFactory.manufacturePojo(BigDecimal.class).abs().negate().setScale(8, RoundingMode.DOWN))
.build();

try (var response = spanResourceClient.createSpan(expectedSpan, API_KEY, TEST_WORKSPACE, 422)) {
assertThat(response.readEntity(ErrorMessage.class).errors().getFirst())
.isEqualTo("totalEstimatedCost must be greater than or equal to 0.0");
}
}

@Test
void createAndGet__whenSpanInputIsBig__thenReturnSpan() {

Expand Down

0 comments on commit c7dd542

Please sign in to comment.