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 shouldFindBlankStringsAsEmpty() { assertThat(Strings.isEmptyOrBlank(" \t\r\n")).isTrue(); }
public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
@Test public void shouldParseSpecificationWithSecurityRequirements() { final OpenApiModelInfo info = OpenApiConnectorGenerator.parseSpecification(new ConnectorSettings.Builder() .putConfiguredProperty("specification", "{\"swagger\":\"2.0\",\"paths\":{\"/api\":{\"get\":{\"security\":[{\"secured\":[]}]}}}}") .build(), AP...
static OpenApiModelInfo parseSpecification(final ConnectorSettings connectorSettings, final APIValidationContext validationContext) { final String specification = requiredSpecification(connectorSettings); return OpenApiModelParser.parse(specification, validationContext); }
OpenApiConnectorGenerator extends ConnectorGenerator { static OpenApiModelInfo parseSpecification(final ConnectorSettings connectorSettings, final APIValidationContext validationContext) { final String specification = requiredSpecification(connectorSettings); return OpenApiModelParser.parse(specification, validationCon...
OpenApiConnectorGenerator extends ConnectorGenerator { static OpenApiModelInfo parseSpecification(final ConnectorSettings connectorSettings, final APIValidationContext validationContext) { final String specification = requiredSpecification(connectorSettings); return OpenApiModelParser.parse(specification, validationCon...
OpenApiConnectorGenerator extends ConnectorGenerator { static OpenApiModelInfo parseSpecification(final ConnectorSettings connectorSettings, final APIValidationContext validationContext) { final String specification = requiredSpecification(connectorSettings); return OpenApiModelParser.parse(specification, validationCon...
OpenApiConnectorGenerator extends ConnectorGenerator { static OpenApiModelInfo parseSpecification(final ConnectorSettings connectorSettings, final APIValidationContext validationContext) { final String specification = requiredSpecification(connectorSettings); return OpenApiModelParser.parse(specification, validationCon...
@Test public void shouldProvideInfoFromPetstoreSwagger() throws IOException { final String specification = resource("/openapi/v2/petstore.json"); final ConnectorSettings connectorSettings = new ConnectorSettings.Builder() .putConfiguredProperty("specification", specification) .build(); final APISummary summary = genera...
@Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = modelInfo.getModel(); if (model == null) { final APISummar...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
@Test public void shouldReportErrorsFromInvalidPetstoreSwagger() throws IOException { final String specification = resource("/openapi/v2/invalid/invalid-scheme.petstore.json"); final ConnectorSettings connectorSettings = new ConnectorSettings.Builder() .putConfiguredProperty("specification", specification) .build(); fi...
@Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = modelInfo.getModel(); if (model == null) { final APISummar...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
OpenApiConnectorGenerator extends ConnectorGenerator { @Override public final APISummary info(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final OpenApiModelInfo modelInfo = parseSpecification(connectorSettings, APIValidationContext.CONSUMED_API); final OasDocument model = mod...
@Test public void parseSoapAPI() { final SoapApiModelInfo soapApiModelInfo = SoapApiModelParser.parseSoapAPI(this.specification, this.specification); assertThat(soapApiModelInfo).isNotNull(); assertThat(soapApiModelInfo.getErrors()).isEmpty(); assertThat(soapApiModelInfo.getWarnings()).isEmpty(); assertThat(soapApiMode...
public static SoapApiModelInfo parseSoapAPI(final String specification, final String wsdlURL) { SoapApiModelInfo.Builder builder = new SoapApiModelInfo.Builder(); try { final String resolvedSpecification; final Optional<String> resolvedWsdlURL; final boolean isHttpUrl = specification.toLowerCase(Locale.US).startsWith("...
SoapApiModelParser { public static SoapApiModelInfo parseSoapAPI(final String specification, final String wsdlURL) { SoapApiModelInfo.Builder builder = new SoapApiModelInfo.Builder(); try { final String resolvedSpecification; final Optional<String> resolvedWsdlURL; final boolean isHttpUrl = specification.toLowerCase(Lo...
SoapApiModelParser { public static SoapApiModelInfo parseSoapAPI(final String specification, final String wsdlURL) { SoapApiModelInfo.Builder builder = new SoapApiModelInfo.Builder(); try { final String resolvedSpecification; final Optional<String> resolvedWsdlURL; final boolean isHttpUrl = specification.toLowerCase(Lo...
SoapApiModelParser { public static SoapApiModelInfo parseSoapAPI(final String specification, final String wsdlURL) { SoapApiModelInfo.Builder builder = new SoapApiModelInfo.Builder(); try { final String resolvedSpecification; final Optional<String> resolvedWsdlURL; final boolean isHttpUrl = specification.toLowerCase(Lo...
SoapApiModelParser { public static SoapApiModelInfo parseSoapAPI(final String specification, final String wsdlURL) { SoapApiModelInfo.Builder builder = new SoapApiModelInfo.Builder(); try { final String resolvedSpecification; final Optional<String> resolvedWsdlURL; final boolean isHttpUrl = specification.toLowerCase(Lo...
@Test public void shouldCreateBaseConnectors() { final ConnectorSettings settings = new ConnectorSettings.Builder().putConfiguredProperty("property2", "value2").build(); final Connector connector = generator.baseConnectorFrom(template, settings); assertThat(connector).isEqualToIgnoringGivenFields( new Connector.Builder...
protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties() .entrySet().stream()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
@Test public void shouldCreateBaseConnectorsWithGivenNameAndDescription() { final ConnectorSettings settings = new ConnectorSettings.Builder().name("given-name").description("given-description") .putConfiguredProperty("property2", "value2").build(); final Connector connector = generator.baseConnectorFrom(template, sett...
protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties() .entrySet().stream()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
ConnectorGenerator { protected final Connector baseConnectorFrom(final ConnectorTemplate connectorTemplate, final ConnectorSettings connectorSettings) { final Set<String> properties = connectorTemplate.getProperties().keySet(); final Map<String, String> configuredProperties = connectorSettings.getConfiguredProperties()...
@Test public void shouldAscertainPropertyUniqueness() { final HibernateConstraintValidatorContext context = mock(HibernateConstraintValidatorContext.class); when(context.unwrap(HibernateConstraintValidatorContext.class)).thenReturn(context); when(context.addExpressionVariable(eq("nonUnique"), anyString())).thenReturn(c...
@Override public boolean isValid(final WithId<?> value, final ConstraintValidatorContext context) { if (value == null) { return true; } final PropertyAccessor bean = new BeanWrapperImpl(value); final String propertyValue = String.valueOf(bean.getPropertyValue(property)); @SuppressWarnings({"rawtypes", "unchecked"}) fin...
UniquePropertyValidator implements ConstraintValidator<UniqueProperty, WithId<?>> { @Override public boolean isValid(final WithId<?> value, final ConstraintValidatorContext context) { if (value == null) { return true; } final PropertyAccessor bean = new BeanWrapperImpl(value); final String propertyValue = String.valueO...
UniquePropertyValidator implements ConstraintValidator<UniqueProperty, WithId<?>> { @Override public boolean isValid(final WithId<?> value, final ConstraintValidatorContext context) { if (value == null) { return true; } final PropertyAccessor bean = new BeanWrapperImpl(value); final String propertyValue = String.valueO...
UniquePropertyValidator implements ConstraintValidator<UniqueProperty, WithId<?>> { @Override public boolean isValid(final WithId<?> value, final ConstraintValidatorContext context) { if (value == null) { return true; } final PropertyAccessor bean = new BeanWrapperImpl(value); final String propertyValue = String.valueO...
UniquePropertyValidator implements ConstraintValidator<UniqueProperty, WithId<?>> { @Override public boolean isValid(final WithId<?> value, final ConstraintValidatorContext context) { if (value == null) { return true; } final PropertyAccessor bean = new BeanWrapperImpl(value); final String propertyValue = String.valueO...
@Test public void shouldComplainAboutUnregisteredProviders() { final DataManager dataManager = mock(DataManager.class); final CredentialProviderRegistry registry = new CredentialProviderRegistry(dataManager); assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> registry.providerWithId("unregistere...
@Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + providerId); } final String providerToUse = determineProviderFrom(c...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
@Test public void shouldFetchProvidersFromDataManager() { final DataManager dataManager = mock(DataManager.class); final CredentialProviderRegistry registry = new CredentialProviderRegistry(dataManager); final Connector connector = new Connector.Builder().id("test-provider") .putProperty("clientId", new ConfigurationPr...
@Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + providerId); } final String providerToUse = determineProviderFrom(c...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
CredentialProviderRegistry implements CredentialProviderLocator { @Override public CredentialProvider providerWithId(final String providerId) { final Connector connector = dataManager.fetch(Connector.class, providerId); if (connector == null) { throw new IllegalArgumentException("Unable to find connector with id: " + p...
@Test public void nullUrisShouldBeInvalid() { assertThat(validator.isValid(null, null)).isFalse(); }
@Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
@Test public void shouldFindEmptyStringsAsEmpty() { assertThat(Strings.isEmptyOrBlank("")).isTrue(); }
public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
@Test public void shouldAllowRelativeUris() { assertThat(validator.isValid(URI.create("/relative"), null)).isTrue(); }
@Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
@Test public void shouldNotAllowNonRelativeUris() { assertThat(validator.isValid(URI.create("scheme:/absolute"), null)).isFalse(); }
@Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } }
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
RelativeUriValidator implements ConstraintValidator<RelativeUri, URI> { @Override public boolean isValid(final URI value, final ConstraintValidatorContext context) { return value != null && !value.isAbsolute(); } @Override void initialize(final RelativeUri constraintAnnotation); @Override boolean isValid(final URI val...
@Test public void ifCookieNameDoesNotMatchShouldReturnEmptySet() { final Cookie cookie = new Cookie("notMatching", "anyValue"); final HttpServletRequest request = mock(HttpServletRequest.class); when(request.getCookies()).thenReturn(new Cookie[] {cookie}); final Set<CredentialFlowState> got = CredentialFlowStateHelper....
static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arrays.stream(servletCookies) ....
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
@Test public void ifRestoreFailsShouldReturnEmptySet() { final Cookie cookie = new Cookie(CredentialFlowState.CREDENTIAL_PREFIX + "key", "anyValue"); final HttpServletRequest request = mock(HttpServletRequest.class); when(request.getCookies()).thenReturn(new Cookie[] {cookie}); final Set<CredentialFlowState> got = Cred...
static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arrays.stream(servletCookies) ....
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
@Test public void shouldConvertServletCookieToJaxRsCookie() { final Cookie given = new Cookie("myCookie", "myValue"); given.setDomain("example.com"); given.setPath("/path"); given.setMaxAge(1800); given.setHttpOnly(true); given.setSecure(true); final javax.ws.rs.core.Cookie expected = new javax.ws.rs.core.Cookie("myCoo...
static javax.ws.rs.core.Cookie toJaxRsCookie(final Cookie cookie) { return new javax.ws.rs.core.Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain()); }
CredentialFlowStateHelper { static javax.ws.rs.core.Cookie toJaxRsCookie(final Cookie cookie) { return new javax.ws.rs.core.Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain()); } }
CredentialFlowStateHelper { static javax.ws.rs.core.Cookie toJaxRsCookie(final Cookie cookie) { return new javax.ws.rs.core.Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain()); } private CredentialFlowStateHelper(); }
CredentialFlowStateHelper { static javax.ws.rs.core.Cookie toJaxRsCookie(final Cookie cookie) { return new javax.ws.rs.core.Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain()); } private CredentialFlowStateHelper(); }
CredentialFlowStateHelper { static javax.ws.rs.core.Cookie toJaxRsCookie(final Cookie cookie) { return new javax.ws.rs.core.Cookie(cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain()); } private CredentialFlowStateHelper(); }
@Test public void shouldRestoreCookiesToStreamOfState() { final CredentialFlowState expected1 = new OAuth2CredentialFlowState.Builder().connectorId("connectorId") .key("key1").build(); final CredentialFlowState expected2 = new OAuth2CredentialFlowState.Builder().connectorId("connectorId") .key("key2").build(); final Co...
static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arrays.stream(servletCookies) ....
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
@Test public void shouldReturnEmptyStreamIfNoCookiesPresent() { final HttpServletRequest request = mock(HttpServletRequest.class); final Set<CredentialFlowState> streamFromNullCookies = CredentialFlowStateHelper.restoreFrom((c, cls) -> null, request); assertThat(streamFromNullCookies).isEmpty(); when(request.getCookies...
static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arrays.stream(servletCookies) ....
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
CredentialFlowStateHelper { static Set<CredentialFlowState> restoreFrom(final Restorer restore, final HttpServletRequest request) { final Cookie[] servletCookies = request.getCookies(); if (ArrayUtils.isEmpty(servletCookies)) { return Collections.emptySet(); } final List<javax.ws.rs.core.Cookie> credentialCookies = Arr...
@Test public void shouldCreateAcquisitionMethod() { @SuppressWarnings("unchecked") final OAuth1CredentialProvider<?> oauth1 = new OAuth1CredentialProvider<>("provider1", mock(OAuth1ConnectionFactory.class), mock(Applicator.class)); final AcquisitionMethod method1 = new AcquisitionMethod.Builder() .description("provider...
@Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH1) .description(descriptionFor(id)) .configured(configured) .build(); }
OAuth1CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH1) .description(descriptionFor(id)) .configured(configured) .build(); } }
OAuth1CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH1) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth1CredentialProvider(final String ...
OAuth1CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH1) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth1CredentialProvider(final String ...
OAuth1CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH1) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth1CredentialProvider(final String ...
@Test public void shouldGenerateCallbackUrlWithoutParameters() { assertThat(BaseCredentialProvider.callbackUrlFor(URI.create("https: .as("The computed callback URL is not as expected") .isEqualTo("https: }
protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), null, baseUrl.getHost(), baseUrl.getPort(), callbackPath...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
@Test public void shouldGenerateCallbackUrlWithParameters() { final MultiValueMap<String, String> some = new LinkedMultiValueMap<>(); some.set("param1", "value1"); some.set("param2", "value2"); assertThat(BaseCredentialProvider.callbackUrlFor(URI.create("https: .as("The computed callback URL is not as expected") .isEqu...
protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), null, baseUrl.getHost(), baseUrl.getPort(), callbackPath...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
BaseCredentialProvider implements CredentialProvider { protected static String callbackUrlFor(final URI baseUrl, final MultiValueMap<String, String> additionalParams) { final String path = baseUrl.getPath(); final String callbackPath = path + "credentials/callback"; try { final URI base = new URI(baseUrl.getScheme(), n...
@Test public void shouldFindNonEmptyStringsAsNonEmpty() { assertThat(Strings.isEmptyOrBlank("a")).isFalse(); }
public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
@Test public void shouldCreateAcquisitionMethod() { @SuppressWarnings("unchecked") final OAuth2CredentialProvider<?> oauth2 = new OAuth2CredentialProvider<>("provider2", mock(OAuth2ConnectionFactory.class), mock(Applicator.class), Collections.emptyMap()); final AcquisitionMethod method2 = new AcquisitionMethod.Builder(...
@Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH2) .description(descriptionFor(id)) .configured(configured) .build(); }
OAuth2CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH2) .description(descriptionFor(id)) .configured(configured) .build(); } }
OAuth2CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH2) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth2CredentialProvider(final String ...
OAuth2CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH2) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth2CredentialProvider(final String ...
OAuth2CredentialProvider extends BaseCredentialProvider { @Override public AcquisitionMethod acquisitionMethod() { return new AcquisitionMethod.Builder() .label(labelFor(id)) .icon(iconFor(id)) .type(Type.OAUTH2) .description(descriptionFor(id)) .configured(configured) .build(); } OAuth2CredentialProvider(final String ...
@Test public void shouldAcquireOAuth1aCredentials() { final OAuth1ConnectionFactory<?> oauth1 = mock(OAuth1ConnectionFactory.class); @SuppressWarnings("unchecked") final Applicator<OAuthToken> applicator = mock(Applicator.class); when(locator.providerWithId("providerId")) .thenReturn(new OAuth1CredentialProvider<>("pro...
public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().type(flowState.t...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
@Test public void shouldAcquireOAuth1Credentials() { final OAuth1ConnectionFactory<?> oauth1 = mock(OAuth1ConnectionFactory.class); @SuppressWarnings("unchecked") final Applicator<OAuthToken> applicator = mock(Applicator.class); when(locator.providerWithId("providerId")) .thenReturn(new OAuth1CredentialProvider<>("prov...
public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().type(flowState.t...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
@Test public void shouldAcquireOAuth2Credentials() { final OAuth2ConnectionFactory<?> oauth2 = mock(OAuth2ConnectionFactory.class); @SuppressWarnings("unchecked") final Applicator<AccessGrant> applicator = mock(Applicator.class); when(locator.providerWithId("providerId")) .thenReturn(new OAuth2CredentialProvider<>("pro...
public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().type(flowState.t...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
@Test public void shouldAcquireOAuth2CredentialsWithAdditionalQueryParameters() { final OAuth2ConnectionFactory<?> oauth2 = mock(OAuth2ConnectionFactory.class); @SuppressWarnings("unchecked") final Applicator<AccessGrant> applicator = mock(Applicator.class); final Map<String, String> queryParameters = new HashMap<>(); ...
public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().type(flowState.t...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
Credentials { public AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl) { final CredentialProvider credentialProvider = providerFor(providerId); final CredentialFlowState flowState = credentialProvider.prepare(providerId, baseUrl, returnUrl); return new AcquisitionFlow.Builder().ty...
@Test public void shouldApplyReceivedCredentialsToConnections() { final CredentialProvider credentialProvider = mock(CredentialProvider.class); when(locator.providerWithId("providerId")).thenReturn(credentialProvider); final CredentialFlowState flowState = new OAuth2CredentialFlowState.Builder().providerId("providerId"...
public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appliedConnection ...
Credentials { public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appl...
Credentials { public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appl...
Credentials { public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appl...
Credentials { public Connection apply(final Connection updatedConnection, final CredentialFlowState flowState) { final CredentialProvider credentialProvider = providerFrom(flowState); final Connection withDerivedFlag = new Connection.Builder().createFrom(updatedConnection).isDerived(true).build(); final Connection appl...
@Test public void shouldFinishOAuth1Acquisition() { final OAuthToken token = new OAuthToken("value", "secret"); final OAuth1ConnectionFactory<?> oauth1 = mock(OAuth1ConnectionFactory.class); final OAuth1Applicator applicator = new OAuth1Applicator(properties); when(locator.providerWithId("providerId")) .thenReturn(new ...
public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
@Test public void shouldFinishOAuth2Acquisition() { final OAuth2ConnectionFactory<?> oauth2 = mock(OAuth2ConnectionFactory.class); final OAuth2Applicator applicator = new OAuth2Applicator(properties); applicator.setAccessTokenProperty("accessTokenProperty"); applicator.setClientIdProperty("clientIdProperty"); applicato...
public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired Credentials(final CredentialProviderLocator credentialProviderLo...
@Test public void shouldFetchFromStaticResource() throws Exception { final String json = new StaticResourceClassInspector(new DefaultResourceLoader()).fetchJsonFor("twitter4j.Status", null); assertThat(json).isNotEmpty(); }
@Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resources.length == 0) { throw new FileNotFoundException(path); } final Resou...
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resource...
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resource...
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resource...
StaticResourceClassInspector extends DataMapperBaseInspector<Void> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<Void> context) throws IOException { final String path = PREFIX + fullyQualifiedName + SUFFIX; final Resource[] resources = resolver.getResources(path); if (resource...
@Test public void shouldCollectPathsFromJsonSchema() throws IOException { final List<String> paths = inspector.getPaths(JSON_SCHEMA_KIND, "", IOStreams.readText(getSalesForceContactSchema()), Optional.empty()); assertSalesforceContactProperties(paths); assertThat(paths).doesNotContainAnyElementsOf(JsonSchemaInspector.C...
@Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unable to parse the given JSON schema, increase...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
@Test public void shouldFindNonEmptyStringsWithWhitespaceAsNonEmpty() { assertThat(Strings.isEmptyOrBlank(" \na\t")).isFalse(); }
public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
@Test @Parameters({"/petstore-unified-schema.json", "/petstore-unified-schema-draft-4.json", "/petstore-unified-schema-draft-6.json"}) public void shouldCollectPathsFromUnifiedJsonSchema(final String schemaPath) throws IOException { final List<String> paths = inspector.getPaths(JSON_SCHEMA_KIND, "", IOStreams.readText(...
@Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unable to parse the given JSON schema, increase...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
@Test public void shouldCollectPathsFromJsonArraysSchema() throws IOException { final List<String> paths = inspector.getPaths(JSON_SCHEMA_KIND, "", getSalesForceContactArraySchema(), Optional.empty()); assertSalesforceContactArrayProperties(paths); assertThat(paths).containsAll(JsonSchemaInspector.COLLECTION_PATHS); }
@Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unable to parse the given JSON schema, increase...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
JsonSchemaInspector implements Inspector { @Override public List<String> getPaths(final String kind, final String type, final String specification, final Optional<byte[]> exemplar) { final JsonSchema schema; try { schema = JsonSchemaUtils.reader().readValue(specification); } catch (final IOException e) { LOG.warn("Unab...
@Test public void shouldFetchPathsFromJsonSchema() throws IOException { final ObjectSchema schema = mapper.readValue(getSalesForceContactSchema(), ObjectSchema.class); final List<String> paths = new ArrayList<>(); JsonSchemaInspector.fetchPaths(null, paths, schema.getProperties()); assertSalesforceContactProperties(pat...
static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.getKey(); if (context == null) { path = key; }...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
@Test public void shouldFetchPathsWithNestedArraySchema() throws IOException { final ObjectSchema schema = mapper.readValue(getSchemaWithNestedArray(), ObjectSchema.class); final List<String> paths = new ArrayList<>(); JsonSchemaInspector.fetchPaths(null, paths, schema.getProperties()); assertThat(paths).hasSize(4); as...
static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.getKey(); if (context == null) { path = key; }...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
JsonSchemaInspector implements Inspector { static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) { for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) { final JsonSchema subschema = entry.getValue(); String path; final String key = entry.get...
@Test public void shouldFindNestedClassesWithinFullJson() throws IOException { final SpecificationClassInspector inspector = new SpecificationClassInspector(); final String specification = read("/twitter4j.Status.full.json"); final Context<JsonNode> context = new Context<>(JsonUtils.reader().readTree(specification)); f...
@Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<JsonNode> context) throws IOException { final JsonNode classNode = findClassNode(fullyQualifiedName, context.getState()); final JsonNode javaClass = JsonNodeFactory.instance.objectNode().set("JavaClass", classNode); return JsonUtils....
SpecificationClassInspector extends DataMapperBaseInspector<JsonNode> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<JsonNode> context) throws IOException { final JsonNode classNode = findClassNode(fullyQualifiedName, context.getState()); final JsonNode javaClass = JsonNodeFact...
SpecificationClassInspector extends DataMapperBaseInspector<JsonNode> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<JsonNode> context) throws IOException { final JsonNode classNode = findClassNode(fullyQualifiedName, context.getState()); final JsonNode javaClass = JsonNodeFact...
SpecificationClassInspector extends DataMapperBaseInspector<JsonNode> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<JsonNode> context) throws IOException { final JsonNode classNode = findClassNode(fullyQualifiedName, context.getState()); final JsonNode javaClass = JsonNodeFact...
SpecificationClassInspector extends DataMapperBaseInspector<JsonNode> { @Override protected String fetchJsonFor(final String fullyQualifiedName, final Context<JsonNode> context) throws IOException { final JsonNode classNode = findClassNode(fullyQualifiedName, context.getState()); final JsonNode javaClass = JsonNodeFact...
@Test public void shouldCollectPathsFromJsonObject() { final List<String> paths = inspector.getPaths(JSON_INSTANCE_KIND, "", getJsonInstance(), Optional.empty()); assertProperties(paths); assertThat(paths).doesNotContainAnyElementsOf(JsonInstanceInspector.COLLECTION_PATHS); }
@Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>(); try { Map<String, Object> json; if (JsonU...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
@Test public void shouldCollectPathsFromEmptyJsonObject() { final List<String> paths = inspector.getPaths(JSON_INSTANCE_KIND, "", "{}", Optional.empty()); assertThat(paths).isEmpty(); }
@Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>(); try { Map<String, Object> json; if (JsonU...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
@Test public void shouldCollectPathsFromJsonArray() { final List<String> paths = inspector.getPaths(JSON_INSTANCE_KIND, "", getJsonArrayInstance(), Optional.empty()); assertArrayProperties(paths); assertThat(paths).containsAll(JsonInstanceInspector.COLLECTION_PATHS); }
@Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>(); try { Map<String, Object> json; if (JsonU...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
@Test public void shouldCollectPathsFromEmptyJsonArray() { final List<String> paths = inspector.getPaths(JSON_INSTANCE_KIND, "", "[]", Optional.empty()); assertThat(paths).isEqualTo(JsonInstanceInspector.COLLECTION_PATHS); }
@Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>(); try { Map<String, Object> json; if (JsonU...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
JsonInstanceInspector implements Inspector { @Override @SuppressWarnings("unchecked") public List<String> getPaths(String kind, String type, String specification, Optional<byte[]> exemplar) { if (specification == null) { return Collections.emptyList(); } String context = null; final List<String> paths = new ArrayList<>...
@Test public void unusedConnectionsShouldHaveUseOfZero() { final Integration emptyIntegration = new Integration.Builder().build(); when(dataManager.fetchAll(Integration.class)).thenReturn(ListResult.of(emptyIntegration, emptyIntegration)); handler.processInternal(NOT_USED); verify(dataManager).fetchAll(Integration.clas...
void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor(Connection.class, integrations, Integration::getConne...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
@Test public void shouldFindNullStringsAsEmpty() { assertThat(Strings.isEmptyOrBlank(null)).isTrue(); }
public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); }
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
Strings { public static boolean isEmptyOrBlank(final String given) { if (given == null || given.isEmpty()) { return true; } final int len = given.length(); for (int i = 0; i < len; i++) { final char ch = given.charAt(i); if (!Character.isWhitespace(ch)) { return false; } } return true; } private Strings(); static bool...
@Test public void withNoIntegrationsConnectionUsageShouldBeZero() { when(dataManager.fetchAll(Integration.class)).thenReturn(ListResult.of(emptyList())); handler.processInternal(NOT_USED); verify(dataManager).fetchAll(Integration.class); verify(dataManager).fetchAll(Connection.class); verify(dataManager).fetchAll(Exten...
void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor(Connection.class, integrations, Integration::getConne...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
UsageUpdateHandler implements ResourceUpdateHandler { void processInternal(final ChangeEvent event) { LOG.debug("Processing event: {}", event); final ListResult<Integration> integrationsResult = dataManager.fetchAll(Integration.class); final List<Integration> integrations = integrationsResult.getItems(); updateUsageFor...
@Test public void shouldComputeSameIntegrationAndDeployment() { final IntegrationUpdateHandler updateHandler = new IntegrationUpdateHandler(dataManager, null, validator); String id = "MyTestIntegration-x123456"; Connector sqlConnector = newSqlConnector(); Connection sqlConnection = newSqlConnection(sqlConnector); Integ...
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final DataManager dataManager = getDataManager(); final List<Integration> integrations = dataMana...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
@Test public void shouldComputeStaleIntegrationAndDeployment() { final IntegrationUpdateHandler updateHandler = new IntegrationUpdateHandler(dataManager, null, validator); ChangeEvent event = getEventFromChangedIntegration(false); List<IntegrationBulletinBoard> boards = updateHandler.compute(event); assertFalse(boards....
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final DataManager dataManager = getDataManager(); final List<Integration> integrations = dataMana...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
@Test public void shouldNotWarnOnDynamicStaleIntegrationAndDeployment() { final IntegrationUpdateHandler updateHandler = new IntegrationUpdateHandler(dataManager, null, validator); ChangeEvent event = getEventFromChangedIntegration(true); List<IntegrationBulletinBoard> boards = updateHandler.compute(event); assertFalse...
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final DataManager dataManager = getDataManager(); final List<Integration> integrations = dataMana...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
@Test public void shouldComputeStaleDeploymentOnly() { final IntegrationUpdateHandler updateHandler = new IntegrationUpdateHandler(dataManager, null, validator); String id = "MyTestIntegration-x123456"; Connector sqlConnector = newSqlConnector(); Connection sqlConnection = newSqlConnection(sqlConnector); Integration sq...
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final DataManager dataManager = getDataManager(); final List<Integration> integrations = dataMana...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
@Test public void shouldComputeComparisonForModifiedIntegrationAndUnpubishedDeployment() { final IntegrationUpdateHandler updateHandler = new IntegrationUpdateHandler(dataManager, null, validator); String id = "MyTestIntegration-x123456"; Connector sqlConnector = newSqlConnector(); Connection sqlConnection = newSqlConn...
@SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final DataManager dataManager = getDataManager(); final List<Integration> integrations = dataMana...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
IntegrationUpdateHandler extends AbstractResourceUpdateHandler<IntegrationBulletinBoard> { @SuppressWarnings({"PMD.ExcessiveMethodLength", "PMD.NPathComplexity"}) @Override protected List<IntegrationBulletinBoard> compute(final ChangeEvent event) { final List<IntegrationBulletinBoard> boards = new ArrayList<>(); final ...
@Test public void shouldNotComputeConnectorConfiguredPropertiesAsMissing() { final ConnectionUpdateHandler updateHandler = new ConnectionUpdateHandler(dataManager, null, validator); final Connection connection = new Connection.Builder() .id("connection") .putConfiguredProperty("req2", "value2") .build(); final Configur...
ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) { final DataManager dataManager = getDataManager(); final String id = connection.getId().get(); final ConnectionBulletinBoard board = dataManager.fetchByPropertyValue(ConnectionBulletinBoard.class, "targetResourc...
ConnectionUpdateHandler extends AbstractResourceUpdateHandler<ConnectionBulletinBoard> { ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) { final DataManager dataManager = getDataManager(); final String id = connection.getId().get(); final ConnectionBulletinBoa...
ConnectionUpdateHandler extends AbstractResourceUpdateHandler<ConnectionBulletinBoard> { ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) { final DataManager dataManager = getDataManager(); final String id = connection.getId().get(); final ConnectionBulletinBoa...
ConnectionUpdateHandler extends AbstractResourceUpdateHandler<ConnectionBulletinBoard> { ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) { final DataManager dataManager = getDataManager(); final String id = connection.getId().get(); final ConnectionBulletinBoa...
ConnectionUpdateHandler extends AbstractResourceUpdateHandler<ConnectionBulletinBoard> { ConnectionBulletinBoard computeBoard(Connection connection, Connector oldConnector, Connector newConnector) { final DataManager dataManager = getDataManager(); final String id = connection.getId().get(); final ConnectionBulletinBoa...
@Test public void shouldProcessEvents() throws InterruptedException, ExecutionException, TimeoutException { reset(handlers); for (final ResourceUpdateHandler handler : handlers) { when(handler.canHandle(event)).thenReturn(true); } final CompletableFuture<Void> processed = controller.onEventInternal(EventBus.Type.CHANGE...
CompletableFuture<Void> onEventInternal(final String event, final String data) { if (!running.get()) { return CompletableFuture.completedFuture(null); } if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) { return CompletableFuture.completedFuture(null); } final ChangeEvent changeEvent; try { changeEvent = JsonUtil...
ResourceUpdateController { CompletableFuture<Void> onEventInternal(final String event, final String data) { if (!running.get()) { return CompletableFuture.completedFuture(null); } if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) { return CompletableFuture.completedFuture(null); } final ChangeEvent changeEvent; t...
ResourceUpdateController { CompletableFuture<Void> onEventInternal(final String event, final String data) { if (!running.get()) { return CompletableFuture.completedFuture(null); } if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) { return CompletableFuture.completedFuture(null); } final ChangeEvent changeEvent; t...
ResourceUpdateController { CompletableFuture<Void> onEventInternal(final String event, final String data) { if (!running.get()) { return CompletableFuture.completedFuture(null); } if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) { return CompletableFuture.completedFuture(null); } final ChangeEvent changeEvent; t...
ResourceUpdateController { CompletableFuture<Void> onEventInternal(final String event, final String data) { if (!running.get()) { return CompletableFuture.completedFuture(null); } if (!Objects.equals(event, EventBus.Type.CHANGE_EVENT)) { return CompletableFuture.completedFuture(null); } final ChangeEvent changeEvent; t...
@Test public void shouldCreateThreadFactories() { final ThreadFactory newThreadFactory = Threads.newThreadFactory("test name"); final Thread thread = newThreadFactory.newThread(System::gc); assertThat(thread.getThreadGroup().getName()).isEqualTo("test name"); assertThat(thread.getName()).isEqualTo("test name-0"); }
public static ThreadFactory newThreadFactory(final String groupName) { return new ThreadFactory() { @SuppressWarnings("PMD.AvoidThreadGroup") final ThreadGroup initialization = new ThreadGroup(groupName); final AtomicInteger threadNumber = new AtomicInteger(-1); @Override public Thread newThread(final Runnable task) { ...
Threads { public static ThreadFactory newThreadFactory(final String groupName) { return new ThreadFactory() { @SuppressWarnings("PMD.AvoidThreadGroup") final ThreadGroup initialization = new ThreadGroup(groupName); final AtomicInteger threadNumber = new AtomicInteger(-1); @Override public Thread newThread(final Runnabl...
Threads { public static ThreadFactory newThreadFactory(final String groupName) { return new ThreadFactory() { @SuppressWarnings("PMD.AvoidThreadGroup") final ThreadGroup initialization = new ThreadGroup(groupName); final AtomicInteger threadNumber = new AtomicInteger(-1); @Override public Thread newThread(final Runnabl...
Threads { public static ThreadFactory newThreadFactory(final String groupName) { return new ThreadFactory() { @SuppressWarnings("PMD.AvoidThreadGroup") final ThreadGroup initialization = new ThreadGroup(groupName); final AtomicInteger threadNumber = new AtomicInteger(-1); @Override public Thread newThread(final Runnabl...
Threads { public static ThreadFactory newThreadFactory(final String groupName) { return new ThreadFactory() { @SuppressWarnings("PMD.AvoidThreadGroup") final ThreadGroup initialization = new ThreadGroup(groupName); final AtomicInteger threadNumber = new AtomicInteger(-1); @Override public Thread newThread(final Runnabl...
@Test public void testEviction() { CacheManager manager = new LRUCacheManager(2); Cache<String, Object> cache = manager.getCache("cache", this.soft); String one = "1"; String two = "2"; String three = "3"; cache.put(one, one); cache.put(two, two); cache.put(three, three); assertThat(cache.size()).isEqualTo(2); assertTh...
@SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof LRUSoftCache))) { LOG.warn("Cache {} is b...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
@Test public void testIdentity() { CacheManager manager = new LRUCacheManager(2); Cache<String, String> cache1 = manager.getCache("cache", this.soft); Cache<String, String> cache2 = manager.getCache("cache", this.soft); Cache<String, String> cache3 = manager.getCache("cache", !this.soft); assertThat(cache1).isEqualTo(c...
@SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof LRUSoftCache))) { LOG.warn("Cache {} is b...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
LRUCacheManager implements CacheManager { @SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache(final String name, boolean soft) { Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft)); if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof...
@Test public void testNegativeValue() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> RandomValueGenerator.generate("alphanum:-1")) .withMessage("Cannot generate a string of negative length"); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testJsonInstanceDataShape() throws Exception { final String spec = "{\"kind\":\"java-instance\",\"name\":\"person\"}"; final ObjectNode ds = new ObjectMapper().createObjectNode(); ds.put("kind", DataShapeKinds.JSON_INSTANCE.toString()); ds.put("specification", spec); final Optional<DataShape> shape = ...
static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); addValueTo(root, "sp...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
@Test public void testPatternRespectedWithDefault() { for (int i = 0; i < 20; i++) { final String value = RandomValueGenerator.generate("alphanum"); assertThat(value).matches("[A-Za-z0-9]{40}"); } }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testPatternRespectedWithLength() { for (int i = 0; i < 20; i++) { final String value = RandomValueGenerator.generate("alphanum:12"); assertThat(value).matches("[A-Za-z0-9]{12}"); } }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testTrueRandom() { final Set<String> gen = new HashSet<>(); for (int i = 0; i < 20; i++) { final String value = RandomValueGenerator.generate("alphanum:80"); assertThat(value).matches("[A-Za-z0-9]{80}"); gen.add(value); } assertThat(gen.size()).isGreaterThan(10); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testUnknownGenerator() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> RandomValueGenerator.generate("alphanumx")) .withMessage("Unsupported generator scheme: alphanumx"); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testWrongValueType() { assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> RandomValueGenerator.generate("alphanum:aa")) .withMessage("Unexpected string after the alphanum scheme: expected length"); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testZeroValue() { final String value = RandomValueGenerator.generate("alphanum:0"); assertThat(value).isEqualTo(""); }
public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generator.substring(split + 1))...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
RandomValueGenerator { public static String generate(final String generator) { if (generator == null) { throw new IllegalArgumentException("Generator cannot be null"); } final int split = generator.indexOf(':'); if (split < 0) { return generate(generator, null); } return generate(generator.substring(0, split), generato...
@Test public void testBasicTemplate() throws Exception { String template = "{{text}}"; String newTemplate = processor.preProcess(template); assertNotEquals(template, newTemplate); assertEquals("[[body.text]]", newTemplate); }
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testTemplate() throws Exception { String template = EMPTY_STRING + "At {{time}}, {{name}}" + NEW_LINE + "submitted the following message:" + NEW_LINE + "{{text}}"; String expected = EMPTY_STRING + "At [[body.time]], [[body.name]]" + NEW_LINE + "submitted the following message:" + NEW_LINE + "[[body.te...
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void test2SymbolsTogether() throws Exception { String template = "{{name}}{{description}}"; String newTemplate = processor.preProcess(template); assertNotEquals(template, newTemplate); assertEquals("[[body.name]][[body.description]]", newTemplate); }
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testSectionTemplate() throws Exception { String template = EMPTY_STRING + "{{name}} passed the following courses:" + NEW_LINE + "{{#course}}" + NEW_LINE + "\t* {{name}}" + NEW_LINE + "{{/course}}" + NEW_LINE + "{{text}}"; String expected = EMPTY_STRING + "[[body.name]] passed the following courses:" +...
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testSimpleJavaDataShape() throws Exception { final ObjectNode ds = new ObjectMapper().createObjectNode(); ds.put("kind", DataShapeKinds.JAVA.toString()); ds.put("type", String.class.getName()); final Optional<DataShape> shape = DataShapeUtils.buildDataShape(ds); assertThat(shape.isPresent()).isTrue();...
static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); addValueTo(root, "sp...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
DataShapeUtils { static Optional<DataShape> buildDataShape(final JsonNode root) { if (root == null) { return Optional.empty(); } final DataShape.Builder builder = new DataShape.Builder(); addKindAndTypeTo(builder, root); addValueTo(root, "name", builder::name); addValueTo(root, "description", builder::description); add...
@Test public void testDanglingSectionTemplate() { String template = EMPTY_STRING + "{{name}} passed the following courses:" + NEW_LINE + "{{#course}}" + NEW_LINE + "\t* {{name}}" + NEW_LINE + "{{text}}"; assertThatThrownBy(() -> processor.preProcess(template)) .isInstanceOf(TemplateProcessingException.class) .hasMessag...
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testTemplateSymbolsWithSpaces() throws Exception { String template = EMPTY_STRING + "At {{the time}}, {{the name}}" + NEW_LINE + "submitted the following message:" + NEW_LINE + "{{the text}}"; String expected = EMPTY_STRING + "At [[body.the time]], [[body.the name]]" + NEW_LINE + "submitted the follow...
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testInvalidTemplateWrongSyntax() { String template = EMPTY_STRING + "At ${time}, ${name}" + NEW_LINE + "submitted the following message:" + NEW_LINE + "${text}"; assertThatThrownBy(() -> processor.preProcess(template)) .isInstanceOf(TemplateProcessingException.class) .hasMessageContaining("wrong langu...
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void testInvalidTemplateNoEndTag() { String template = EMPTY_STRING + "At {{time}"; assertThatThrownBy(() -> processor.preProcess(template)) .isInstanceOf(TemplateProcessingException.class) .hasMessageContaining("incomplete symbol"); }
@SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The template is invalid since a section has not been closed"); } newTempla...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
MustacheTemplatePreProcessor extends AbstractTemplatePreProcessor { @SuppressWarnings("PMD.PrematureDeclaration") @Override public String preProcess(String template) throws TemplateProcessingException { String newTemplate = super.preProcess(template); if (inSectionSymbol) { throw new TemplateProcessingException("The te...
@Test public void retrieveChannelListTest() { CamelContext context = new DefaultCamelContext(); SlackMetaDataExtension extension = new SlackMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("token", "token"); Optional<MetaDataExtension.MetaData> meta = extension.meta(propertie...
@SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with token {}", token); HttpClient client = HttpClientBuilder.cr...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
@Test public void noChannelTest() { CamelContext context = new DefaultCamelContext(); SlackMetaDataExtension extension = new SlackMetaDataExtension(context); Map<String, Object> properties = new HashMap<>(); properties.put("webhookurl", "token"); Optional<MetaDataExtension.MetaData> meta = extension.meta(properties); a...
@SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with token {}", token); HttpClient client = HttpClientBuilder.cr...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
SlackMetaDataExtension extends AbstractMetaDataExtension { @SuppressWarnings("unchecked") @Override public Optional<MetaData> meta(Map<String, Object> parameters) { final String token = ConnectorOptions.extractOption(parameters, "token"); if (token != null) { LOG.debug("Retrieving channels for connection to slack with ...
@Test public void verifySimpleFilterInputParameterExtraction() { String filterExpression = "{test: :#test, test2: \":#someParam\", test3: /:#regexParam/}"; List<String> result = FilterUtil.extractParameters(filterExpression); Assertions.assertThat(result).containsExactly("test", "someParam", "regexParam"); }
public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); static List<String> extr...
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); static List<String> extr...
@Test public void verifyComplexFilterInputParameterExtraction() { String filterExpression = "{ '$or' => [ {a => :#p1 }, { b => :#p2 } ] }"; List<String> result = FilterUtil.extractParameters(filterExpression); Assertions.assertThat(result).containsExactly("p1", "p2"); }
public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); }
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); static List<String> extr...
FilterUtil { public static List<String> extractParameters(String filter) { List<String> result = new ArrayList<>(); Matcher matcher = PARAM_PATTERN.matcher(filter); while (matcher.find()) { String param = matcher.group(); result.add(param.substring(2)); } return result; } private FilterUtil(); static List<String> extr...
@Test public void testComputeHttpUri() { assertThat( computeHttpUri("http", mapOf( "baseUrl", "www.google.com" )) ).isEqualTo("www.google.com"); assertThat( computeHttpUri("http", mapOf( "baseUrl", "www.google.com", "path", "/test" )) ).isEqualTo("www.google.com/test"); assertThat( computeHttpUri("http", mapOf( "baseUr...
public static String computeHttpUri(String scheme, Map<String, Object> options) { String baseUrl = (String)options.remove("baseUrl"); if (ObjectHelper.isEmpty(baseUrl)) { throw new IllegalArgumentException("baseUrl si mandatory"); } String uriScheme = StringHelper.before(baseUrl, ": if (ObjectHelper.isNotEmpty(uriSchem...
HttpConnectorFactories { public static String computeHttpUri(String scheme, Map<String, Object> options) { String baseUrl = (String)options.remove("baseUrl"); if (ObjectHelper.isEmpty(baseUrl)) { throw new IllegalArgumentException("baseUrl si mandatory"); } String uriScheme = StringHelper.before(baseUrl, ": if (ObjectH...
HttpConnectorFactories { public static String computeHttpUri(String scheme, Map<String, Object> options) { String baseUrl = (String)options.remove("baseUrl"); if (ObjectHelper.isEmpty(baseUrl)) { throw new IllegalArgumentException("baseUrl si mandatory"); } String uriScheme = StringHelper.before(baseUrl, ": if (ObjectH...
HttpConnectorFactories { public static String computeHttpUri(String scheme, Map<String, Object> options) { String baseUrl = (String)options.remove("baseUrl"); if (ObjectHelper.isEmpty(baseUrl)) { throw new IllegalArgumentException("baseUrl si mandatory"); } String uriScheme = StringHelper.before(baseUrl, ": if (ObjectH...
HttpConnectorFactories { public static String computeHttpUri(String scheme, Map<String, Object> options) { String baseUrl = (String)options.remove("baseUrl"); if (ObjectHelper.isEmpty(baseUrl)) { throw new IllegalArgumentException("baseUrl si mandatory"); } String uriScheme = StringHelper.before(baseUrl, ": if (ObjectH...
@Test public void testMetaDataExtensionRetrieval() throws Exception { ODataMetaDataExtension extension = new ODataMetaDataExtension(context); Map<String, Object> parameters = new HashMap<>(); parameters.put(SERVICE_URI, odataTestServer.getServiceUri()); Optional<MetaDataExtension.MetaData> meta = extension.meta(paramet...
public Set<String> getEntityNames() { return entityNames; }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
@Test public void integrationRouteLoaderTest() throws Exception { IntegrationRouteLoader irl = new IntegrationRouteLoader(); TestRuntime runtime = new TestRuntime(); irl.load(runtime, Sources.fromURI("classpath:/syndesis/integration/integration.syndesis?language=syndesis")); assertThat(runtime.builders).hasSize(1); fin...
public IntegrationRouteLoader() { }
IntegrationRouteLoader implements SourceLoader { public IntegrationRouteLoader() { } }
IntegrationRouteLoader implements SourceLoader { public IntegrationRouteLoader() { } IntegrationRouteLoader(); IntegrationRouteLoader(ActivityTracker activityTracker, Set<IntegrationStepHandler> integrationStepHandlers, Tracer tracer); }
IntegrationRouteLoader implements SourceLoader { public IntegrationRouteLoader() { } IntegrationRouteLoader(); IntegrationRouteLoader(ActivityTracker activityTracker, Set<IntegrationStepHandler> integrationStepHandlers, Tracer tracer); @Override List<String> getSupportedLanguages(); @...
IntegrationRouteLoader implements SourceLoader { public IntegrationRouteLoader() { } IntegrationRouteLoader(); IntegrationRouteLoader(ActivityTracker activityTracker, Set<IntegrationStepHandler> integrationStepHandlers, Tracer tracer); @Override List<String> getSupportedLanguages(); @...
@Test public void testMetaDataExtensionRetrievalSSL() throws Exception { ODataMetaDataExtension extension = new ODataMetaDataExtension(context); Map<String, Object> parameters = new HashMap<>(); parameters.put(SERVICE_URI, sslTestServer.getSecuredServiceUri()); parameters.put(SERVER_CERTIFICATE, Certificates.TEST_SERVI...
public Set<String> getEntityNames() { return entityNames; }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
@Test public void shouldIncludeKafkaCustomizerOptions() { ComponentProxyComponent mockComponent = mock(ComponentProxyComponent.class); DebeziumConsumerCustomizer debeziumCustomizer = new DebeziumConsumerCustomizer(new DefaultCamelContext()); Map<String, Object> userOptions = new HashMap<>(); userOptions.put("brokers","...
@Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { kafkaConnectionCustomizer.customize(component, options); component.setBeforeConsumer(DebeziumConsumerCustomizer::convertToDebeziumFormat); }
DebeziumConsumerCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { kafkaConnectionCustomizer.customize(component, options); component.setBeforeConsumer(DebeziumConsumerCustomizer::convertToDebe...
DebeziumConsumerCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { kafkaConnectionCustomizer.customize(component, options); component.setBeforeConsumer(DebeziumConsumerCustomizer::convertToDebe...
DebeziumConsumerCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { kafkaConnectionCustomizer.customize(component, options); component.setBeforeConsumer(DebeziumConsumerCustomizer::convertToDebe...
DebeziumConsumerCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(final ComponentProxyComponent component, final Map<String, Object> options) { kafkaConnectionCustomizer.customize(component, options); component.setBeforeConsumer(DebeziumConsumerCustomizer::convertToDebe...
@Test public void shouldBuildJsonSchema() { final String generated = DebeziumMySQLDatashapeStrategy.buildJsonSchema("table", Arrays.asList("\"prop1\":{\"type\":\"string\"}", "\"prop2\":{\"type\":\"string\"}", "\"prop3\":{\"type\":\"string\"}")); final String expected = "{\n" + " \"$schema\":\"http: " \"title\":\"table\...
static String buildJsonSchema(final String tableName, final List<String> properties) { final StringBuilder jsonSchemaBuilder = new StringBuilder("{\"$schema\": \"http: .append(tableName) .append("\",\"type\": \"object\",\"properties\": {"); final StringJoiner joiner = new StringJoiner(","); for (final String property :...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String buildJsonSchema(final String tableName, final List<String> properties) { final StringBuilder jsonSchemaBuilder = new StringBuilder("{\"$schema\": \"http: .append(tableName) .append("\",\"type\": \"object\",\"properties\": {"); final Str...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String buildJsonSchema(final String tableName, final List<String> properties) { final StringBuilder jsonSchemaBuilder = new StringBuilder("{\"$schema\": \"http: .append(tableName) .append("\",\"type\": \"object\",\"properties\": {"); final Str...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String buildJsonSchema(final String tableName, final List<String> properties) { final StringBuilder jsonSchemaBuilder = new StringBuilder("{\"$schema\": \"http: .append(tableName) .append("\",\"type\": \"object\",\"properties\": {"); final Str...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String buildJsonSchema(final String tableName, final List<String> properties) { final StringBuilder jsonSchemaBuilder = new StringBuilder("{\"$schema\": \"http: .append(tableName) .append("\",\"type\": \"object\",\"properties\": {"); final Str...
@Test public void shouldConvertDDLtoJsonSchema() { final String ddl = "CREATE TABLE `roles` (\n" + "`id` varchar(32) NOT NULL,\n" + "`name` varchar(100) NOT NULL,\n" + "`context` varchar(20) NOT NULL,\n" + "`organization_id` int(11) DEFAULT NULL,\n" + "`client_id` varchar(32) NOT NULL,\n" + "`scope_action_ids` text NOT...
static String convertDDLtoJsonSchema(final String ddl, final String tableName) { int firstParentheses = ddl.indexOf('('); final Matcher matcher = PATTERN.matcher(ddl.substring(firstParentheses)); final List<String> properties = new ArrayList<>(); while (matcher.find()) { final String field = matcher.group(1); final Str...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String convertDDLtoJsonSchema(final String ddl, final String tableName) { int firstParentheses = ddl.indexOf('('); final Matcher matcher = PATTERN.matcher(ddl.substring(firstParentheses)); final List<String> properties = new ArrayList<>(); whi...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String convertDDLtoJsonSchema(final String ddl, final String tableName) { int firstParentheses = ddl.indexOf('('); final Matcher matcher = PATTERN.matcher(ddl.substring(firstParentheses)); final List<String> properties = new ArrayList<>(); whi...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String convertDDLtoJsonSchema(final String ddl, final String tableName) { int firstParentheses = ddl.indexOf('('); final Matcher matcher = PATTERN.matcher(ddl.substring(firstParentheses)); final List<String> properties = new ArrayList<>(); whi...
DebeziumMySQLDatashapeStrategy implements DebeziumDatashapeStrategy { static String convertDDLtoJsonSchema(final String ddl, final String tableName) { int firstParentheses = ddl.indexOf('('); final Matcher matcher = PATTERN.matcher(ddl.substring(firstParentheses)); final List<String> properties = new ArrayList<>(); whi...
@Test public void shouldAdaptObjectMetadataForProperties() { final Map<String, Object> properties = new HashMap<>(); properties.put("sObjectName", "SimpleObject"); properties.put("sObjectIdName", null); final SyndesisMetadata metadata = adapter.adapt(null, null, null, properties, MetaDataBuilder.on(CONTEXT).withAttribu...
@Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema> schemasToConsider; if (isPresentAndNonNull(properties, Salesforc...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
@Test public void shouldAdaptObjectMetadataForSchema() throws IOException { final Map<String, Object> properties = new HashMap<>(); properties.put("sObjectName", "SimpleObject"); final SyndesisMetadata metadata = adapter.adapt(null, null, null, properties, MetaDataBuilder.on(CONTEXT).withAttribute("scope", "object").wi...
@Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema> schemasToConsider; if (isPresentAndNonNull(properties, Salesforc...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
@Test public void shouldAdaptObjectTypesMetadataForProperties() { final ObjectSchema globalObjectsPayload = new ObjectSchema(); final HashSet<Object> oneOf = new HashSet<>(); oneOf.add(simpleObjectSchema("Object1", "Object1 Label")); oneOf.add(simpleObjectSchema("Object2", "Object2 Label")); globalObjectsPayload.setOne...
@Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema> schemasToConsider; if (isPresentAndNonNull(properties, Salesforc...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
@Test public void shouldAdaptObjectTypesMetadataForPropertiesLegacy() throws IOException { final JsonNode payload = new ObjectMapper().readTree( "[{\"name\":\"Object1\",\"label\":\"Object1 Label\"},{\"name\":\"Object2\",\"label\":\"Object2 Label\"}]"); final SyndesisMetadata metadata = adapter.adapt(null, null, null, N...
@Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema> schemasToConsider; if (isPresentAndNonNull(properties, Salesforc...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
SalesforceMetadataRetrieval extends ComponentMetadataRetrieval { @Override protected SyndesisMetadata adapt(final CamelContext context, final String componentId, final String actionId, final Map<String, Object> properties, final MetaData metadata) { final ObjectSchema schema = schemaPayload(metadata); Set<ObjectSchema>...
@Test public void shouldAssertIfSelfSignedCertificate() { KafkaConnectionCustomizer kafkaConnectionCustomizer = new KafkaConnectionCustomizer(new DefaultCamelContext()); Map<String, Object> options = new HashMap<>(); options.put("brokers", "test:9092"); options.put("brokerCertificate", TEST_CERT); kafkaConnectionCustom...
@Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG.info("Setting SSLContextParameters configuration as a self-signed certificate was ...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
@Test public void testExtraOptions() { KafkaConnectionCustomizer kafkaConnectionCustomizer = new KafkaConnectionCustomizer(new DefaultCamelContext()); Map<String, Object> options = new HashMap<>(); options.put("brokers", "test:9092"); options.put("extraOptions", "[{\"key\":\"AAA\",\"value\":\"BBB\"}," + " {\"key\":\"au...
@Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG.info("Setting SSLContextParameters configuration as a self-signed certificate was ...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
@Test public void shouldFilterOutEverythingButInwardContentTypeHeader() { final SyndesisHeaderStrategy headerStrategy = new SyndesisHeaderStrategy(); assertThat(headerStrategy.applyFilterToCamelHeaders("Content-Type", "", exchange)).isTrue(); assertThat(headerStrategy.applyFilterToExternalHeaders("Content-Type", "", ex...
@Override public boolean applyFilterToCamelHeaders(final String headerName, final Object headerValue, final Exchange exchange) { if (isWhitelisted(exchange, headerName)) { return false; } return super.applyFilterToCamelHeaders(headerName, headerValue, exchange); }
SyndesisHeaderStrategy extends HttpHeaderFilterStrategy { @Override public boolean applyFilterToCamelHeaders(final String headerName, final Object headerValue, final Exchange exchange) { if (isWhitelisted(exchange, headerName)) { return false; } return super.applyFilterToCamelHeaders(headerName, headerValue, exchange);...
SyndesisHeaderStrategy extends HttpHeaderFilterStrategy { @Override public boolean applyFilterToCamelHeaders(final String headerName, final Object headerValue, final Exchange exchange) { if (isWhitelisted(exchange, headerName)) { return false; } return super.applyFilterToCamelHeaders(headerName, headerValue, exchange);...
SyndesisHeaderStrategy extends HttpHeaderFilterStrategy { @Override public boolean applyFilterToCamelHeaders(final String headerName, final Object headerValue, final Exchange exchange) { if (isWhitelisted(exchange, headerName)) { return false; } return super.applyFilterToCamelHeaders(headerName, headerValue, exchange);...
SyndesisHeaderStrategy extends HttpHeaderFilterStrategy { @Override public boolean applyFilterToCamelHeaders(final String headerName, final Object headerValue, final Exchange exchange) { if (isWhitelisted(exchange, headerName)) { return false; } return super.applyFilterToCamelHeaders(headerName, headerValue, exchange);...
@Test public void testExtraOptionsEmpty() { KafkaConnectionCustomizer kafkaConnectionCustomizer = new KafkaConnectionCustomizer(new DefaultCamelContext()); Map<String, Object> options = new HashMap<>(); options.put("brokers", "test:9092"); options.put("extraOptions", "[]"); kafkaConnectionCustomizer.customize(null, opt...
@Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG.info("Setting SSLContextParameters configuration as a self-signed certificate was ...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
KafkaConnectionCustomizer implements ComponentProxyCustomizer, CamelContextAware { @Override public void customize(ComponentProxyComponent component, Map<String, Object> options) { KafkaConfiguration configuration = new KafkaConfiguration(); if (ConnectorOptions.extractOption(options, CERTIFICATE_OPTION) != null) { LOG...
@Test public void shouldFetchPropertiesFromKafkaCustomResources() { final KubernetesClient client = mock(KubernetesClient.class); final KafkaMetaDataRetrieval metaDataRetrieval = new KafkaMetaDataRetrieval() { @Override KubernetesClient createKubernetesClient() { return client; } }; @SuppressWarnings("unchecked") final...
@Override public SyndesisMetadataProperties fetchProperties(CamelContext context, String componentId, Map<String, Object> properties) { List<PropertyPair> brokers = new ArrayList<>(); try (KubernetesClient client = createKubernetesClient()) { KafkaResourceList kafkaList = client.customResources(KAFKA_CRD, Kafka.class, ...
KafkaMetaDataRetrieval extends ComponentMetadataRetrieval { @Override public SyndesisMetadataProperties fetchProperties(CamelContext context, String componentId, Map<String, Object> properties) { List<PropertyPair> brokers = new ArrayList<>(); try (KubernetesClient client = createKubernetesClient()) { KafkaResourceList...
KafkaMetaDataRetrieval extends ComponentMetadataRetrieval { @Override public SyndesisMetadataProperties fetchProperties(CamelContext context, String componentId, Map<String, Object> properties) { List<PropertyPair> brokers = new ArrayList<>(); try (KubernetesClient client = createKubernetesClient()) { KafkaResourceList...
KafkaMetaDataRetrieval extends ComponentMetadataRetrieval { @Override public SyndesisMetadataProperties fetchProperties(CamelContext context, String componentId, Map<String, Object> properties) { List<PropertyPair> brokers = new ArrayList<>(); try (KubernetesClient client = createKubernetesClient()) { KafkaResourceList...
KafkaMetaDataRetrieval extends ComponentMetadataRetrieval { @Override public SyndesisMetadataProperties fetchProperties(CamelContext context, String componentId, Map<String, Object> properties) { List<PropertyPair> brokers = new ArrayList<>(); try (KubernetesClient client = createKubernetesClient()) { KafkaResourceList...
@Test public void testMetaDataExtensionRetrieval() throws Exception { ODataMetaDataExtension extension = new ODataMetaDataExtension(context); Map<String, Object> parameters = new HashMap<>(); parameters.put(SERVICE_URI, defaultTestServer.servicePlainUri()); Optional<MetaDataExtension.MetaData> meta = extension.meta(par...
public Set<String> getEntityNames() { return entityNames; }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
@Test public void testMetaDataExtensionRetrievalSSL() throws Exception { ODataMetaDataExtension extension = new ODataMetaDataExtension(context); Map<String, Object> parameters = new HashMap<>(); parameters.put(SERVICE_URI, sslTestServer.serviceSSLUri()); parameters.put(SERVER_CERTIFICATE, ODataTestServer.serverCertific...
public Set<String> getEntityNames() { return entityNames; }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
@Test public void testMetaDataExtensionRetrievalOnceResourcePathSet() throws Exception { ODataMetaDataExtension extension = new ODataMetaDataExtension(context); Map<String, Object> parameters = new HashMap<>(); parameters.put(SERVICE_URI, defaultTestServer.servicePlainUri()); parameters.put(RESOURCE_PATH, "Products"); ...
public Set<String> getEntityNames() { return entityNames; }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } }
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
ODataMetadata implements ODataConstants { public Set<String> getEntityNames() { return entityNames; } boolean hasEntityProperties(); Set<PropertyMetadata> getEntityProperties(); void addEntityProperty(PropertyMetadata property); void setEntityProperties(Set<PropertyMetadata> properties); boolean hasEntityNames(); Set<...
@Test public void shouldConvertGoogleEventToConnectorEventModel() { DefaultCamelContext cc = new DefaultCamelContext(); Exchange exchange = new DefaultExchange(cc); Message in = new DefaultMessage(cc); in.setBody(new Event()); exchange.setIn(in); GoogleCalendarEventsCustomizer.beforeConsumer(exchange); Object body = in...
static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Event event = exchange.getIn().getBody(Event.class); GoogleCalendarEventModel model = GoogleCalendarEventModel.newFrom(event); in.setBody(model); }
GoogleCalendarEventsCustomizer implements ComponentProxyCustomizer { static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Event event = exchange.getIn().getBody(Event.class); GoogleCalendarEventModel model = GoogleCalendarEventModel.newFrom(event); in.setBody(model); } }
GoogleCalendarEventsCustomizer implements ComponentProxyCustomizer { static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Event event = exchange.getIn().getBody(Event.class); GoogleCalendarEventModel model = GoogleCalendarEventModel.newFrom(event); in.setBody(model); } }
GoogleCalendarEventsCustomizer implements ComponentProxyCustomizer { static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Event event = exchange.getIn().getBody(Event.class); GoogleCalendarEventModel model = GoogleCalendarEventModel.newFrom(event); in.setBody(model); } @Override v...
GoogleCalendarEventsCustomizer implements ComponentProxyCustomizer { static void beforeConsumer(Exchange exchange) { final Message in = exchange.getIn(); final Event event = exchange.getIn().getBody(Event.class); GoogleCalendarEventModel model = GoogleCalendarEventModel.newFrom(event); in.setBody(model); } @Override v...
@Test public void shouldFormatEmptyAtendees() { assertThat(GoogleCalendarUtils.formatAtendees(Collections.emptyList())).isNull(); }
static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
@Test public void shouldFormatNullAtendees() { assertThat(GoogleCalendarUtils.formatAtendees(null)).isNull(); }
static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
GoogleCalendarUtils { static String formatAtendees(final List<EventAttendee> attendees) { if (attendees == null || attendees.isEmpty()) { return null; } return attendees.stream() .map(EventAttendee::getEmail) .collect(Collectors.joining(",")); } private GoogleCalendarUtils(); }
@Test public void shouldParseBlankAtendees() { assertThat(GoogleCalendarUtils.parseAtendees(" ")).isEmpty(); }
static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); }
GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ...
GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ...
GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ...
GoogleCalendarUtils { static List<EventAttendee> parseAtendees(final String attendeesString) { if (ObjectHelper.isEmpty(attendeesString)) { return Collections.emptyList(); } return Splitter.on(',').trimResults().splitToList(attendeesString) .stream() .map(GoogleCalendarUtils::attendee) .collect(Collectors.toList()); } ...