[wisdom-test]Create assertj assertions specific to the wisdom api. #376

Closed
barjo opened this Issue Nov 20, 2014 · 7 comments

Comments

Projects
None yet
2 participants
@barjo
Member

barjo commented Nov 20, 2014

The main goal is to provide assertion for the ActionResult.

@barjo barjo added the feature label Nov 20, 2014

@barjo barjo self-assigned this Nov 20, 2014

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Nov 20, 2014

Member

Does it make sense to provide such feature for http response (blackbox
test) ?

Sent from my iPhone

On 20 nov. 2014, at 04:28, Jonathan Bardin notifications@github.com wrote:

The main goal is to provide assertion for the ActionResult
https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-test/src/main/java/org/wisdom/test/parents/Action.java#L176
.


Reply to this email directly or view it on GitHub
#376.

Member

cescoffier commented Nov 20, 2014

Does it make sense to provide such feature for http response (blackbox
test) ?

Sent from my iPhone

On 20 nov. 2014, at 04:28, Jonathan Bardin notifications@github.com wrote:

The main goal is to provide assertion for the ActionResult
https://github.com/wisdom-framework/wisdom/blob/master/core/wisdom-test/src/main/java/org/wisdom/test/parents/Action.java#L176
.


Reply to this email directly or view it on GitHub
#376.

@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Nov 20, 2014

Member

It shouldn't me much more work and I think that it could be useful, as you say, for black-box test. Let's add an assertion for it too.

Member

barjo commented Nov 20, 2014

It shouldn't me much more work and I think that it could be useful, as you say, for black-box test. Let's add an assertion for it too.

@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Nov 20, 2014

Member

Do you prefer:

  1. assertThat(result).status().isOK()
  2. assertThat(result).isOK()
  3. assertThat(result).hasStatus(Status.OK)

In the second case, I can reuse status for HttpResponse too
assertThat(response).status().isOK()
The third case is almost free, so it will be provided.

It will avoid the Assertions to have too much assert case too, but it makes it a bit verbose.

WDYT

Member

barjo commented Nov 20, 2014

Do you prefer:

  1. assertThat(result).status().isOK()
  2. assertThat(result).isOK()
  3. assertThat(result).hasStatus(Status.OK)

In the second case, I can reuse status for HttpResponse too
assertThat(response).status().isOK()
The third case is almost free, so it will be provided.

It will avoid the Assertions to have too much assert case too, but it makes it a bit verbose.

WDYT

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Nov 20, 2014

Member

I would say that the best way would be be able to chain the check:

assertThat(result).hasStatus(200).containsInBody("<h1>welcome</h1>").hasInSession("key", "value");
Member

cescoffier commented Nov 20, 2014

I would say that the best way would be be able to chain the check:

assertThat(result).hasStatus(200).containsInBody("<h1>welcome</h1>").hasInSession("key", "value");
@barjo

This comment has been minimized.

Show comment
Hide comment
@barjo

barjo Nov 20, 2014

Member

If we want to prevent from breaking the chain, only the third option as you outline it, make sens.

Member

barjo commented Nov 20, 2014

If we want to prevent from breaking the chain, only the third option as you outline it, make sens.

cescoffier added a commit that referenced this issue Nov 24, 2014

Integrate the assertion from @barjo related to #376
Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>
@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Nov 24, 2014

Member

I've integrate your assertions and fixed the classloader issue.

Member

cescoffier commented Nov 24, 2014

I've integrate your assertions and fixed the classloader issue.

barjo pushed a commit that referenced this issue Nov 25, 2014

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Dec 27, 2014

Member

Initial support in the 0.7. Will be improve next.

Member

cescoffier commented Dec 27, 2014

Initial support in the 0.7. Will be improve next.

@cescoffier cescoffier closed this Dec 27, 2014

@cescoffier cescoffier added this to the 0.7 milestone Dec 27, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment