> On March 31, 2016, 6:26 p.m., Bill Farner wrote:
> > src/test/java/org/apache/aurora/scheduler/http/LeaderHealthTest.java, lines 
> > 54-58
> > <https://reviews.apache.org/r/45511/diff/4/?file=1320482#file1320482line54>
> >
> >     `LeaderHealth` only cares about interfacing with `LeaderRedirect`, and 
> > therefore a unit test should aim to avoid pulling in other details of the 
> > `LeaderRedirect` implementation.
> >     
> >     You should be fine to only mock `LeaderRedirect` in this test.

I want to but seems like this is the easiest to test the three cases. For me to 
do that, I need to be able to set state on the LeaderRedirector or have it 
instantiated in one of the three states - Leader, NotLeader, NoLeader. I am 
probably missing some understanding of the mocking framework here since this is 
my first patch. But reusing the LeaderRedirector as is was the easiest to test 
these cases. Also, the LeaderHealth and LeaderRedirector are related closely. 
Let me know if there is another way.


- Ashwin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/45511/#review126383
-----------------------------------------------------------


On March 31, 2016, 5:06 a.m., Ashwin Murthy wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45511/
> -----------------------------------------------------------
> 
> (Updated March 31, 2016, 5:06 a.m.)
> 
> 
> Review request for Aurora and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> AURORA-1493: create ELB-friendly endpoint to detect leading scheduler. The 
> fix is to add a new endpoint - "/leaderhealth" which returns http status code 
> 200 (OK) if the instance is the leader. If the instance is not the leader but 
> a leading exists, returns 500 (Internal server error). If there is no leader 
> at all, returns 503 (Service unavailable)
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderHealth.java 
> PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderHealthTest.java 
> PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/45511/diff/
> 
> 
> Testing
> -------
> 
> Added new unit test
> 
> 
> Thanks,
> 
> Ashwin Murthy
> 
>

Reply via email to