@Test public void shouldGetPagePropertiesCallback() { Callback callbackOne = mock(Callback.class); Callback callbackTwo = mock(PagePropertiesCallback.class); Callback callbackThree = mock(Callback.class); Callback[] callbacks = new Callback[]{callbackOne, callbackTwo, callbackThree}; given(authContext.getRequirements(true)).willReturn(callbacks); PagePropertiesCallback pagePropertiesCallback = loginProcess.getPagePropertiesCallback(); verify(authContext).getRequirements(true); assertEquals(pagePropertiesCallback, callbackTwo); }
public PagePropertiesCallback getPagePropertiesCallback() { PagePropertiesCallback pagePropertiesCallback = null; for (Callback callback : authContext.getRequirements(true)) { if (callback instanceof PagePropertiesCallback) { pagePropertiesCallback = (PagePropertiesCallback) callback; break; } } return pagePropertiesCallback; }
LoginProcess { public PagePropertiesCallback getPagePropertiesCallback() { PagePropertiesCallback pagePropertiesCallback = null; for (Callback callback : authContext.getRequirements(true)) { if (callback instanceof PagePropertiesCallback) { pagePropertiesCallback = (PagePropertiesCallback) callback; break; } } return pagePropertiesCallback; } }
LoginProcess { public PagePropertiesCallback getPagePropertiesCallback() { PagePropertiesCallback pagePropertiesCallback = null; for (Callback callback : authContext.getRequirements(true)) { if (callback instanceof PagePropertiesCallback) { pagePropertiesCallback = (PagePropertiesCallback) callback; break; } } return pagePropertiesCallback; } LoginProcess(LoginAuthenticator loginAuthenticator, LoginConfiguration loginConfiguration,
            AuthContextLocalWrapper authContext, CoreServicesWrapper coreServicesWrapper); }
LoginProcess { public PagePropertiesCallback getPagePropertiesCallback() { PagePropertiesCallback pagePropertiesCallback = null; for (Callback callback : authContext.getRequirements(true)) { if (callback instanceof PagePropertiesCallback) { pagePropertiesCallback = (PagePropertiesCallback) callback; break; } } return pagePropertiesCallback; } LoginProcess(LoginAuthenticator loginAuthenticator, LoginConfiguration loginConfiguration,
            AuthContextLocalWrapper authContext, CoreServicesWrapper coreServicesWrapper); LoginStage getLoginStage(); Callback[] getCallbacks(); PagePropertiesCallback getPagePropertiesCallback(); LoginProcess next(Callback[] callbacks); boolean isSuccessful(); AuthContextLocalWrapper getAuthContext(); LoginConfiguration getLoginConfiguration(); }
LoginProcess { public PagePropertiesCallback getPagePropertiesCallback() { PagePropertiesCallback pagePropertiesCallback = null; for (Callback callback : authContext.getRequirements(true)) { if (callback instanceof PagePropertiesCallback) { pagePropertiesCallback = (PagePropertiesCallback) callback; break; } } return pagePropertiesCallback; } LoginProcess(LoginAuthenticator loginAuthenticator, LoginConfiguration loginConfiguration,
            AuthContextLocalWrapper authContext, CoreServicesWrapper coreServicesWrapper); LoginStage getLoginStage(); Callback[] getCallbacks(); PagePropertiesCallback getPagePropertiesCallback(); LoginProcess next(Callback[] callbacks); boolean isSuccessful(); AuthContextLocalWrapper getAuthContext(); LoginConfiguration getLoginConfiguration();  }