Skip to content

Commit

Permalink
Adding url output
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-wehrle-roche committed Jan 3, 2019
1 parent 2f9cd5e commit dbb629c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Completes<Response> create(final UserId userId) {

public Completes<Response> queryCart(String cartId) {
return stage.actorOf(addressFactory.from(cartId), Cart.class)
.andThenTo(Cart::queryCart)
.andThenTo( cart -> cart.queryCart())
.andThenTo( cartItems -> Completes.withSuccess(Response.of(Ok, serialized(cartItems))))
.otherwise( noCart -> Response.of(NotFound, urlLocation(cartId)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CartResourceShould {

@Before
public void setUp() throws InterruptedException {
Boolean startUpSuccess = Bootstrap.instance().serverStartup().await(1000);
Boolean startUpSuccess = Bootstrap.instance().serverStartup().await(100);
assertThat(startUpSuccess, is(equalTo(true)));
//Thread.sleep(1000);
}
Expand All @@ -50,8 +50,10 @@ public void createEmptyCartForUser_whenNewCartCreated() throws IOException {
assertThat(code, is((equalTo(201))));
String locationUrl = response.getFirstHeader("Location").getValue();
assertThat(locationUrl, notNullValue());
String body = EntityUtils.toString(response.getEntity());
response.close();

System.out.println(String.format("Created cart with url: %s", locationUrl));
// Was post and returned 201, due to match on other path?, but there was not a full path match...
// Every once in a while the test will fail due to recovery not working... and ahppens with changing error code
//
Expand Down

0 comments on commit dbb629c

Please sign in to comment.