Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

#37 test for FbUnauthorized #57

Merged
merged 2 commits into from
Jul 17, 2019
Merged

#37 test for FbUnauthorized #57

merged 2 commits into from
Jul 17, 2019

Conversation

olenagerasimova
Copy link
Contributor

For #37

  • added field EnvironmentVariables to FbUnauthorized
  • implemented unit test
  • removed puzzle

@0crat
Copy link

0crat commented Jul 4, 2019

Job #57 is now in scope, role is REV

@0crat
Copy link

0crat commented Jul 4, 2019

This pull request #57 is assigned to @victornoel/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @g4s8/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

Copy link
Contributor

@victornoel victornoel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova some comments

@@ -106,7 +107,7 @@ public void run() {
new TkCloseIssue(this.users)
)
),
new FbUnauthorized()
new FbUnauthorized(new EnvironmentVariables())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova BotApp should be the one taking an EnvironmentVariables object and passing it to FbUnauthorized as well as other objects if needed.

* @since 1.0
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
*/
class FbUnauthorizedTest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova class must be final

"Returns link to login",
new FbUnauthorized(
new EnvironmentVariables(new MapOf<>(new MapEntry<>("APP_HOST", host)))
).handle(null, new GhAuthException(new User.Fake(new MkGithub()), ""))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova pass a simple new Update() instead of null

void returnsEmptyResponse() {
new Assertion<>(
"Returns empty response",
new FbUnauthorized(new EnvironmentVariables()).handle(null, new Throwable())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova pass a simple new Update() instead of null

.orElseThrow(
() -> new IllegalStateException("Response is not supposed to be empty!")
).xml(),
XhtmlMatchers.hasXPath(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova if possible replace this static call with an OO solution. For example by composing new MatcherOf and the use of xembly for testing the content of the xml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

@Test
void returnsEmptyResponse() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olenagerasimova can we rename this to something like 'ignoresNonGhAuthException` or similar to better explicit the intent (maybe I misunderstood the intent though)?

@olenagerasimova
Copy link
Contributor Author

@victornoel done

@victornoel
Copy link
Contributor

@g4s8 same question as in #58 (comment) about XhtmlMatchers static methods. Apart from that I'm good

@0crat
Copy link

0crat commented Jul 9, 2019

@victornoel/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@victornoel
Copy link
Contributor

@g4s8 ping

1 similar comment
@olenagerasimova
Copy link
Contributor Author

@g4s8 ping

@g4s8
Copy link
Owner

g4s8 commented Jul 17, 2019

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jul 17, 2019

@rultor merge

@g4s8 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit b529b3e into g4s8:master Jul 17, 2019
@rultor
Copy link
Contributor

rultor commented Jul 17, 2019

@rultor merge

@g4s8 Done! FYI, the full log is here (took me 3min)

@0crat
Copy link

0crat commented Jul 17, 2019

@ammaratef45/z please review this job completed by @victornoel/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope label Jul 17, 2019
@0crat
Copy link

0crat commented Jul 17, 2019

Code review was too long (12 days), architects (@g4s8) were penalized, see §55

@0crat
Copy link

0crat commented Jul 17, 2019

The job #57 is now out of scope

@0crat
Copy link

0crat commented Jul 17, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @g4s8/z

@ammaratef45
Copy link

@0crat quality good

@0crat
Copy link

0crat commented Jul 17, 2019

Order was finished, quality is "good": +20 point(s) just awarded to @victornoel/z

@0crat
Copy link

0crat commented Jul 17, 2019

Quality review completed: +4 point(s) just awarded to @ammaratef45/z

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants