diff --git a/pom.xml b/pom.xml index 44a5f2b53b0804f806ee7157330a12982f703045..14d389af0bb8500b9f1b90d35c803764e8bc5546 100644 --- a/pom.xml +++ b/pom.xml @@ -8,18 +8,18 @@ <artifactId>eclipsefdn-profile-api</artifactId> <version>1.0.0-SNAPSHOT</version> <properties> - <compiler-plugin.version>3.11.0</compiler-plugin.version> + <compiler-plugin.version>3.13.0</compiler-plugin.version> <maven.compiler.source>17</maven.compiler.source> <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> - <quarkus.platform.version>3.8.6</quarkus.platform.version> + <quarkus.platform.version>3.15.3</quarkus.platform.version> <surefire-plugin.version>3.1.2</surefire-plugin.version> <auto-value.version>1.10.4</auto-value.version> <hibernate.version>5.5.6.Final</hibernate.version> - <eclipse-api-version>1.1.10</eclipse-api-version> + <eclipse-api-version>1.2.0</eclipse-api-version> <org.mapstruct.version>1.5.5.Final</org.mapstruct.version> <fdndb-api-version>1.1.2</fdndb-api-version> <sonar.sources>src/main</sonar.sources> diff --git a/src/main/java/org/eclipsefoundation/profile/config/LDAPConnectionConfig.java b/src/main/java/org/eclipsefoundation/profile/config/LDAPConnectionConfig.java index 6c12bcd016cb0d361af0da4b75b905166143e273..250545cc57b67ed0aa9226b506388455d1f752b5 100644 --- a/src/main/java/org/eclipsefoundation/profile/config/LDAPConnectionConfig.java +++ b/src/main/java/org/eclipsefoundation/profile/config/LDAPConnectionConfig.java @@ -12,6 +12,7 @@ package org.eclipsefoundation.profile.config; import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithDefault; /** * Loads all LDAP connection config properties. @@ -24,4 +25,8 @@ public interface LDAPConnectionConfig { Integer port(); String baseDn(); + + @WithDefault("false") + boolean useInsecure(); + } diff --git a/src/main/java/org/eclipsefoundation/profile/helpers/ProfileHelper.java b/src/main/java/org/eclipsefoundation/profile/helpers/ProfileHelper.java index e16d841b1f30955cd748865c064d98828c277e61..e67a1927ce459e39048698f869ffadfd9293492c 100644 --- a/src/main/java/org/eclipsefoundation/profile/helpers/ProfileHelper.java +++ b/src/main/java/org/eclipsefoundation/profile/helpers/ProfileHelper.java @@ -26,6 +26,7 @@ import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; import org.eclipse.microprofile.rest.client.inject.RestClient; import org.eclipsefoundation.efservices.api.models.EfUser.Email; +import org.eclipsefoundation.efservices.api.models.EfUserEmailBuilder; import org.eclipsefoundation.efservices.services.DrupalTokenService; import org.eclipsefoundation.foundationdb.client.runtime.model.full.FullOrganizationContactData; import org.eclipsefoundation.foundationdb.client.runtime.model.full.FullPeopleProjectData; @@ -277,8 +278,8 @@ public class ProfileHelper { return peopleAPI .getEmails(username) .stream() - .map(e -> Email.builder().setId(e.emailID().toString()).setMail(e.email()).build()) - .sorted((e1, e2) -> e1.getId().compareTo(e2.getId())) + .map(e -> EfUserEmailBuilder.builder().id(e.emailID().toString()).mail(e.email()).build()) + .sorted((e1, e2) -> e1.id().compareTo(e2.id())) .toList(); } catch (WebApplicationException e) { if (LOGGER.isDebugEnabled()) { diff --git a/src/main/java/org/eclipsefoundation/profile/helpers/UserMetadataHelper.java b/src/main/java/org/eclipsefoundation/profile/helpers/UserMetadataHelper.java index 46e46672fa5030282615b3f5cf31341139410dfa..57f88eef67a9adeb0f0594f73311494cda11d496 100644 --- a/src/main/java/org/eclipsefoundation/profile/helpers/UserMetadataHelper.java +++ b/src/main/java/org/eclipsefoundation/profile/helpers/UserMetadataHelper.java @@ -19,6 +19,7 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; import org.eclipsefoundation.efservices.api.models.EfUser.PublisherAgreement; +import org.eclipsefoundation.efservices.api.models.EfUserPublisherAgreementBuilder; import org.eclipsefoundation.foundationdb.client.runtime.model.full.FullPeopleProjectData; import org.eclipsefoundation.foundationdb.client.runtime.model.organization.OrganizationDocumentData; import org.eclipsefoundation.foundationdb.client.runtime.model.people.PeopleDocumentData; @@ -117,7 +118,7 @@ public final class UserMetadataHelper { .findFirst(); return agreement.isPresent() - ? Map.of("open-vsx", PublisherAgreement.builder().setVersion(Integer.toString((int) agreement.get().version())).build()) + ? Map.of("open-vsx", EfUserPublisherAgreementBuilder.builder().version(Integer.toString((int) agreement.get().version())).build()) : Collections.emptyMap(); } diff --git a/src/main/java/org/eclipsefoundation/profile/resources/AccountResource.java b/src/main/java/org/eclipsefoundation/profile/resources/AccountResource.java index 7f54ab524b47bf8c11dc8a31537017af5c415a1e..01448d983c2913eb9deb51c807a528c4ae3243f5 100644 --- a/src/main/java/org/eclipsefoundation/profile/resources/AccountResource.java +++ b/src/main/java/org/eclipsefoundation/profile/resources/AccountResource.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Optional; import org.eclipsefoundation.caching.model.CacheWrapper; -import org.eclipsefoundation.caching.model.ParameterizedCacheKey; +import org.eclipsefoundation.caching.model.ParameterizedCacheKeyBuilder; import org.eclipsefoundation.caching.service.CachingService; import org.eclipsefoundation.efservices.api.models.EfUser; import org.eclipsefoundation.efservices.models.AuthenticatedRequestWrapper; @@ -107,13 +107,13 @@ public class AccountResource { CacheWrapper<EfUser> cacheResult = cache .get("usersearch", cacheParams, EfUser.class, () -> profileService.getProfileByParams(params)); - Optional<Class<?>> errorType = cacheResult.getErrorType(); + Optional<Class<?>> errorType = cacheResult.errorType(); if (errorType.isPresent() && errorType.get().equals(ApplicationException.class)) { - cache.remove(ParameterizedCacheKey.builder().setClazz(EfUser.class).setId("usersearch").setParams(cacheParams).build()); + cache.remove(ParameterizedCacheKeyBuilder.builder().clazz(EfUser.class).id("usersearch").params(cacheParams).build()); throw new ApplicationException(SERVER_ERROR_MSG); } - Optional<EfUser> profile = cacheResult.getData(); + Optional<EfUser> profile = cacheResult.data(); if (profile.isEmpty()) { LOGGER.debug("Unable to retrieve profile data with params: {}", params); throw new NotFoundException(USER_NOT_FOUND_MSG); @@ -163,13 +163,13 @@ public class AccountResource { .get(username, new MultivaluedHashMap<>(), GerritResponse.class, () -> profileService.getUserGerritCount(username)); // ApplicationException is thrown when Account-API fails. Clear cache and return 500 - Optional<Class<?>> errorType = cacheResult.getErrorType(); + Optional<Class<?>> errorType = cacheResult.errorType(); if (errorType.isPresent() && errorType.get().equals(ApplicationException.class)) { - cache.remove(ParameterizedCacheKey.builder().setClazz(GerritResponse.class).setId(username).build()); + cache.remove(ParameterizedCacheKeyBuilder.builder().clazz(GerritResponse.class).id(username).build()); throw new ApplicationException(SERVER_ERROR_MSG); } - Optional<GerritResponse> gerritData = cacheResult.getData(); + Optional<GerritResponse> gerritData = cacheResult.data(); if (gerritData.isEmpty()) { throw new NotFoundException(USER_NOT_FOUND_MSG); } @@ -189,7 +189,7 @@ public class AccountResource { public Response getUserMailingList(@PathParam("username") String username) { Optional<Subscriptions> results = cache .get(username, new MultivaluedHashMap<>(), Subscriptions.class, () -> profileService.getSubscriptionsByUsername(username)) - .getData(); + .data(); if (results.isEmpty()) { throw new NotFoundException(USER_NOT_FOUND_MSG); } @@ -208,7 +208,7 @@ public class AccountResource { public Response getUserProjects(@PathParam("username") String username) { Optional<MultivaluedMap<String, PeopleProject>> results = cache .get(username, new MultivaluedHashMap<>(), MultivaluedMap.class, () -> profileService.getPersonProjects(username)) - .getData(); + .data(); if (results.isEmpty()) { throw new NotFoundException(USER_NOT_FOUND_MSG); } @@ -237,7 +237,7 @@ public class AccountResource { // Check current requests via username ProfileAPISearchParams params = new ProfileAPISearchParams(); - params.setName(Optional.of(user.getName())); + params.setName(Optional.of(user.name())); List<DeleteRequestData> deleteRequests = deleteService.getDeleteRequests(params); if (!deleteRequests.isEmpty()) { return Response.status(Status.CONFLICT).entity(CONFLICT_RESPONSE).build(); @@ -245,7 +245,7 @@ public class AccountResource { // Check current requests via user email params = new ProfileAPISearchParams(); - params.setMail(Optional.of(user.getMail())); + params.setMail(Optional.of(user.mail())); deleteRequests = deleteService.getDeleteRequests(params); if (!deleteRequests.isEmpty()) { return Response.status(Status.CONFLICT).entity(CONFLICT_RESPONSE).build(); @@ -262,10 +262,10 @@ public class AccountResource { deleteService.persistAccountRequestWithModLog(user); // anonymize friends table record for user - deleteService.anonymizeFriendsTableForUser(user.getName()); + deleteService.anonymizeFriendsTableForUser(user.name()); // Delete mpc favourite and gerrit data for user - deleteService.performDBCleanupForUser(user.getUid()); + deleteService.performDBCleanupForUser(user.uid()); // Return all created requests return Response.status(Status.CREATED).header("status", "201 Created").entity(created).build(); @@ -285,14 +285,14 @@ public class AccountResource { .get(username, cacheParams, EfUser.class, () -> profileService.getProfileByUsername(username)); // ApplicationException is thrown when LDAP or accounts fails. Clear cache and return 500 - Optional<Class<?>> errorType = cacheResult.getErrorType(); + Optional<Class<?>> errorType = cacheResult.errorType(); if (errorType.isPresent() && errorType.get().equals(ApplicationException.class)) { - cache.remove(ParameterizedCacheKey.builder().setClazz(EfUser.class).setId(username).setParams(cacheParams).build()); + cache.remove(ParameterizedCacheKeyBuilder.builder().clazz(EfUser.class).id(username).params(cacheParams).build()); throw new ApplicationException(SERVER_ERROR_MSG); } // No ApplicationException means the user just doesn't exist in LDAP or accounts - Optional<EfUser> profile = cacheResult.getData(); + Optional<EfUser> profile = cacheResult.data(); if (profile.isEmpty()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Unable to retrieve profile data for username: {}", TransformationHelper.formatLog(username)); diff --git a/src/main/java/org/eclipsefoundation/profile/resources/GithubResource.java b/src/main/java/org/eclipsefoundation/profile/resources/GithubResource.java index 91bab2a5464dd2a0a09dc03c0708744b70f6fe21..1af1628eb707e633c7c8c722365504624df73738 100644 --- a/src/main/java/org/eclipsefoundation/profile/resources/GithubResource.java +++ b/src/main/java/org/eclipsefoundation/profile/resources/GithubResource.java @@ -14,7 +14,7 @@ package org.eclipsefoundation.profile.resources; import java.util.Optional; import org.eclipsefoundation.caching.model.CacheWrapper; -import org.eclipsefoundation.caching.model.ParameterizedCacheKey; +import org.eclipsefoundation.caching.model.ParameterizedCacheKeyBuilder; import org.eclipsefoundation.caching.service.CachingService; import org.eclipsefoundation.efservices.api.models.EfUser; import org.eclipsefoundation.http.annotations.AuthenticatedAlternate; @@ -73,14 +73,14 @@ public class GithubResource { CacheWrapper<EfUser> cacheResult = cache.get(handle, cacheParams, EfUser.class, () -> profileService.getProfileByHandle(handle)); // ApplicationException is thrown when LDAP or accounts fails. Clear cache and return 500 - Optional<Class<?>> errorType = cacheResult.getErrorType(); + Optional<Class<?>> errorType = cacheResult.errorType(); if (errorType.isPresent() && errorType.get().equals(ApplicationException.class)) { - cache.remove(ParameterizedCacheKey.builder().setClazz(EfUser.class).setId(handle).setParams(cacheParams).build()); + cache.remove(ParameterizedCacheKeyBuilder.builder().clazz(EfUser.class).id(handle).params(cacheParams).build()); throw new ApplicationException("Failed connection to internal service"); } // No ApplicationException means the user just doesn't exist in LDAP or accounts - Optional<EfUser> profile = cacheResult.getData(); + Optional<EfUser> profile = cacheResult.data(); if (profile.isEmpty()) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Unable to retrieve profile data for GH handle: {}", TransformationHelper.formatLog(handle)); diff --git a/src/main/java/org/eclipsefoundation/profile/resources/SlackWebhookResource.java b/src/main/java/org/eclipsefoundation/profile/resources/SlackWebhookResource.java index e564507249d1a032fee36c809198cb749fb554c6..2d6e3278b268abc19cf349c682bf0a455ae43e58 100644 --- a/src/main/java/org/eclipsefoundation/profile/resources/SlackWebhookResource.java +++ b/src/main/java/org/eclipsefoundation/profile/resources/SlackWebhookResource.java @@ -17,7 +17,7 @@ import java.util.Optional; import org.apache.commons.lang3.StringUtils; import org.eclipsefoundation.caching.model.CacheWrapper; -import org.eclipsefoundation.caching.model.ParameterizedCacheKey; +import org.eclipsefoundation.caching.model.ParameterizedCacheKeyBuilder; import org.eclipsefoundation.caching.service.CachingService; import org.eclipsefoundation.efservices.api.models.EfUser; import org.eclipsefoundation.http.exception.ApplicationException; @@ -83,14 +83,14 @@ public class SlackWebhookResource { }); // ApplicationException is thrown when LDAP or accounts fails. Clear cache and return 500 - Optional<Class<?>> errorType = cacheResult.getErrorType(); + Optional<Class<?>> errorType = cacheResult.errorType(); if (errorType.isPresent() && errorType.get().equals(ApplicationException.class)) { - cache.remove(ParameterizedCacheKey.builder().setClazz(EfUser.class).setId(text).build()); + cache.remove(ParameterizedCacheKeyBuilder.builder().clazz(EfUser.class).id(text).build()); throw new ApplicationException("Failed connection to internal service"); } // Build response using profile if found - Optional<EfUser> profile = cacheResult.getData(); + Optional<EfUser> profile = cacheResult.data(); if (profile.isPresent()) { return Response.ok(buildProfileResponse(text, profile.get())).build(); } @@ -107,11 +107,11 @@ public class SlackWebhookResource { */ private SlackResponse buildProfileResponse(String receivedValue, EfUser profile) { // Build full name title and account URL - String accountUrl = "https://accounts.eclipse.org/user/" + profile.getUid(); - StringBuilder fullNameTitle = new StringBuilder(profile.getFullName()); - if (StringUtils.isNotBlank(profile.getOrg())) { + String accountUrl = "https://accounts.eclipse.org/user/" + profile.uid(); + StringBuilder fullNameTitle = new StringBuilder(profile.fullName()); + if (StringUtils.isNotBlank(profile.org())) { fullNameTitle.append(" ("); - fullNameTitle.append(profile.getOrg()); + fullNameTitle.append(profile.org()); fullNameTitle.append(")"); } @@ -138,40 +138,40 @@ public class SlackWebhookResource { private String buildProfileString(EfUser profile) { StringBuilder sb = new StringBuilder(DEFAULT_BUFFER_SIZE); sb.append("*ECA Status:* "); - sb.append(profile.getEca() != null && profile.getEca().getSigned() ? "Valid" : "Invalid"); + sb.append(profile.eca() != null && profile.eca().signed() ? "Valid" : "Invalid"); sb.append("\n*Name:* "); - sb.append(profile.getName()); + sb.append(profile.name()); sb.append("\n*Mail:* "); - sb.append(profile.getMail()); + sb.append(profile.mail()); sb.append("\n*Committer:* "); - sb.append(Boolean.TRUE.equals(profile.getIsCommitter()) ? "Yes" : "No"); - if (StringUtils.isNotBlank(profile.getGithubHandle())) { + sb.append(Boolean.TRUE.equals(profile.isCommitter()) ? "Yes" : "No"); + if (StringUtils.isNotBlank(profile.githubHandle())) { sb.append("\n*Github handle:* https://github.com/"); - sb.append(profile.getGithubHandle()); + sb.append(profile.githubHandle()); } - if (StringUtils.isNotBlank(profile.getTwitterHandle())) { + if (StringUtils.isNotBlank(profile.twitterHandle())) { sb.append("\n*Twitter handle:* https://twitter.com/"); - sb.append(profile.getTwitterHandle()); + sb.append(profile.twitterHandle()); } - if (StringUtils.isNotBlank(profile.getJobTitle())) { + if (StringUtils.isNotBlank(profile.jobTitle())) { sb.append("\n*Job title:* "); - sb.append(profile.getJobTitle()); + sb.append(profile.jobTitle()); } - if (StringUtils.isNotBlank(profile.getWebsite())) { + if (StringUtils.isNotBlank(profile.website())) { sb.append("\n*Website:* "); - sb.append(profile.getWebsite()); + sb.append(profile.website()); } - if (StringUtils.isNotBlank(profile.getCountry().getName())) { + if (StringUtils.isNotBlank(profile.country().name())) { sb.append("\n*Country:* "); - sb.append(profile.getCountry().getName()); + sb.append(profile.country().name()); } - if (StringUtils.isNotBlank(profile.getBio())) { + if (StringUtils.isNotBlank(profile.bio())) { sb.append("\n*Bio:* "); - sb.append(profile.getBio()); + sb.append(profile.bio()); } - if (!profile.getInterests().isEmpty()) { + if (!profile.interests().isEmpty()) { sb.append("\n*Interests:* "); - sb.append(String.join(", ", profile.getInterests())); + sb.append(String.join(", ", profile.interests())); } return sb.toString(); } diff --git a/src/main/java/org/eclipsefoundation/profile/response/ProfileFilter.java b/src/main/java/org/eclipsefoundation/profile/response/ProfileFilter.java index b637a443798679db5ed61e8e7f610e333d85bc10..87a5da89b533347229d82d702c86abd2a524158f 100644 --- a/src/main/java/org/eclipsefoundation/profile/response/ProfileFilter.java +++ b/src/main/java/org/eclipsefoundation/profile/response/ProfileFilter.java @@ -15,7 +15,8 @@ import java.io.IOException; import java.util.Collections; import org.eclipsefoundation.efservices.api.models.EfUser; -import org.eclipsefoundation.efservices.api.models.EfUser.Country; +import org.eclipsefoundation.efservices.api.models.EfUserBuilder; +import org.eclipsefoundation.efservices.api.models.EfUserCountryBuilder; import org.eclipsefoundation.efservices.models.AuthenticatedRequestWrapper; import org.jboss.resteasy.reactive.server.ServerResponseFilter; import org.slf4j.Logger; @@ -37,16 +38,15 @@ public class ProfileFilter { // Anonymize private fields if response is an EfUser entity if (responseContext.getEntity() instanceof EfUser profile && !tokenWrap.isAuthenticated()) { responseContext - .setEntity(profile - .toBuilder() - .setMail("") - .setMxid("") - .setCountry(Country.builder().setCode(null).setName(null).build()) - .setMailAlternate(Collections.emptyList()) - .setMailHistory(Collections.emptyList()) + .setEntity(EfUserBuilder.builder(profile) + .mail("") + .mxid("") + .country(EfUserCountryBuilder.builder().code(null).name(null).build()) + .mailAlternate(Collections.emptyList()) + .mailHistory(Collections.emptyList()) .build()); if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Profile anonymized for user: {}", profile.getName()); + LOGGER.debug("Profile anonymized for user: {}", profile.name()); } } } diff --git a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPConnectionWrapper.java b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPConnectionWrapper.java index dd1add37f55d847d88c1652b9524f8c509ed17a2..a39f550e8f097ff6cf7bdce85d1986ef506c33c7 100644 --- a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPConnectionWrapper.java +++ b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPConnectionWrapper.java @@ -57,11 +57,19 @@ public class DefaultLDAPConnectionWrapper implements LDAPConnectionWrapper { * @throws GeneralSecurityException */ private LDAPConnection getConnection() throws LDAPException, GeneralSecurityException { - LDAPConnectionOptions connectionOptions = new LDAPConnectionOptions(); - connectionOptions.setSSLSocketVerifier(new HostNameSSLSocketVerifier(true)); - LDAPConnection connection = new LDAPConnection(new SSLUtil().createSSLSocketFactory(), connectionOptions, config.host(), - config.port()); + LDAPConnection connection; + if (config.useInsecure()) { + connection = new LDAPConnection(null, null, config.host(), + config.port()); + } else { + // set up the SSL config options + LDAPConnectionOptions connectionOptions = new LDAPConnectionOptions(); + connectionOptions.setSSLSocketVerifier(new HostNameSSLSocketVerifier(true)); + connection = new LDAPConnection(new SSLUtil().createSSLSocketFactory(), connectionOptions, config.host(), + config.port()); + } LOGGER.trace("Connection Established - Eclipse LDAP Server"); return connection; + } } diff --git a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPService.java b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPService.java index 43d727d4e8dc59751230a18f977ba7f6d8c12f20..27d5ee6f135932228efb9e3f7ff4fce24f31c09b 100644 --- a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPService.java +++ b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultLDAPService.java @@ -148,6 +148,10 @@ public class DefaultLDAPService implements LDAPService { * @return The fully capitalized String */ private String capitalizeFully(String src) { + if (StringUtils.isBlank(src)) { + return ""; + } + List<String> words = Arrays.asList(src.split("\\s")).stream().map(StringUtils::capitalize).toList(); return String.join(" ", words); } diff --git a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultProfileService.java b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultProfileService.java index 6d42ecb3aecf23baf19772c298e5b99b7b971015..8526e76a617f35bcb65f4134c8758d8d3fa22074 100644 --- a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultProfileService.java +++ b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultProfileService.java @@ -29,6 +29,8 @@ import org.eclipsefoundation.efservices.api.models.EfUser; import org.eclipsefoundation.efservices.api.models.EfUser.Eca; import org.eclipsefoundation.efservices.api.models.EfUser.Email; import org.eclipsefoundation.efservices.api.models.EfUser.PublisherAgreement; +import org.eclipsefoundation.efservices.api.models.EfUserBuilder; +import org.eclipsefoundation.efservices.api.models.EfUserEcaBuilder; import org.eclipsefoundation.efservices.api.models.Project; import org.eclipsefoundation.efservices.services.ProjectService; import org.eclipsefoundation.foundationdb.client.runtime.model.full.FullOrganizationContactData; @@ -214,9 +216,9 @@ public class DefaultProfileService implements ProfileService { Optional<Eca> ecaResults = cache .get(username, new MultivaluedHashMap<>(), Eca.class, () -> isFullProfile ? getEcaStatusFromDocs(username, userDocs, orgContactData) : getEcaStatus(username)) - .getData(); + .data(); - return ecaResults.isPresent() ? ecaResults.get() : Eca.builder().setSigned(false).setCanContributeSpecProject(false).build(); + return ecaResults.isPresent() ? ecaResults.get() : EfUserEcaBuilder.builder().signed(false).canContributeSpecProject(false).build(); } @Override @@ -249,7 +251,7 @@ public class DefaultProfileService implements ProfileService { // Map each project to it's projectID, filtering out inactive projects, check through specProjects if id matches return projectsResults.stream().collect(MultivaluedHashMap::new, (multimap, project) -> { String id = project.project().projectID(); - boolean isSpecProject = specProjectsResult.stream().anyMatch(s -> s.getProjectId().equalsIgnoreCase(id)); + boolean isSpecProject = specProjectsResult.stream().anyMatch(s -> s.projectId().equalsIgnoreCase(id)); multimap.add(id, metadataHelper.buildPeopleProject(project, isSpecProject)); }, MultivaluedHashMap::putAll); @@ -340,7 +342,7 @@ public class DefaultProfileService implements ProfileService { boolean signedEca = canContributeSpecProject ? canContributeSpecProject : userDocs.stream().anyMatch(metadataHelper::userSignedEcaOrCla); - return Eca.builder().setSigned(signedEca).setCanContributeSpecProject(canContributeSpecProject).build(); + return EfUserEcaBuilder.builder().signed(signedEca).canContributeSpecProject(canContributeSpecProject).build(); } /** @@ -379,7 +381,7 @@ public class DefaultProfileService implements ProfileService { boolean signedEca = canContributeSpecProject ? canContributeSpecProject : userDocs.stream().anyMatch(metadataHelper::userSignedEcaOrCla); - return Eca.builder().setSigned(signedEca).setCanContributeSpecProject(canContributeSpecProject).build(); + return EfUserEcaBuilder.builder().signed(signedEca).canContributeSpecProject(canContributeSpecProject).build(); } /** @@ -392,25 +394,25 @@ public class DefaultProfileService implements ProfileService { * @return A EfUser populated with basic profile data. */ private EfUser buildSlimEfUser(LdapResult ldapResult, AccountsProfileData accountsResult) { - return EfUser + return EfUserBuilder .builder() - .setUid(accountsResult.getUid()) - .setName(ldapResult.getUsername()) - .setPicture(accountsResult.getPicture()) - .setMail(ldapResult.getMail()) - .setFirstName(ldapResult.getFirstName()) - .setLastName(ldapResult.getLastName()) - .setFullName(ldapResult.getFullName()) - .setPublisherAgreements(Collections.emptyMap()) - .setGithubHandle(ldapResult.getGithubId()) - .setTwitterHandle(accountsResult.getTwitterHandle()) - .setJobTitle(accountsResult.getJobTitle()) - .setWebsite(accountsResult.getWebsite()) - .setCountry(accountsResult.getCountry()) - .setBio(accountsResult.getBio()) - .setInterests(accountsResult.getInterests()) - .setMxid(accountsResult.getMxid()) - .setOrg(accountsResult.getOrg()) + .uid(accountsResult.getUid()) + .name(ldapResult.getUsername()) + .picture(accountsResult.getPicture()) + .mail(ldapResult.getMail()) + .firstName(ldapResult.getFirstName()) + .lastName(ldapResult.getLastName()) + .fullName(ldapResult.getFullName()) + .publisherAgreements(Collections.emptyMap()) + .githubHandle(ldapResult.getGithubId()) + .twitterHandle(accountsResult.getTwitterHandle()) + .jobTitle(accountsResult.getJobTitle()) + .website(accountsResult.getWebsite()) + .country(accountsResult.getCountry()) + .bio(accountsResult.getBio()) + .interests(accountsResult.getInterests()) + .mxid(accountsResult.getMxid()) + .org(accountsResult.getOrg()) .build(); } @@ -423,7 +425,7 @@ public class DefaultProfileService implements ProfileService { * @return A populated EfUser entity with all relevant data. */ private EfUser buildEfUser(LdapResult ldapResult, AccountsProfileData accountsResult) { - EfUser.Builder slimUserBuilder = buildSlimEfUser(ldapResult, accountsResult).toBuilder(); + EfUserBuilder slimUserBuilder = EfUserBuilder.builder(buildSlimEfUser(ldapResult, accountsResult)); String username = ldapResult.getUsername(); LOGGER.debug("Building EFUser with name: '{}'", username); @@ -460,11 +462,11 @@ public class DefaultProfileService implements ProfileService { addRelationURLs(slimUserBuilder, username); return slimUserBuilder - .setMailHistory(emailSearch.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) - .setMailAlternate(altEmailSearch.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) - .setEca(ecaStatus.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) - .setIsCommitter(metadataHelper.userIsCommitter(peopleProjectResults)) - .setPublisherAgreements(paStatus.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) + .mailHistory(emailSearch.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) + .mailAlternate(altEmailSearch.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) + .eca(ecaStatus.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) + .isCommitter(metadataHelper.userIsCommitter(peopleProjectResults)) + .publisherAgreements(paStatus.get(FUTURE_TIMEOUT, TimeUnit.SECONDS)) .build(); } catch (Exception e) { // We don't want to fail if there is a timeout on any fdndb calls, return what we've loaded @@ -483,14 +485,14 @@ public class DefaultProfileService implements ProfileService { * @param profile The current profile Builder object * @param orgContactData The loaded OrgContact data */ - private void addEmploymentDataIfExists(EfUser.Builder profile, List<FullOrganizationContactData> orgContactData) { + private void addEmploymentDataIfExists(EfUserBuilder profile, List<FullOrganizationContactData> orgContactData) { Optional<FullOrganizationContactData> employeeRecord = orgContactData .stream() .filter(oc -> oc.sysRelation().relation().equalsIgnoreCase("EMPLY")) .findFirst(); if (employeeRecord.isPresent()) { - profile.setOrg(employeeRecord.get().organization().name1()).setOrgId(employeeRecord.get().organization().organizationID()); + profile.org(employeeRecord.get().organization().name1()).orgId(employeeRecord.get().organization().organizationID()); } } @@ -500,13 +502,13 @@ public class DefaultProfileService implements ProfileService { * @param profile The current profile Builder object * @param orgContactData The given username */ - private void addRelationURLs(EfUser.Builder profile, String username) { + private void addRelationURLs(EfUserBuilder profile, String username) { profile - .setEcaUrl(metadataHelper.buildRelationshipUrl(username, "eca")) - .setProjectsUrl(metadataHelper.buildRelationshipUrl(username, "projects")) - .setGerritUrl(metadataHelper.buildRelationshipUrl(username, "gerrit")) - .setMailinglistUrl(metadataHelper.buildRelationshipUrl(username, "mailing-list")) - .setMpcFavoritesUrl(metadataConfig.url().marketplaceFavoritesUrl() + username + "/favorites"); + .ecaUrl(metadataHelper.buildRelationshipUrl(username, "eca")) + .projectsUrl(metadataHelper.buildRelationshipUrl(username, "projects")) + .gerritUrl(metadataHelper.buildRelationshipUrl(username, "gerrit")) + .mailinglistUrl(metadataHelper.buildRelationshipUrl(username, "mailing-list")) + .mpcFavoritesUrl(metadataConfig.url().marketplaceFavoritesUrl() + username + "/favorites"); } /** diff --git a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultUserDeleteService.java b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultUserDeleteService.java index 5271145f6dd4f233298d357f41bffe2f9dda6dbf..80944263fd1ff0bd117da0788838b2efe92dd917 100644 --- a/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultUserDeleteService.java +++ b/src/main/java/org/eclipsefoundation/profile/services/impl/DefaultUserDeleteService.java @@ -117,9 +117,9 @@ public class DefaultUserDeleteService implements UserDeleteService { // Create a new request entity for each host List<UserDeleteRequest> toAdd = hosts.values().stream().map(host -> { UserDeleteRequest request = new UserDeleteRequest(); - request.setUid(Integer.valueOf(user.getUid())); - request.setName(user.getName()); - request.setMail(user.getMail()); + request.setUid(Integer.valueOf(user.uid())); + request.setName(user.name()); + request.setMail(user.mail()); request.setHost(host); request.setStatus(0); request.setCreated(now); @@ -137,23 +137,23 @@ public class DefaultUserDeleteService implements UserDeleteService { // Persist a deletion AccountsRequest List<AccountRequests> added = eclipseDao .add(new RDBMSQuery<>(wrap, filters.get(AccountRequests.class)), - Arrays.asList(userDeleteHelper.buildDeletionAccountRequest(user.getMail(), user.getName()))); + Arrays.asList(userDeleteHelper.buildDeletionAccountRequest(user.mail(), user.name()))); // Track system event sysAPI .insertSysModLog(SysModLogDataBuilder .builder() .logTable("ProfileAPI") - .pk1(user.getMail()) - .pk2(user.getUid()) + .pk1(user.mail()) + .pk2(user.uid()) .logAction("DELETEACCOUNT") - .personId(user.getName()) + .personId(user.name()) .modDateTime(DateTimeHelper.now()) .build()); return added.isEmpty() ? Optional.empty() : Optional.of(added.get(0)); } catch (Exception e) { - LOGGER.error("Something went wrong while persisting AccountRequest for user: {}", user.getName(), e); + LOGGER.error("Something went wrong while persisting AccountRequest for user: {}", user.name(), e); sysAPI .insertSysModLog(SysModLogDataBuilder .builder() @@ -161,7 +161,7 @@ public class DefaultUserDeleteService implements UserDeleteService { .pk1("persistAccountRequestWithModLog") .pk2(ipParser.getBestMatchingIP()) .logAction("sql_error") - .personId(user.getMail()) + .personId(user.mail()) .modDateTime(DateTimeHelper.now()) .build()); return Optional.empty(); diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9760ec823e15968e8346ec0f65e578248d568a40..557c890672e3e11c67dd92e809351d6d256df495 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,6 +13,7 @@ quarkus.hibernate-orm.physical-naming-strategy=org.hibernate.boot.model.naming.C ## "eclipse" datasource configs quarkus.datasource."eclipse".db-kind=mariadb +quarkus.datasource."eclipse".db-version=10.0.0 quarkus.datasource."eclipse".jdbc.min-size = 5 quarkus.datasource."eclipse".jdbc.max-size = 15 quarkus.hibernate-orm."eclipse".packages=org.eclipsefoundation.profile.dtos.eclipse diff --git a/src/test/java/org/eclipsefoundation/profile/test/api/MockAccountsAPI.java b/src/test/java/org/eclipsefoundation/profile/test/api/MockAccountsAPI.java index e84db4608a54ab0b3661f44b332137b813cafa5b..c821a48eb256865f94971e2d92a2ec5cef90ceb9 100644 --- a/src/test/java/org/eclipsefoundation/profile/test/api/MockAccountsAPI.java +++ b/src/test/java/org/eclipsefoundation/profile/test/api/MockAccountsAPI.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Optional; import org.eclipse.microprofile.rest.client.inject.RestClient; -import org.eclipsefoundation.efservices.api.models.EfUser.Country; +import org.eclipsefoundation.efservices.api.models.EfUserCountryBuilder; import org.eclipsefoundation.profile.api.DrupalAccountsAPI; import org.eclipsefoundation.profile.api.models.AccountsProfileData; import org.eclipsefoundation.profile.helpers.ProfileHelper; @@ -51,7 +51,7 @@ public class MockAccountsAPI implements DrupalAccountsAPI { .setOrg("Eclipse") .setJobTitle("boss") .setWebsite("google.com") - .setCountry(Country.builder().setCode("CA").setName("Canada").build()) + .setCountry(EfUserCountryBuilder.builder().code("CA").name("Canada").build()) .setBio("Likes do do things") .setInterests(Arrays.asList("item1", "item2")) .setPicture("pic URL") @@ -68,7 +68,7 @@ public class MockAccountsAPI implements DrupalAccountsAPI { .setOrg("IBM") .setJobTitle("Worker") .setWebsite("google.com") - .setCountry(Country.builder().setCode("US").setName("United States").build()) + .setCountry(EfUserCountryBuilder.builder().code("US").name("United States").build()) .setBio("Likes do do things") .setInterests(Arrays.asList("item1", "item2")) .setPicture("pic URL") @@ -85,7 +85,7 @@ public class MockAccountsAPI implements DrupalAccountsAPI { .setOrg("Eclipse") .setJobTitle("Worker") .setWebsite("google.com") - .setCountry(Country.builder().setCode("CA").setName("Canada").build()) + .setCountry(EfUserCountryBuilder.builder().code("CA").name("Canada").build()) .setBio("Likes do do things") .setInterests(Arrays.asList("item1", "item2")) .setPicture("pic URL") @@ -102,7 +102,7 @@ public class MockAccountsAPI implements DrupalAccountsAPI { .setOrg("Microsoft") .setJobTitle("Worker") .setWebsite("google.com") - .setCountry(Country.builder().setCode("UK").setName("United Kingdom").build()) + .setCountry(EfUserCountryBuilder.builder().code("UK").name("United Kingdom").build()) .setBio("Likes do do things") .setInterests(Arrays.asList("item1", "item2")) .setPicture("pic URL") @@ -119,7 +119,7 @@ public class MockAccountsAPI implements DrupalAccountsAPI { .setOrg("Microsoft") .setJobTitle("Worker") .setWebsite("google.com") - .setCountry(Country.builder().setCode("UK").setName("United Kingdom").build()) + .setCountry(EfUserCountryBuilder.builder().code("UK").name("United Kingdom").build()) .setBio("Likes do do things") .setInterests(Arrays.asList("item1", "item2")) .setPicture("pic URL") diff --git a/src/test/java/org/eclipsefoundation/profile/test/api/MockDrupalOAuthAPI.java b/src/test/java/org/eclipsefoundation/profile/test/api/MockDrupalOAuthAPI.java index 5de14b1fe6680b9ee083fac083c14bb4dc05bda1..28a2637dc46d7f38698c116e6e3fefcc7d5ee937 100644 --- a/src/test/java/org/eclipsefoundation/profile/test/api/MockDrupalOAuthAPI.java +++ b/src/test/java/org/eclipsefoundation/profile/test/api/MockDrupalOAuthAPI.java @@ -19,6 +19,7 @@ import java.util.List; import org.eclipse.microprofile.rest.client.inject.RestClient; import org.eclipsefoundation.efservices.api.DrupalOAuthAPI; import org.eclipsefoundation.efservices.api.models.DrupalOAuthData; +import org.eclipsefoundation.efservices.api.models.DrupalOAuthDataBuilder; import org.eclipsefoundation.efservices.api.models.DrupalUserInfo; import org.eclipsefoundation.efservices.helpers.DrupalAuthHelper; import org.eclipsefoundation.profile.test.helpers.TestNamespaceHelper; @@ -39,34 +40,34 @@ public class MockDrupalOAuthAPI implements DrupalOAuthAPI { tokens = new ArrayList<>(); tokens .addAll(Arrays - .asList(DrupalOAuthData + .asList(DrupalOAuthDataBuilder .builder() - .setAccessToken("token1") - .setClientId("client-id") - .setExpires(1674111182) - .setScope("read write") + .accessToken("token1") + .clientId("client-id") + .expires(1674111182) + .scope("read write") .build(), - DrupalOAuthData + DrupalOAuthDataBuilder .builder() - .setAccessToken("token2") - .setClientId("test-id") - .setExpires(Instant.now().getEpochSecond() + 20000) - .setScope("read write admin") + .accessToken("token2") + .clientId("test-id") + .expires(Instant.now().getEpochSecond() + 20000) + .scope("read write admin") .build(), - DrupalOAuthData + DrupalOAuthDataBuilder .builder() - .setAccessToken("token3") - .setClientId("test-id") - .setExpires(1234567890) - .setScope("read admin") + .accessToken("token3") + .clientId("test-id") + .expires(1234567890) + .scope("read admin") .build(), - DrupalOAuthData + DrupalOAuthDataBuilder .builder() - .setAccessToken("token4") - .setClientId("test-id") - .setUserId(TestNamespaceHelper.VALID_UID) - .setExpires(Instant.now().getEpochSecond() + 20000) - .setScope("read write admin") + .accessToken("token4") + .clientId("test-id") + .userId(TestNamespaceHelper.VALID_UID) + .expires(Instant.now().getEpochSecond() + 20000) + .scope("read write admin") .build())); users = new ArrayList<>(); @@ -78,16 +79,16 @@ public class MockDrupalOAuthAPI implements DrupalOAuthAPI { @Override public DrupalOAuthData getTokenInfo(String token) { - return tokens.stream().filter(t -> t.getAccessToken().equalsIgnoreCase(token)).findFirst().orElse(null); + return tokens.stream().filter(t -> t.accessToken().equalsIgnoreCase(token)).findFirst().orElse(null); } @Override public DrupalUserInfo getUserInfoFromToken(String token) { DrupalOAuthData tokenInfo = getTokenInfo(DrupalAuthHelper.stripBearerToken(token)); - if (tokenInfo == null || tokenInfo.getUserId() == null) { + if (tokenInfo == null || tokenInfo.userId() == null) { throw new FinalForbiddenException("The access token provided is invalid"); } - return users.stream().filter(u -> u.sub().equalsIgnoreCase(tokenInfo.getUserId())).findFirst().orElse(null); + return users.stream().filter(u -> u.sub().equalsIgnoreCase(tokenInfo.userId())).findFirst().orElse(null); } } \ No newline at end of file diff --git a/src/test/java/org/eclipsefoundation/profile/test/api/MockProjectAPI.java b/src/test/java/org/eclipsefoundation/profile/test/api/MockProjectAPI.java index fef18c7e998fed4cc4a50d8b51695a195f47c4c2..f3e110ad97755ea8e31e6534fa86fb51665e29ea 100644 --- a/src/test/java/org/eclipsefoundation/profile/test/api/MockProjectAPI.java +++ b/src/test/java/org/eclipsefoundation/profile/test/api/MockProjectAPI.java @@ -20,12 +20,15 @@ import java.util.Map; import org.eclipse.microprofile.rest.client.inject.RestClient; import org.eclipsefoundation.core.service.APIMiddleware.BaseAPIParameters; import org.eclipsefoundation.efservices.api.ProjectsAPI; -import org.eclipsefoundation.efservices.api.models.GitlabProject; +import org.eclipsefoundation.efservices.api.models.GitlabProjectBuilder; import org.eclipsefoundation.efservices.api.models.InterestGroup; import org.eclipsefoundation.efservices.api.models.Project; -import org.eclipsefoundation.efservices.api.models.Project.GithubProject; import org.eclipsefoundation.efservices.api.models.Project.ProjectParticipant; import org.eclipsefoundation.efservices.api.models.Project.Repo; +import org.eclipsefoundation.efservices.api.models.ProjectBuilder; +import org.eclipsefoundation.efservices.api.models.ProjectGithubProjectBuilder; +import org.eclipsefoundation.efservices.api.models.ProjectProjectParticipantBuilder; +import org.eclipsefoundation.efservices.api.models.ProjectRepoBuilder; import org.eclipsefoundation.testing.helpers.MockDataPaginationHandler; import org.jboss.resteasy.reactive.RestResponse; @@ -44,67 +47,69 @@ public class MockProjectAPI implements ProjectsAPI { this.specProjects = new ArrayList<>(); // sample repos - Repo r1 = Repo.builder().setUrl("http://www.github.com/eclipsefdn/sample").build(); - Repo r2 = Repo.builder().setUrl("http://www.github.com/eclipsefdn/test").build(); - Repo r3 = Repo.builder().setUrl("http://www.github.com/eclipsefdn/tck-proto").build(); - Repo r4 = Repo.builder().setUrl("/gitroot/sample/gerrit.project.git").build(); + Repo r1 = ProjectRepoBuilder.builder().url("http://www.github.com/eclipsefdn/sample").build(); + Repo r2 = ProjectRepoBuilder.builder().url("http://www.github.com/eclipsefdn/test").build(); + Repo r3 = ProjectRepoBuilder.builder().url("http://www.github.com/eclipsefdn/tck-proto").build(); + Repo r4 = ProjectRepoBuilder.builder().url("/gitroot/sample/gerrit.project.git").build(); // sample users - ProjectParticipant u1 = ProjectParticipant.builder().setUrl("").setUsername("da_wizz").setFullName("da_wizz").build(); - ProjectParticipant u2 = ProjectParticipant.builder().setUrl("").setUsername("grunter").setFullName("grunter").build(); + ProjectParticipant u1 = ProjectProjectParticipantBuilder.builder().url("").username("da_wizz").fullName("da_wizz").build(); + ProjectParticipant u2 = ProjectProjectParticipantBuilder.builder().url("").username("grunter").fullName("grunter").build(); this.specProjects - .add(Project + .add(ProjectBuilder .builder() - .setName("Some project") - .setProjectId("some.project") - .setSpecProjectWorkingGroup(Map.of("id", "proj1", "name", "proj1")) - .setGithubRepos(Arrays.asList(r1, r2)) - .setGerritRepos(Arrays.asList(r4)) - .setCommitters(Arrays.asList(u1, u2)) - .setProjectLeads(Collections.emptyList()) - .setGitlab(GitlabProject.builder().setIgnoredSubGroups(Collections.emptyList()).setProjectGroup("").build()) - .setShortProjectId("sample.proj") - .setSummary("summary") - .setUrl("project.url.com") - .setWebsiteUrl("someproject.com") - .setWebsiteRepo(Collections.emptyList()) - .setLogo("logoUrl.com") - .setTags(Collections.emptyList()) - .setGithub(GithubProject.builder().setOrg("org name").setIgnoredRepos(Collections.emptyList()).build()) - .setContributors(Collections.emptyList()) - .setIndustryCollaborations(Collections.emptyList()) - .setReleases(Collections.emptyList()) - .setTopLevelProject("eclipse") + .name("Some project") + .projectId("some.project") + .shortProjectId("sample.proj") + .summary("summary") + .url("project.url.com") + .websiteUrl("someproject.com") + .websiteRepo(Collections.emptyList()) + .logo("logoUrl.com") + .tags(Collections.emptyList()) + .githubRepos(Arrays.asList(r1, r2)) + .gitlabRepos(Collections.emptyList()) + .gerritRepos(Arrays.asList(r4)) + .committers(Arrays.asList(u1, u2)) + .projectLeads(Collections.emptyList()) + .gitlab(GitlabProjectBuilder.builder().ignoredSubGroups(Collections.emptyList()).projectGroup("").build()) + .github(ProjectGithubProjectBuilder.builder().org("org name").ignoredRepos(Collections.emptyList()).build()) + .contributors(Collections.emptyList()) + .industryCollaborations(Collections.emptyList()) + .releases(Collections.emptyList()) + .topLevelProject("eclipse") + .specProjectWorkingGroup(Map.of("id", "proj1", "name", "proj1")) .build()); this.specProjects - .add(Project + .add(ProjectBuilder .builder() - .setName("Other project") - .setProjectId("other.project") - .setSpecProjectWorkingGroup(Map.of("id", "proj1", "name", "proj1")) - .setGithubRepos(Arrays.asList(r3)) - .setGerritRepos(Collections.emptyList()) - .setGitlab(GitlabProject + .name("Other project") + .projectId("other.project") + .specProjectWorkingGroup(Map.of("id", "proj1", "name", "proj1")) + .githubRepos(Arrays.asList(r3)) + .gitlabRepos(Collections.emptyList()) + .gerritRepos(Collections.emptyList()) + .gitlab(GitlabProjectBuilder .builder() - .setIgnoredSubGroups(Arrays.asList("eclipse/dash/mirror")) - .setProjectGroup("eclipse/dash") + .ignoredSubGroups(Arrays.asList("eclipse/dash/mirror")) + .projectGroup("eclipse/dash") .build()) - .setCommitters(Arrays.asList(u1, u2)) - .setProjectLeads(Collections.emptyList()) - .setShortProjectId("spec.proj") - .setSummary("summary") - .setUrl("project.url.com") - .setWebsiteUrl("someproject.com") - .setWebsiteRepo(Collections.emptyList()) - .setLogo("logoUrl.com") - .setTags(Collections.emptyList()) - .setGithub(GithubProject.builder().setOrg("org name").setIgnoredRepos(Collections.emptyList()).build()) - .setContributors(Collections.emptyList()) - .setIndustryCollaborations(Collections.emptyList()) - .setReleases(Collections.emptyList()) - .setTopLevelProject("eclipse") + .committers(Arrays.asList(u1, u2)) + .projectLeads(Collections.emptyList()) + .shortProjectId("spec.proj") + .summary("summary") + .url("project.url.com") + .websiteUrl("someproject.com") + .websiteRepo(Collections.emptyList()) + .logo("logoUrl.com") + .tags(Collections.emptyList()) + .github(ProjectGithubProjectBuilder.builder().org("org name").ignoredRepos(Collections.emptyList()).build()) + .contributors(Collections.emptyList()) + .industryCollaborations(Collections.emptyList()) + .releases(Collections.emptyList()) + .topLevelProject("eclipse") .build()); } diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index c5f2813f766e630fa224f2ccced1d3e3d9d8f084..4014a603ce739daf0e531676c5bd256a8ff01b52 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -9,6 +9,7 @@ quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:mem:db;NON_KEYWORDS=USER quarkus.datasource."eclipse".db-kind=h2 +quarkus.datasource."eclipse".db-version=2.3.0 quarkus.datasource."eclipse".jdbc.url=jdbc:h2:mem:eclipse;NON_KEYWORDS=USER # Flyway configuration for the datasources