Skip to content

Commit

Permalink
test: add tests for prod summaries
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Zollinger <jonathan.zollinger@gmail.com>
  • Loading branch information
Jonathan-Zollinger committed Jan 22, 2024
1 parent dff5423 commit 9834cc5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/graqr/threshr/ThreshrController.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public List<ProductSummary> fetchProductSummariesWithFulfillment(
TargetStore targetStore,
String... tcin) throws ThreshrException {
return fetchProductSummariesWithFulfillment(targetStore,
new Tcin(String.join(",", tcin)));
new Tcin(tcin));
}

@Get("/details")
Expand Down
23 changes: 20 additions & 3 deletions src/test/groovy/com/graqr/threshr/ThreshrControllerTest.groovy
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
package com.graqr.threshr


import com.graqr.threshr.model.Tcin
import io.micronaut.test.extensions.spock.annotation.MicronautTest

@MicronautTest
class ThreshrControllerTest extends ThreshrTest {

void "query product summaries with no error"() {
void "query product summaries with no error with tcin string(s)"() {
when:
threshrController.fetchProductSummariesWithFulfillment(targetStore, tcin)
threshrController.fetchProductSummariesWithFulfillment(targetStore, tcinArg)
then:
noExceptionThrown()
where:
tcinArg | _
tcin.getTcins().split(",")[0] | _
tcin.getTcins().split(",") | _
}
void "query product summaries with no error tcin type arg"() {
when:
threshrController.fetchProductSummariesWithFulfillment(targetStore, tcinArg)
then:
noExceptionThrown()
where:
tcinArg | _
tcin | _
new Tcin(tcin.getTcins().split(",")[0]) | _
}
void "query product details with no error"() {
when:
Expand Down
2 changes: 1 addition & 1 deletion src/test/groovy/com/graqr/threshr/ThreshrTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ThreshrTest extends Specification {
@Shared
ThreshrClient threshrClient

@Shared
@Shared // TODO configure test data to be provided, not hardcoded
TargetStore targetStore = new TargetStore(
"1750",
"UT",
Expand Down

0 comments on commit 9834cc5

Please sign in to comment.