target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testDoesNotMatchWithoutQueryParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.EMPTY_MAP); assertFalse(matcher.matches(request)); } | @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... |
@Test public void testMatchesWithValidParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.singletonMap(VALID_PARAMETER, (Object) "123")); assertTrue(matcher.matches(request)); } | @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... |
@Test public void testDoesNotMatchWithInvalidParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.singletonMap("some_parameter", (Object) "123")); assertFalse(matcher.matches(request)); } | @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); } | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... | QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest... |
@Test public void testMatchesMethodGet() throws Exception { request.setMethod(HttpMethod.GET.name()); assertFalse(matcher.matches(request)); } | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testMatchesMethodPost() throws Exception { prepareRequest(HttpMethod.POST, ROOT_CONTEXT_PATH, "some/random/uri"); assertTrue(matcher.matches(request)); prepareRequest(HttpMethod.POST, SUB_CONTEXT_PATH, "some/random/uri"); assertTrue(matcher.matches(request)); } | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testMatchesKeycloakLogout() throws Exception { prepareRequest(HttpMethod.POST, ROOT_CONTEXT_PATH, AdapterConstants.K_LOGOUT); assertFalse(matcher.matches(request)); prepareRequest(HttpMethod.POST, SUB_CONTEXT_PATH, AdapterConstants.K_LOGOUT); assertFalse(matcher.matches(request)); } | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testMatchesKeycloakPushNotBefore() throws Exception { prepareRequest(HttpMethod.POST, ROOT_CONTEXT_PATH, AdapterConstants.K_PUSH_NOT_BEFORE); assertFalse(matcher.matches(request)); prepareRequest(HttpMethod.POST, SUB_CONTEXT_PATH, AdapterConstants.K_PUSH_NOT_BEFORE); assertFalse(matcher.matches(reques... | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testMatchesKeycloakQueryBearerToken() throws Exception { prepareRequest(HttpMethod.POST, ROOT_CONTEXT_PATH, AdapterConstants.K_QUERY_BEARER_TOKEN); assertFalse(matcher.matches(request)); prepareRequest(HttpMethod.POST, SUB_CONTEXT_PATH, AdapterConstants.K_QUERY_BEARER_TOKEN); assertFalse(matcher.match... | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testMatchesKeycloakTestAvailable() throws Exception { prepareRequest(HttpMethod.POST, ROOT_CONTEXT_PATH, AdapterConstants.K_TEST_AVAILABLE); assertFalse(matcher.matches(request)); prepareRequest(HttpMethod.POST, SUB_CONTEXT_PATH, AdapterConstants.K_TEST_AVAILABLE); assertFalse(matcher.matches(request)... | public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } } | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... | KeycloakCsrfRequestMatcher implements RequestMatcher { public boolean matches(HttpServletRequest request) { String uri = request.getRequestURI().replaceFirst(request.getContextPath(), ""); return !allowedEndpoints.matcher(uri).matches() && !allowedMethods.matcher(request.getMethod()).matches(); } boolean matches(HttpS... |
@Test public void testAttemptAuthenticationExpectRedirect() throws Exception { when(keycloakDeployment.getAuthUrl()).thenReturn(KeycloakUriBuilder.fromUri("http: when(keycloakDeployment.getResourceName()).thenReturn("resource-name"); when(keycloakDeployment.getStateCookieName()).thenReturn("kc-cookie"); when(keycloakDe... | @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting Keycloak authentication"); HttpFacade facade = new SimpleHttpFacade(request, response); KeycloakDeployment deployment = ad... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... |
@Test public void testValidityOfCertificatesNotValidYet() throws GeneralSecurityException { KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(512); KeyPair keyPair = kpg.generateKeyPair(); X509Certificate certificate = createCertificate("CN=keycloak-test", new Date(System.currentTimeMillis() + ... | public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Time.currentTimeMillis())... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... |
@Test(expected = KeycloakAuthenticationException.class) public void testAttemptAuthenticationWithInvalidToken() throws Exception { request.addHeader("Authorization", "Bearer xxx"); filter.attemptAuthentication(request, response); } | @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting Keycloak authentication"); HttpFacade facade = new SimpleHttpFacade(request, response); KeycloakDeployment deployment = ad... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... |
@Test(expected = KeycloakAuthenticationException.class) public void testAttemptAuthenticationWithInvalidTokenBearerOnly() throws Exception { when(keycloakDeployment.isBearerOnly()).thenReturn(Boolean.TRUE); request.addHeader("Authorization", "Bearer xxx"); filter.attemptAuthentication(request, response); } | @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting Keycloak authentication"); HttpFacade facade = new SimpleHttpFacade(request, response); KeycloakDeployment deployment = ad... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { log.debug("Attempting... |
@Test public void testSuccessfulAuthenticationInteractive() throws Exception { request.setRequestURI("http: Authentication authentication = new KeycloakAuthenticationToken(keycloakAccount, true, authorities); filter.successfulAuthentication(request, response, chain, authentication); verify(successHandler).onAuthenticat... | @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (authResult instanceof KeycloakAuthenticationToken && ((KeycloakAuthenticationToken) authResult).isInteractive()) { super.su... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... |
@Test public void testSuccessfulAuthenticationBearer() throws Exception { Authentication authentication = new KeycloakAuthenticationToken(keycloakAccount, false, authorities); this.setBearerAuthHeader(request); filter.successfulAuthentication(request, response, chain, authentication); verify(chain).doFilter(eq(request)... | @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (authResult instanceof KeycloakAuthenticationToken && ((KeycloakAuthenticationToken) authResult).isInteractive()) { super.su... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... |
@Test public void testSuccessfulAuthenticationBasicAuth() throws Exception { Authentication authentication = new KeycloakAuthenticationToken(keycloakAccount, false, authorities); this.setBasicAuthHeader(request); filter.successfulAuthentication(request, response, chain, authentication); verify(chain).doFilter(eq(reques... | @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (authResult instanceof KeycloakAuthenticationToken && ((KeycloakAuthenticationToken) authResult).isInteractive()) { super.su... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void successfulAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain chain, Authentication authResult) throws IOException, ServletException { if (... |
@Test public void testUnsuccessfulAuthenticationInteractive() throws Exception { AuthenticationException exception = new BadCredentialsException("OOPS"); filter.unsuccessfulAuthentication(request, response, exception); verify(failureHandler).onAuthenticationFailure(eq(request), eq(response), eq(exception)); } | @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessfulAuthentication(request, response, failed); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... |
@Test public void testUnsuccessfulAuthenticatioBearer() throws Exception { AuthenticationException exception = new BadCredentialsException("OOPS"); this.setBearerAuthHeader(request); filter.unsuccessfulAuthentication(request, response, exception); verify(failureHandler).onAuthenticationFailure(any(HttpServletRequest.cl... | @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessfulAuthentication(request, response, failed); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... |
@Test public void testUnsuccessfulAuthenticatioBasicAuth() throws Exception { AuthenticationException exception = new BadCredentialsException("OOPS"); this.setBasicAuthHeader(request); filter.unsuccessfulAuthentication(request, response, exception); verify(failureHandler).onAuthenticationFailure(any(HttpServletRequest.... | @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessfulAuthentication(request, response, failed); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... |
@Test public void testDefaultFailureHanlder() throws Exception { AuthenticationException exception = new BadCredentialsException("OOPS"); filter.setAuthenticationFailureHandler(keycloakFailureHandler); filter.unsuccessfulAuthentication(request, response, exception); verify(response).sendError(eq(HttpServletResponse.SC_... | @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessfulAuthentication(request, response, failed); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override protected void unsuccessfulAuthentication(HttpServletRequest request, HttpServletResponse response, AuthenticationException failed) throws IOException, ServletException { super.unsuccessf... |
@Test(expected = UnsupportedOperationException.class) public void testSetAllowSessionCreation() throws Exception { filter.setAllowSessionCreation(true); } | @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session creation policy"); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session creation polic... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session creation polic... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session creation polic... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setAllowSessionCreation(boolean allowSessionCreation) { throw new UnsupportedOperationException("This filter does not support explicitly setting a session creation polic... |
@Test public void testValidityOfCertificatesHasExpired() throws GeneralSecurityException { KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(512); KeyPair keyPair = kpg.generateKeyPair(); X509Certificate certificate = createCertificate("CN=keycloak-test", new Date(System.currentTimeMillis() - 1... | public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Time.currentTimeMillis())... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... | CertificateValidator { public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Ti... |
@Test(expected = UnsupportedOperationException.class) public void testSetContinueChainBeforeSuccessfulAuthentication() throws Exception { filter.setContinueChainBeforeSuccessfulAuthentication(true); } | @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter does not support explicitly setting a continue chain before success policy"); } | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter does not suppo... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter does not suppo... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter does not suppo... | KeycloakAuthenticationProcessingFilter extends AbstractAuthenticationProcessingFilter implements ApplicationContextAware { @Override public final void setContinueChainBeforeSuccessfulAuthentication(boolean continueChainBeforeSuccessfulAuthentication) { throw new UnsupportedOperationException("This filter does not suppo... |
@Test public void testCreateAdapterTokenStore() throws Exception { when(deployment.getTokenStore()).thenReturn(TokenStore.SESSION); AdapterSessionStore store = factory.createAdapterTokenStore(deployment, request, response); assertTrue(store instanceof SpringSecurityTokenStore); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test public void testCreateAdapterTokenStoreUsingCookies() throws Exception { when(deployment.getTokenStore()).thenReturn(TokenStore.COOKIE); AdapterSessionStore store = factory.createAdapterTokenStore(deployment, request, response); assertTrue(store instanceof SpringSecurityCookieTokenStore); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test(expected = IllegalArgumentException.class) public void testCreateAdapterTokenStoreNullDeployment() throws Exception { factory.createAdapterTokenStore(null, request, response); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test(expected = IllegalArgumentException.class) public void testCreateAdapterTokenStoreNullRequest() throws Exception { factory.createAdapterTokenStore(deployment, null, response); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test public void testCreateAdapterTokenStoreNullResponse() throws Exception { when(deployment.getTokenStore()).thenReturn(TokenStore.SESSION); factory.createAdapterTokenStore(deployment, request, null); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test(expected = IllegalArgumentException.class) public void testCreateAdapterTokenStoreNullResponseUsingCookies() throws Exception { when(deployment.getTokenStore()).thenReturn(TokenStore.COOKIE); factory.createAdapterTokenStore(deployment, request, null); } | @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() == TokenStore.COOKIE) { return new SpringSecurityCookieTokenStore(deployment,... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... | SpringSecurityAdapterTokenStoreFactory implements AdapterTokenStoreFactory { @Override public AdapterTokenStore createAdapterTokenStore(KeycloakDeployment deployment, HttpServletRequest request, HttpServletResponse response) { Assert.notNull(deployment, "KeycloakDeployment is required"); if (deployment.getTokenStore() ... |
@Test public void testIsCached() throws Exception { Authentication authentication = new PreAuthenticatedAuthenticationToken("foo", "bar", Collections.singleton(new KeycloakRole("ROLE_FOO"))); SecurityContextHolder.getContext().setAuthentication(authentication); assertFalse(store.isCached(requestAuthenticator)); } | @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext keycloakSecurityContext; if (context == null || context.getAuthenticat... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext keycloakSecuri... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext keycloakSecuri... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext keycloakSecuri... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public boolean isCached(RequestAuthenticator authenticator) { logger.debug("Checking if {} is cached", authenticator); SecurityContext context = SecurityContextHolder.getContext(); KeycloakAuthenticationToken token; KeycloakSecurityContext keycloakSecuri... |
@Test public void testSaveAccountInfo() throws Exception { OidcKeycloakAccount account = new SimpleKeycloakAccount(principal, Collections.singleton("FOO"), keycloakSecurityContext); Authentication authentication; store.saveAccountInfo(account); authentication = SecurityContextHolder.getContext().getAuthentication(); as... | @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account %s, but already have %s", account, authentication)); } l... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... |
@Test(expected = IllegalStateException.class) public void testSaveAccountInfoInvalidAuthenticationType() throws Exception { OidcKeycloakAccount account = new SimpleKeycloakAccount(principal, Collections.singleton("FOO"), keycloakSecurityContext); Authentication authentication = new PreAuthenticatedAuthenticationToken("... | @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account %s, but already have %s", account, authentication)); } l... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void saveAccountInfo(OidcKeycloakAccount account) { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); if (authentication != null) { throw new IllegalStateException(String.format("Went to save Keycloak account ... |
@Test public void proxyMappingFromEmptyListShouldBeEmpty() { assertThat(new ProxyMappings(new ArrayList<>()).isEmpty(), is(true)); } | public boolean isEmpty() { return this.entries.isEmpty(); } | ProxyMappings { public boolean isEmpty() { return this.entries.isEmpty(); } } | ProxyMappings { public boolean isEmpty() { return this.entries.isEmpty(); } ProxyMappings(List<ProxyMapping> entries); } | ProxyMappings { public boolean isEmpty() { return this.entries.isEmpty(); } ProxyMappings(List<ProxyMapping> entries); static ProxyMappings valueOf(List<String> proxyMappings); static ProxyMappings valueOf(String... proxyMappings); boolean isEmpty(); ProxyMapping getProxyFor(String hostname); static void clearCache(); ... | ProxyMappings { public boolean isEmpty() { return this.entries.isEmpty(); } ProxyMappings(List<ProxyMapping> entries); static ProxyMappings valueOf(List<String> proxyMappings); static ProxyMappings valueOf(String... proxyMappings); boolean isEmpty(); ProxyMapping getProxyFor(String hostname); static void clearCache(); ... |
@Test public void testLogout() throws Exception { MockHttpSession session = (MockHttpSession) request.getSession(true); assertFalse(session.isInvalid()); store.logout(); assertTrue(session.isInvalid()); } | @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityContextHolder.clearContext(); } | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityContextHolder.cle... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityContextHolder.cle... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityContextHolder.cle... | SpringSecurityTokenStore implements AdapterTokenStore { @Override public void logout() { logger.debug("Handling logout request"); HttpSession session = request.getSession(false); if (session != null) { session.setAttribute(KeycloakSecurityContext.class.getName(), null); session.invalidate(); } SecurityContextHolder.cle... |
@Test public void should_throw_exception_when_configuration_file_was_not_found() throws Exception { adapterDeploymentContextFactoryBean = new AdapterDeploymentContextFactoryBean(getEmptyResource()); expectedException.expect(FileNotFoundException.class); expectedException.expectMessage("Unable to locate Keycloak configu... | @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloak deployment from configuration file: {}", keycloakConfigFileResource); KeycloakDeployment deployment = l... | AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloa... | AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloa... | AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloa... | AdapterDeploymentContextFactoryBean implements FactoryBean<AdapterDeploymentContext>, InitializingBean { @Override public void afterPropertiesSet() throws Exception { if (keycloakConfigResolver != null) { adapterDeploymentContext = new AdapterDeploymentContext(keycloakConfigResolver); } else { log.info("Loading Keycloa... |
@Test public void testResetCookie() throws Exception { response.resetCookie(COOKIE_NAME, COOKIE_PATH); verify(mockResponse).addCookie(any(Cookie.class)); assertEquals(COOKIE_NAME, mockResponse.getCookie(COOKIE_NAME).getName()); assertEquals(COOKIE_PATH, mockResponse.getCookie(COOKIE_NAME).getPath()); assertEquals(0, mo... | @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } | WrappedHttpServletResponse implements Response { @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } } | WrappedHttpServletResponse implements Response { @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } WrappedHttpServletResponse(HttpServletResponse response); @Override void res... | WrappedHttpServletResponse implements Response { @Override public void resetCookie(String name, String path) { Cookie cookie = new Cookie(name, ""); cookie.setMaxAge(0); if (path != null) { cookie.setPath(path); } response.addCookie(cookie); } WrappedHttpServletResponse(HttpServletResponse response); @Override void res... |
@Test public void testSetCookie() throws Exception { int maxAge = 300; response.setCookie(COOKIE_NAME, COOKIE_VALUE, COOKIE_PATH, COOKIE_DOMAIN, maxAge, false, true); verify(mockResponse).addCookie(any(Cookie.class)); assertEquals(COOKIE_NAME, mockResponse.getCookie(COOKIE_NAME).getName()); assertEquals(COOKIE_PATH, mo... | @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } cookie.setMaxAge(maxAge); cookie.setSecure(secure)... | WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } c... | WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } c... | WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } c... | WrappedHttpServletResponse implements Response { @Override public void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly) { Cookie cookie = new Cookie(name, value); if (path != null) { cookie.setPath(path); } if (domain != null) { cookie.setDomain(domain); } c... |
@Test public void testSetStatus() throws Exception { int status = HttpStatus.OK.value(); response.setStatus(status); verify(mockResponse).setStatus(eq(status)); assertEquals(status, mockResponse.getStatus()); } | @Override public void setStatus(int status) { response.setStatus(status); } | WrappedHttpServletResponse implements Response { @Override public void setStatus(int status) { response.setStatus(status); } } | WrappedHttpServletResponse implements Response { @Override public void setStatus(int status) { response.setStatus(status); } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void setStatus(int status) { response.setStatus(status); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int... | WrappedHttpServletResponse implements Response { @Override public void setStatus(int status) { response.setStatus(status); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int... |
@Test public void testAddHeader() throws Exception { String headerValue = "foo"; response.addHeader(HEADER, headerValue); verify(mockResponse).addHeader(eq(HEADER), eq(headerValue)); assertTrue(mockResponse.containsHeader(HEADER)); } | @Override public void addHeader(String name, String value) { response.addHeader(name, value); } | WrappedHttpServletResponse implements Response { @Override public void addHeader(String name, String value) { response.addHeader(name, value); } } | WrappedHttpServletResponse implements Response { @Override public void addHeader(String name, String value) { response.addHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void addHeader(String name, String value) { response.addHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path... | WrappedHttpServletResponse implements Response { @Override public void addHeader(String name, String value) { response.addHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path... |
@Test public void testSetHeader() throws Exception { String headerValue = "foo"; response.setHeader(HEADER, headerValue); verify(mockResponse).setHeader(eq(HEADER), eq(headerValue)); assertTrue(mockResponse.containsHeader(HEADER)); } | @Override public void setHeader(String name, String value) { response.setHeader(name, value); } | WrappedHttpServletResponse implements Response { @Override public void setHeader(String name, String value) { response.setHeader(name, value); } } | WrappedHttpServletResponse implements Response { @Override public void setHeader(String name, String value) { response.setHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void setHeader(String name, String value) { response.setHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path... | WrappedHttpServletResponse implements Response { @Override public void setHeader(String name, String value) { response.setHeader(name, value); } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path... |
@Test public void testGetOutputStream() throws Exception { assertNotNull(response.getOutputStream()); verify(mockResponse).getOutputStream(); } | @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } | WrappedHttpServletResponse implements Response { @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } } | WrappedHttpServletResponse implements Response { @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void res... | WrappedHttpServletResponse implements Response { @Override public OutputStream getOutputStream() { try { return response.getOutputStream(); } catch (IOException e) { throw new RuntimeException("Unable to return response output stream", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void res... |
@Test public void testSendError() throws Exception { int status = HttpStatus.UNAUTHORIZED.value(); String reason = HttpStatus.UNAUTHORIZED.getReasonPhrase(); response.sendError(status, reason); verify(mockResponse).sendError(eq(status), eq(reason)); assertEquals(status, mockResponse.getStatus()); assertEquals(reason, m... | @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } | WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } } | WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String ... | WrappedHttpServletResponse implements Response { @Override public void sendError(int code) { try { response.sendError(code); } catch (IOException e) { throw new RuntimeException("Unable to set HTTP status", e); } } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String ... |
@Test @Ignore public void testEnd() throws Exception { } | @Override public void end() { } | WrappedHttpServletResponse implements Response { @Override public void end() { } } | WrappedHttpServletResponse implements Response { @Override public void end() { } WrappedHttpServletResponse(HttpServletResponse response); } | WrappedHttpServletResponse implements Response { @Override public void end() { } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly); ... | WrappedHttpServletResponse implements Response { @Override public void end() { } WrappedHttpServletResponse(HttpServletResponse response); @Override void resetCookie(String name, String path); @Override void setCookie(String name, String value, String path, String domain, int maxAge, boolean secure, boolean httpOnly); ... |
@Test public void shouldReturnProxy1ForConfiguredProxyMapping() { ProxyMapping proxy = proxyMappings.getProxyFor("account.google.com"); assertThat(proxy.getProxyHost(), is(notNullValue())); assertThat(proxy.getProxyHost().getHostName(), is("proxy1")); } | public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (proxyMapping == n... | ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p... | ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p... | ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p... | ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p... |
@Test public void netAmount() throws Exception { InvoiceForTesting invoiceForTesting = new InvoiceForTesting(); InvoiceItemForTesting item1 = new InvoiceItemForTesting(invoiceForTesting); item1.setNetAmount(new BigDecimal("123.45")); InvoiceItemForTesting item2 = new InvoiceItemForTesting(invoiceForTesting); item2.setN... | @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } } | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } Invoice(final String keyProperties); } | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } Invoice(final String keyProperties); @Property(hidden = Where.ALL_TABLES) @PropertyLayout( named... | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Property(notPersisted = true) public BigDecimal getTotalNetAmount() { return sum(InvoiceItem::getNetAmount); } Invoice(final String keyProperties); @Property(hidden = Where.ALL_TABLES) @PropertyLayout( named... |
@Ignore @Test public void whenValid() { Location location = locationLookupService.lookup("10 Downing Street,London,UK"); assertThat(location, is(not(nullValue()))); assertEquals(51.503, location.getLatitude(), 0.01); assertEquals(-0.128, location.getLongitude(), 0.01); } | @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfig(requestConfig) .useSys... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... |
@Ignore @Test public void whenInvalid() { Location location = locationLookupService.lookup("$%$%^Y%^fgnsdlfk glfg"); assertThat(location, is(nullValue())); } | @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfig(requestConfig) .useSys... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... | LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfi... |
@Ignore @Test public void firstPageOf() throws Exception { URL resource = Resources.getResource(PdfManipulatorTest.class, "sample-invoice.pdf"); byte[] bytes = Resources.toByteArray(resource); Stamp stamp = new Stamp(Arrays.asList( "approved by: Joe Bloggs", "approved on: 3-May-2017 14:15", "doc barcode: 3013011234" ),... | @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Splitter(); final List<PDDocument>... | PdfManipulator { @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Splitter(); final... | PdfManipulator { @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Splitter(); final... | PdfManipulator { @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Splitter(); final... | PdfManipulator { @Programmatic public byte[] extractAndStamp( final byte[] docBytes, final ExtractSpec extractSpec, final Stamp stamp) throws IOException { List<byte[]> extractedPageDocBytes = Lists.newArrayList(); final PDDocument pdDoc = PDDocument.load(docBytes); try { final Splitter splitter = new Splitter(); final... |
@Test public void subtractHandlingNulls() throws Exception { BigDecimal amount; BigDecimal amountToSubtract; BigDecimal result; amount = new BigDecimal("100"); amountToSubtract = new BigDecimal("10.11"); result = FinancialAmountUtil.subtractHandlingNulls(amount, amountToSubtract); Assertions.assertThat(result).isEqualT... | public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } | FinancialAmountUtil { public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } } | FinancialAmountUtil { public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } } | FinancialAmountUtil { public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } static BigDecimal subtractHandlingNulls(final BigDecim... | FinancialAmountUtil { public static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSubtract) { if (amountToSubtract == null) return amount; return amount == null ? amountToSubtract.negate() : amount.subtract(amountToSubtract); } static BigDecimal subtractHandlingNulls(final BigDecim... |
@Test public void addHandlingNulls() throws Exception { BigDecimal amount; BigDecimal amountToAdd; BigDecimal result; amount = new BigDecimal("100"); amountToAdd = new BigDecimal("10.11"); result = FinancialAmountUtil.addHandlingNulls(amount, amountToAdd); Assertions.assertThat(result).isEqualTo(new BigDecimal("110.11"... | public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } | FinancialAmountUtil { public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } } | FinancialAmountUtil { public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } } | FinancialAmountUtil { public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSub... | FinancialAmountUtil { public static BigDecimal addHandlingNulls(final BigDecimal amount, final BigDecimal amountToAdd) { if (amountToAdd == null) return amount; return amount == null ? amountToAdd : amount.add(amountToAdd); } static BigDecimal subtractHandlingNulls(final BigDecimal amount, final BigDecimal amountToSub... |
@Test public void stripPdfSuffixFromDocumentName() { Assertions.assertThat(DocumentNameUtil.stripPdfSuffixFromDocumentName("S123456789.PDF")).isEqualTo("S123456789"); Assertions.assertThat(DocumentNameUtil.stripPdfSuffixFromDocumentName("S123456789.pdf")).isEqualTo("S123456789"); Assertions.assertThat(DocumentNameUtil.... | public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } | DocumentNameUtil { public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } } | DocumentNameUtil { public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } } | DocumentNameUtil { public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } static String stripPdfSuffixFromDocumentName(final String documentName); } | DocumentNameUtil { public static String stripPdfSuffixFromDocumentName(final String documentName){ return documentName.replaceAll("(?i)\\.pdf", ""); } static String stripPdfSuffixFromDocumentName(final String documentName); } |
@Test public void coda_year_syntax() throws Exception { String period = "2019/1"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2019-01-01/2020-01-01"); } | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void financial_year_syntax() throws Exception { String period = "F2019"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2018-07-01/2019-07-01"); } | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void financial_year_syntax_2020_and_furtheron() throws Exception { String financialYear2020 = "F2020"; String financialYear2021 = "F2021"; String financialYear2022 = "F2022"; Assertions.assertThat(PeriodUtil.yearFromPeriod(financialYear2020).toString()) .isEqualTo("2019-07-01/2020-07-01"); Assertions.asser... | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void financial_year_syntax_with_month() throws Exception { String period = "F2019/1"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2018-07-01/2019-07-01"); } | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void first_item_with_charge_works() throws Exception { InvoiceForTesting invoice = new InvoiceForTesting(); Charge charge1 = new Charge(); Charge charge2 = new Charge(); InvoiceItem itemWithCharge1 = new InvoiceItemForTesting(invoice); itemWithCharge1.setCharge(charge1); itemWithCharge1.setSequence(VT.bi(1... | @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } } | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } Invoice(final Strin... | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } Invoice(final Strin... | Invoice extends UdoDomainObject2<T> implements WithApplicationTenancyAny, WithApplicationTenancyPathPersisted { @Programmatic public InvoiceItem findFirstItemWithCharge(final Charge charge) { for (InvoiceItem item : getItems()) { if (item.getCharge().equals(charge)) { return item; } } return null; } Invoice(final Strin... |
@Test public void financial_year_syntax_with_month_4() throws Exception { String period = "F2019/4"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2018-07-01/2019-07-01"); } | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void yearFromPeriod_success() throws Exception { String period; period = "F2017M01"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2016-07-01/2017-07-01"); period = "2017Q1"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("2017-01-01/2018-01... | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void yearFromPeriod_fail() throws Exception { String period; period = "f2017M01"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("----------/----------"); period = "201Q1"; Assertions.assertThat(PeriodUtil.yearFromPeriod(period).toString()) .isEqualTo("----------/----------"... | public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { startDate = new... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... | PeriodUtil { public static LocalDateInterval yearFromPeriod(final String period){ if (period == null) { return new LocalDateInterval(); } LocalDate startDate = null; LocalDate endDate = null; if (financialYearPattern.matcher(period).matches()){ Integer year = Integer.valueOf(period.substring(1,5)); if (year<=2021) { st... |
@Test public void periodFromInterval_success() throws Exception { LocalDate startDate; LocalDate endDate; LocalDateInterval interval; startDate = new LocalDate(2017,01,01); endDate = new LocalDate(2017, 12,31); interval = new LocalDateInterval(startDate, endDate); Assertions.assertThat(PeriodUtil.periodFromInterval(int... | public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new LocalDate(202... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... |
@Test public void periodFromInterval_fail() throws Exception { LocalDate startDate; LocalDate endDate; LocalDateInterval interval; startDate = new LocalDate(2017,01,02); endDate = new LocalDate(2017, 12,31); interval = new LocalDateInterval(startDate, endDate); Assertions.assertThat(PeriodUtil.periodFromInterval(interv... | public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new LocalDate(202... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... |
@Test public void isValidPeriod() throws Exception { String period; period = "f2017M01"; Assertions.assertThat(PeriodUtil.isValidPeriod(period)).isEqualTo(false); Assertions.assertThat(PeriodUtil.reasonInvalidPeriod(period)).isEqualTo("Not a valid period; use four digits of the year with optional prefix F for a financi... | public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } | PeriodUtil { public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } } | PeriodUtil { public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } } | PeriodUtil { public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } static LocalDate startDateFromPeriod(final String period); static LocalDate endDateFromPeriod(final String ... | PeriodUtil { public static boolean isValidPeriod(final String period){ if (period!=null && !period.equals("") && !yearFromPeriod(period).equals(new LocalDateInterval(null, null))){ return true; } return false; } static LocalDate startDateFromPeriod(final String period); static LocalDate endDateFromPeriod(final String ... |
@Test public void nine_months_financial_year_from_interval_works() throws Exception { LocalDateInterval localDateInterval; localDateInterval = LocalDateInterval.including(new LocalDate(2019,7,1), new LocalDate(2020,6,30)); Assertions.assertThat(PeriodUtil.periodFromInterval(localDateInterval)).isEqualTo("F2020"); local... | public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new LocalDate(202... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... | PeriodUtil { public static String periodFromInterval(@NotNull final LocalDateInterval interval){ if(interval.isInfinite()) { return null; } LocalDate endDate = interval.endDate(); if (matchesCalendarYear(interval)){ return String.valueOf(endDate.getYear()); } if (matchesFinancialYear(interval)){ if (endDate.equals(new ... |
@Test public void getCodaElement6FromSellerReference() { String frenchSupplierRef = "FR12345"; Assertions.assertThat(IncomingInvoiceExport.getCodaElement6FromSellerReference(frenchSupplierRef)).isEqualTo("FRFO12345"); String belgianSupplierRef = "BE123456"; Assertions.assertThat(IncomingInvoiceExport.getCodaElement6Fro... | public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return null; } | IncomingInvoiceExport { public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return null; } } | IncomingInvoiceExport { public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return null; } Incomin... | IncomingInvoiceExport { public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return null; } Incomin... | IncomingInvoiceExport { public static String getCodaElement6FromSellerReference(final String sellerReference){ if (sellerReference.startsWith("FR")) { return "FRFO".concat(sellerReference.substring(2)); } if (sellerReference.startsWith("BE")){ return "BEFO".concat(sellerReference.substring(2)); } return null; } Incomin... |
@Test public void deriveCodaElement3FromPropertyAndIncomingInvoiceType(){ Assertions.assertThat(IncomingInvoiceExport.deriveCodaElement3FromPropertyAndIncomingInvoiceType(null, null, null)).isNull(); IncomingInvoiceType typeForCorporate = IncomingInvoiceType.CORPORATE_EXPENSES; Property property = new Property(); Asser... | public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL")){ return "BEGGEN0"; } return "FRGGEN0"... | IncomingInvoiceExport { public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL")){ return "BEGG... | IncomingInvoiceExport { public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL")){ return "BEGG... | IncomingInvoiceExport { public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL")){ return "BEGG... | IncomingInvoiceExport { public static String deriveCodaElement3FromPropertyAndIncomingInvoiceType(final FixedAsset property, final IncomingInvoiceType incomingInvoiceType, final String atPath){ if (incomingInvoiceType==IncomingInvoiceType.CORPORATE_EXPENSES){ if (atPath!=null && atPath.startsWith("/BEL")){ return "BEGG... |
@Test public void deriveCodaElement1FromBuyer() throws Exception { Party buyer = new Organisation(); Assertions.assertThat(IncomingInvoiceExport.deriveCodaElement1FromBuyer(null)).isNull(); buyer.setReference("SOMETHING"); Assertions.assertThat(IncomingInvoiceExport.deriveCodaElement1FromBuyer(buyer)).isEqualTo("SOMETH... | public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } | IncomingInvoiceExport { public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } } | IncomingInvoiceExport { public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } IncomingInvoiceExport(
final IncomingInvoiceItem item,
final String doc... | IncomingInvoiceExport { public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } IncomingInvoiceExport(
final IncomingInvoiceItem item,
final String doc... | IncomingInvoiceExport { public static String deriveCodaElement1FromBuyer(Party buyer) { if (buyer==null) return null; if (buyer.getReference().equals("BE00")){ return "BE01EUR"; } return buyer.getReference().concat("EUR"); } IncomingInvoiceExport(
final IncomingInvoiceItem item,
final String doc... |
@Test public void keyToChargeReference() throws Exception { ChargingLine line = new ChargingLine(); line.setKod("123"); line.setKod2("4"); Assertions.assertThat(line.keyToChargeReference()).isEqualTo("SE123-4"); } | String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } | ChargingLine implements Importable { String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } } | ChargingLine implements Importable { String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } ChargingLine(); } | ChargingLine implements Importable { String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease getLease(); LeaseItem getLeaseItem(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) ImportStatus apply(); boolean hideA... | ChargingLine implements Importable { String keyToChargeReference() { return "SE" + getKod() + "-" + getKod2(); } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease getLease(); LeaseItem getLeaseItem(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) ImportStatus apply(); boolean hideA... |
@Test public void deriveOrderNumber() { OrderProjectImportAdapter adapter = new OrderProjectImportAdapter(); adapter.setNumero(2234); adapter.setCentro("CAR"); adapter.setProgressivoCentro("694"); adapter.setCommessa("192"); assertThat(adapter.deriveOrderNumber()).isEqualTo("2234/CAR/694/192"); } | public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) builder.append(getCentro()); builder.append("/"); if (getProgressivoCentro() != null && getCommessa() != null) { bu... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... |
@Test public void appendsZerosToProgressivoCentro() throws Exception { OrderProjectImportAdapter adapter = new OrderProjectImportAdapter(); adapter.setProgressivoCentro("1"); assertThat(adapter.getProgressivoCentro()).isEqualTo("1"); adapter.correctProgressivoCentroIfNecessary(); assertThat(adapter.getProgressivoCentro... | public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getProgressivoCentro() != null && getProgressivoCentro().length() == 2) setProgressivoCentro("0".concat(getProgressivoCentro()));... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getProgressivoCent... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getProgressivoCent... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getProgressivoCent... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public void correctProgressivoCentroIfNecessary() { if (getProgressivoCentro() != null && getProgressivoCentro().length() == 1) setProgressivoCentro("00".concat(getProgressivoCentro())); if (getProgressivoCent... |
@Test public void deriveOrderNumber_when_nulls_oldFormat() { OrderProjectImportAdapter adapter = new OrderProjectImportAdapter(); adapter.setNumero(null); adapter.setCentro("CAR"); adapter.setProgressivoCentro("694"); adapter.setCommessa("192"); adapter.setWorkType(null); assertThat(adapter.deriveOrderNumber()).isNull(... | public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) builder.append(getCentro()); builder.append("/"); if (getProgressivoCentro() != null && getCommessa() != null) { bu... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... |
@Test public void deriveOrderNumber_when_nulls_newFormat() throws Exception { OrderProjectImportAdapter adapter = new OrderProjectImportAdapter(); adapter.setNumero(null); adapter.setCentro("CAR"); adapter.setProgressivoCentro(null); adapter.setCommessa("192"); adapter.setWorkType("001"); assertThat(adapter.deriveOrder... | public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) builder.append(getCentro()); builder.append("/"); if (getProgressivoCentro() != null && getCommessa() != null) { bu... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveOrderNumber() { if (getNumero() == null) return null; StringBuilder builder = new StringBuilder(); builder.append(getNumero().toString()); builder.append("/"); if (getCentro() != null) buil... |
@Test public void deriveProjectNumberTest() { OrderProjectImportAdapter adapter = new OrderProjectImportAdapter(); adapter.setCommessa("106"); assertThat(adapter.deriveProjectReference()).isEqualTo("ITPR106"); } | public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapter.deriveProjectReference(getCommessa()); } | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapter.deriveProje... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapter.deriveProje... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapter.deriveProje... | OrderProjectImportAdapter implements FixtureAwareRowHandler<OrderProjectImportAdapter>, ExcelMetaDataEnabled { public String deriveProjectReference() { if (getCommessa() == null) return null; if (getCentro() == null) return ProjectImportAdapter.ITA_PROJECT_PREFIX + getCommessa(); return ProjectImportAdapter.deriveProje... |
@Test public void doDefault2CalculateInvoicesForProperty_works_for_ita() { InvoiceServiceMenu menu = new InvoiceServiceMenu(); menu.countryRepository = countryRepository; menu.countryServiceForCurrentUser = countryServiceForCurrentUser; Country italy = new Country("ITA", "Italy", "IT"); context.checking(new Expectation... | public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... |
@Test public void doDefault2CalculateInvoicesForProperty_works_for_fra() { InvoiceServiceMenu menu = new InvoiceServiceMenu(); menu.countryRepository = countryRepository; menu.countryServiceForCurrentUser = countryServiceForCurrentUser; Country france = new Country("FRA", "France", "FR"); Country italy = new Country("I... | public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... |
@Test public void doDefault2CalculateInvoicesForProperty_works_when_user_has_no_countries() { InvoiceServiceMenu menu = new InvoiceServiceMenu(); menu.countryRepository = countryRepository; menu.countryServiceForCurrentUser = countryServiceForCurrentUser; Country italy = new Country("ITA", "Italy", "IT"); context.check... | public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); } | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... | InvoiceServiceMenu extends UdoDomainService<InvoiceServiceMenu> { public List<LeaseItemType> default2CalculateInvoicesForProperty() { return doDefault2CalculateInvoicesForProperty().selectedTypes(); } InvoiceServiceMenu(); @Action(semantics = SemanticsOf.NON_IDEMPOTENT) @ActionLayout(named = "Calculate Invoices For Pro... |
@Test public void getChamberOfCommerceCodeCandidatesByOrganisation_works() throws Exception { ChamberOfCommerceCodeLookUpService service = new ChamberOfCommerceCodeLookUpService(){ @Override List<OrganisationNameNumberViewModel> findCandidatesForFranceByName(final String name){ return Arrays.asList( new OrganisationNam... | public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } | ChamberOfCommerceCodeLookUpService { public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } } | ChamberOfCommerceCodeLookUpService { public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } } | ChamberOfCommerceCodeLookUpService { public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } List<OrganisationNameNumberViewModel> getCha... | ChamberOfCommerceCodeLookUpService { public List<OrganisationNameNumberViewModel> getChamberOfCommerceCodeCandidatesByOrganisation(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByOrganisation(organisation.getName(), organisation.getAtPath()); } List<OrganisationNameNumberViewModel> getCha... |
@Test public void getChamberOfCommerceCodeCandidatesByCode_works() throws Exception { ChamberOfCommerceCodeLookUpService service = new ChamberOfCommerceCodeLookUpService(){ @Override OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code){ return new OrganisationNameNumberViewModel(); } }; Organ... | public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } | ChamberOfCommerceCodeLookUpService { public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } } | ChamberOfCommerceCodeLookUpService { public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } } | ChamberOfCommerceCodeLookUpService { public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } List<OrganisationNameNumberViewModel> getChamberO... | ChamberOfCommerceCodeLookUpService { public OrganisationNameNumberViewModel getChamberOfCommerceCodeCandidatesByCode(final Organisation organisation) { return getChamberOfCommerceCodeCandidatesByCode(organisation.getChamberOfCommerceCode(), organisation.getAtPath()); } List<OrganisationNameNumberViewModel> getChamberO... |
@Test public void discarded_or_applied() throws Exception { ChargingLine line = new ChargingLine(); Assertions.assertThat(line.discardedOrAggregatedOrApplied()).isFalse(); line.setImportStatus(ImportStatus.DISCARDED); Assertions.assertThat(line.discardedOrAggregatedOrApplied()).isTrue(); line.setImportStatus(ImportStat... | boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } | ChargingLine implements Importable { boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } } | ChargingLine implements Importable { boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } ChargingLine(); } | ChargingLine implements Importable { boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease ... | ChargingLine implements Importable { boolean discardedOrAggregatedOrApplied() { if (getImportStatus() == ImportStatus.DISCARDED || getImportStatus() == ImportStatus.AGGREGATED || getApplied() != null) { return true; } return false; } ChargingLine(); String title(); @PropertyLayout(hidden = Where.PARENTED_TABLES) Lease ... |
@Test public void find_Candidate_For_France_By_Code_works_when_no_result() throws Exception { ChamberOfCommerceCodeLookUpService service = new ChamberOfCommerceCodeLookUpService(); service.messageService = mockMessageService; service.sirenService = mockSirenService; String noResultsWarning = "A connection to the extern... | OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.getEntryDate()); } else { messageService.warnUser(NO_... | ChamberOfCommerceCodeLookUpService { OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.getEntryDate());... | ChamberOfCommerceCodeLookUpService { OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.getEntryDate());... | ChamberOfCommerceCodeLookUpService { OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.getEntryDate());... | ChamberOfCommerceCodeLookUpService { OrganisationNameNumberViewModel findCandidateForFranceByCode(final String code) { try { SirenResult sirenResult = sirenService.getCompanyName(code); if (sirenResult != null) { return new OrganisationNameNumberViewModel(sirenResult.getCompanyName(), code, sirenResult.getEntryDate());... |
@Test public void filterLegalFormsFromOrganisationName_works() throws Exception { ChamberOfCommerceCodeLookUpService service = new ChamberOfCommerceCodeLookUpService(); final String legalForm_SA_without_occurrence_in_name_1 = "SA ACME"; final String legalForm_SA_without_occurrence_in_name_2 = "ACME SA"; final String le... | String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } | ChamberOfCommerceCodeLookUpService { String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } } | ChamberOfCommerceCodeLookUpService { String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } } | ChamberOfCommerceCodeLookUpService { String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } List<OrganisationNameN... | ChamberOfCommerceCodeLookUpService { String filterLegalFormsFromOrganisationName(final String name ) { return Arrays.stream(name.split(" ")) .filter(element -> !LEGAL_FORMS.contains(element)) .filter(element -> !LEGAL_FORMS.contains(element.replace(".", ""))) .collect(Collectors.joining(" ")); } List<OrganisationNameN... |
@Test public void findFor() { StatusMessageSummaryCache service = new StatusMessageSummaryCache(){ Long idFor(final Object object) { return null; }; }; InvoiceForLease invoice = new InvoiceForLease(); Assertions.assertThat(service.findFor(invoice)).isNull(); } | @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId); if (statusMessageOpt == null) { final List<InvoiceIdAndStatusMessageSumma... | StatusMessageSummaryCache implements WithTransactionScope { @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId); if (statusMes... | StatusMessageSummaryCache implements WithTransactionScope { @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId); if (statusMes... | StatusMessageSummaryCache implements WithTransactionScope { @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId); if (statusMes... | StatusMessageSummaryCache implements WithTransactionScope { @Programmatic public StatusMessageSummary findFor(final InvoiceForLease invoice) { final Long invoiceId = idFor(invoice); if (invoiceId==null) return null; Optional<StatusMessageSummary> statusMessageOpt = statusMessageByInvoiceId.get(invoiceId); if (statusMes... |
@Test public void previewCharsToBytes() throws Exception { final String urlStr = "http: final URL url = new URL(urlStr); final String externalForm = url.toExternalForm(); Assertions.assertThat(externalForm).isEqualTo(urlStr); } | protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root root = (StringInterpolatorService.Root) dataModel; final String urlStr = stringInterpolator.i... | RendererForStringInterpolatorCaptureUrl implements RendererFromCharsToBytes { protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root root = (StringI... | RendererForStringInterpolatorCaptureUrl implements RendererFromCharsToBytes { protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root root = (StringI... | RendererForStringInterpolatorCaptureUrl implements RendererFromCharsToBytes { protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root root = (StringI... | RendererForStringInterpolatorCaptureUrl implements RendererFromCharsToBytes { protected URL previewCharsToBytes( final DocumentType documentType, final String atPath, final long templateVersion, final String templateChars, final Object dataModel) throws IOException { final StringInterpolatorService.Root root = (StringI... |
@Test public void apply_discarded_works() throws Exception { ChargingLine line = new ChargingLine(); line.setApplied(new LocalDate()); line.setImportStatus(ImportStatus.LEASE_ITEM_CREATED); Assertions.assertThat(line.apply()).isEqualTo(ImportStatus.LEASE_ITEM_CREATED); } | @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockService.now()); setImportStatus(result)... | ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockSe... | ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockSe... | ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockSe... | ChargingLine implements Importable { @Action(semantics = SemanticsOf.NON_IDEMPOTENT) public ImportStatus apply() { if (!discardedOrAggregatedOrApplied()) { ImportStatus result = fastnetImportService.updateOrCreateItemAndTerm(this); if (result != null && getImportStatus() != ImportStatus.AGGREGATED) { setApplied(clockSe... |
@Test public void append_import_log_works() throws Exception { ChargingLine line = new ChargingLine(); line.clockService = mockClockService; line.setImportLog("first message"); context.checking(new Expectations(){{ allowing(mockClockService).nowAsLocalDateTime(); will(returnValue(LocalDateTime.parse("2018-01-01"))); }}... | void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { nwContent = nwContent.concat(msg); } if (nwContent.... | ChargingLine implements Importable { void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { nwContent = nw... | ChargingLine implements Importable { void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { nwContent = nw... | ChargingLine implements Importable { void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { nwContent = nw... | ChargingLine implements Importable { void appendImportLog(final String msg){ final String prefix = clockService.nowAsLocalDateTime().toString("yyyy-MM-dd HH:mm:ss") + " "; String nwContent = prefix; if (getImportLog()!=null) { nwContent = nwContent.concat(msg).concat(" ").concat(getImportLog()); } else { nwContent = nw... |
@Test public void keyToLeaseExternalReference_works_when_not_null() throws Exception { RentRollLine line = new RentRollLine(); line.setKontraktNr("351234-5678-01"); Assertions.assertThat(line.keyToLeaseExternalReference()).isEqualTo("1234-5678-01"); } | String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @PropertyLayout(hidden ... | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @PropertyLayout(hidden ... |
@Test public void keyToLeaseExternalReference_works_when_null() throws Exception { RentRollLine line = new RentRollLine(); Assertions.assertThat(line.keyToLeaseExternalReference()).isNull(); } | String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); } | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @PropertyLayout(hidden ... | RentRollLine implements Importable { String keyToLeaseExternalReference() { return getKontraktNr() != null ? getKontraktNr().substring(2) : null; } RentRollLine(); String title(); LocalDate getInflyttningsDatumAsDate(); @Action(semantics = SemanticsOf.SAFE) List<ChargingLine> getChargingLines(); @PropertyLayout(hidden ... |
@Test public void handle_assigns_sdi_number_to_attached_pdf_generated_from_xml() { final Long sdId = Long.valueOf(12345678); final String expectedDocumentName = "S12345678.pdf"; DocFlowZipService service = new DocFlowZipService(); service.docFlowZipFactory = mockDocFlowZipFactory; service.docFlowZipRepository = mockDoc... | public DocFlowZip handle( final long sdId, final Clob xmlFileMetadatiIfAny, final Clob xmlFatturaElettronica, final Blob pdfFatturaElettronica, final Blob p7mFatturaElettronicaIfAny, final Blob pdfSupplierIfAny, final String atPath, final String sha256) { final DocFlowZip docFlowZip = docFlowZipFactory.createTransient(... | DocFlowZipService { public DocFlowZip handle( final long sdId, final Clob xmlFileMetadatiIfAny, final Clob xmlFatturaElettronica, final Blob pdfFatturaElettronica, final Blob p7mFatturaElettronicaIfAny, final Blob pdfSupplierIfAny, final String atPath, final String sha256) { final DocFlowZip docFlowZip = docFlowZipFact... | DocFlowZipService { public DocFlowZip handle( final long sdId, final Clob xmlFileMetadatiIfAny, final Clob xmlFatturaElettronica, final Blob pdfFatturaElettronica, final Blob p7mFatturaElettronicaIfAny, final Blob pdfSupplierIfAny, final String atPath, final String sha256) { final DocFlowZip docFlowZip = docFlowZipFact... | DocFlowZipService { public DocFlowZip handle( final long sdId, final Clob xmlFileMetadatiIfAny, final Clob xmlFatturaElettronica, final Blob pdfFatturaElettronica, final Blob p7mFatturaElettronicaIfAny, final Blob pdfSupplierIfAny, final String atPath, final String sha256) { final DocFlowZip docFlowZip = docFlowZipFact... | DocFlowZipService { public DocFlowZip handle( final long sdId, final Clob xmlFileMetadatiIfAny, final Clob xmlFatturaElettronica, final Blob pdfFatturaElettronica, final Blob p7mFatturaElettronicaIfAny, final Blob pdfSupplierIfAny, final String atPath, final String sha256) { final DocFlowZip docFlowZip = docFlowZipFact... |
@Test public void calculationPeriod_works() { TurnoverAggregation aggregation = new TurnoverAggregation(); final LocalDate aggregationDate = new LocalDate(2020, 1, 1); aggregation.setDate(aggregationDate); Assertions.assertThat(aggregation.calculationPeriod().toString()).isEqualTo("2018-02-01/2020-01-02"); Assertions.a... | @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } | TurnoverAggregation { @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } } | TurnoverAggregation { @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } TurnoverAggregation(); TurnoverAggregation(final TurnoverReportingConfig turnoverReportingConfig, final LocalDate date, final Currency currency); } | TurnoverAggregation { @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } TurnoverAggregation(); TurnoverAggregation(final TurnoverReportingConfig turnoverReportingConfig, final LocalDate date, final Currency currency); String title();... | TurnoverAggregation { @Programmatic public LocalDateInterval calculationPeriod(){ return LocalDateInterval.including(getDate().minusMonths(23), getDate()); } TurnoverAggregation(); TurnoverAggregation(final TurnoverReportingConfig turnoverReportingConfig, final LocalDate date, final Currency currency); String title();... |
@SuppressWarnings("unchecked") @Test public void testSetContext() { invocation = EasyMock.createMock(Invocation.class); EasyMock.expect(invocation.getMethodName()).andReturn("$enumlength").anyTimes(); EasyMock.expect(invocation.getParameterTypes()).andReturn(new Class<?>[] { Enum.class }).anyTimes(); EasyMock.expect(in... | public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachments.remove(Constants.GROUP_KEY); ... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... |
@Test public void testWithAttachments() { URL url = URL.valueOf("test: Invoker<DemoService> invoker = new MyInvoker<DemoService>(url); Invocation invocation = new MockInvocation(); Result result = contextFilter.invoke(invoker, invocation); assertNull(RpcContext.getContext().getInvoker()); } | public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachments.remove(Constants.GROUP_KEY); ... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... | ContextFilter implements Filter { public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Map<String, String> attachments = setCallChainContextMap(invocation); if (attachments != null) { attachments = new HashMap<String, String>(attachments); attachments.remove(Constants.PATH_KEY); attachm... |
@Test public void testParcelMethodUsage() throws NoSuchMethodException { for (Map.Entry<Matcher<ASTType>, ReadWriteGenerator> entry : ((Generators)generators).getGenerators().entrySet()) { if(entry.getValue() instanceof ReadWriteGeneratorBase){ ReadWriteGeneratorBase readWriteGeneratorBase = (ReadWriteGeneratorBase)ent... | protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } | Generators { protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } } | Generators { protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } Generators(ASTClassFactory astClassFactory); } | Generators { protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } Generators(ASTClassFactory astClassFactory); boolean matches(ASTType type); ReadWriteGenerator getGenerator(ASTType type); void addPair(Class clazz, String readMethod, String writeMethod); void addPair(Class clazz, S... | Generators { protected Map<Matcher<ASTType>, ReadWriteGenerator> getGenerators() { return generators; } Generators(ASTClassFactory astClassFactory); boolean matches(ASTType type); ReadWriteGenerator getGenerator(ASTType type); void addPair(Class clazz, String readMethod, String writeMethod); void addPair(Class clazz, S... |
@Test public void testConstructorAnnotatedPrivateMethod() { ParcelableDescriptor analysis = analyze(ConstructorAnnotatedPrivateMethod.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysi... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testBasic() { ParcelableDescriptor analysis = analyze(Basic.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(3, analysis.getMethodPairs().size()); assertNotNull(analysis.getCo... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testMethodModifers() { ParcelableDescriptor analysis = analyze(Modifiers.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size()); assertNotNull(a... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testMissingSetter() { ParcelableDescriptor analysis = analyze(MissingSetter.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size()); assertNotNul... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testMissingGetter() { ParcelableDescriptor analysis = analyze(MissingGetter.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(1, analysis.getMethodPairs().size()); assertNotNul... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testParcelConverter() { ASTType targetAst = astClassFactory.getType(Target.class); ASTAnnotation parcelASTAnnotaiton = targetAst.getASTAnnotation(Parcel.class); ASTType parcelConverterAst = astClassFactory.getType(Converter.class); ParcelableDescriptor analysis = parcelableAnalysis.analyze(targetAst, ... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testTransient() { ParcelableDescriptor analysis = analyze(MethodTransient.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); assertNotNull(... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testFieldTransientTransient() { ParcelableDescriptor analysis = analyze(FieldTransient.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); a... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
@Test public void testDefaultConstructor(){ ParcelableDescriptor analysis = analyze(DefaultConstructor.class); assertFalse(messager.getMessage(), messager.isErrored()); assertNull(analysis.getParcelConverterType()); assertEquals(0, analysis.getFieldPairs().size()); assertEquals(0, analysis.getMethodPairs().size()); ass... | public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } } | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... | ParcelableAnalysis { public ParcelableDescriptor analyze(ASTType astType) { ASTAnnotation parcelASTAnnotation = astType.getASTAnnotation(Parcel.class); return analyze(astType, parcelASTAnnotation); } @Inject ParcelableAnalysis(Validator validator, Provider<Generators> generatorsProvider, ASTClassFactory astClassFactor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.