diff options
author | Pierre <pierre.guillot@sonarsource.com> | 2021-11-10 17:43:31 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-11-15 20:04:34 +0000 |
commit | 29b7cf350cd0235475e1c09182ab905e4303b442 (patch) | |
tree | c22449965b8efb03b9a8ecb3d224c701eb9b68bb /server/sonar-db-dao | |
parent | be652549aac881f0db55ee1ca7cb4871cc4babd5 (diff) | |
download | sonarqube-29b7cf350cd0235475e1c09182ab905e4303b442.tar.gz sonarqube-29b7cf350cd0235475e1c09182ab905e4303b442.zip |
SONAR-13426 add api/project_badges/token endpoint
Diffstat (limited to 'server/sonar-db-dao')
11 files changed, 374 insertions, 2 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java index ea48041aed2..cc088c10d12 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DaoModule.java @@ -60,6 +60,7 @@ import org.sonar.db.permission.template.PermissionTemplateDao; import org.sonar.db.plugin.PluginDao; import org.sonar.db.portfolio.PortfolioDao; import org.sonar.db.project.ProjectDao; +import org.sonar.db.project.ProjectBadgeTokenDao; import org.sonar.db.property.InternalComponentPropertiesDao; import org.sonar.db.property.InternalPropertiesDao; import org.sonar.db.property.PropertiesDao; @@ -137,6 +138,7 @@ public class DaoModule extends Module { PermissionTemplateDao.class, PluginDao.class, ProjectDao.class, + ProjectBadgeTokenDao.class, PortfolioDao.class, ProjectLinkDao.class, ProjectMappingsDao.class, diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java index 99fa1daa6fa..32fb4f65628 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DbClient.java @@ -58,6 +58,7 @@ import org.sonar.db.permission.template.PermissionTemplateDao; import org.sonar.db.plugin.PluginDao; import org.sonar.db.portfolio.PortfolioDao; import org.sonar.db.project.ProjectDao; +import org.sonar.db.project.ProjectBadgeTokenDao; import org.sonar.db.property.InternalComponentPropertiesDao; import org.sonar.db.property.InternalPropertiesDao; import org.sonar.db.property.PropertiesDao; @@ -166,6 +167,7 @@ public class DbClient { private final SamlMessageIdDao samlMessageIdDao; private final UserDismissedMessagesDao userDismissedMessagesDao; private final ApplicationProjectsDao applicationProjectsDao; + private final ProjectBadgeTokenDao projectBadgeTokenDao; public DbClient(Database database, MyBatis myBatis, DBSessions dbSessions, Dao... daos) { this.database = database; @@ -240,6 +242,7 @@ public class DbClient { internalComponentPropertiesDao = getDao(map, InternalComponentPropertiesDao.class); newCodePeriodDao = getDao(map, NewCodePeriodDao.class); projectDao = getDao(map, ProjectDao.class); + projectBadgeTokenDao = getDao(map, ProjectBadgeTokenDao.class); portfolioDao = getDao(map, PortfolioDao.class); sessionTokensDao = getDao(map, SessionTokensDao.class); samlMessageIdDao = getDao(map, SamlMessageIdDao.class); @@ -541,4 +544,7 @@ public class DbClient { return userDismissedMessagesDao; } + public ProjectBadgeTokenDao projectBadgeTokenDao() { + return projectBadgeTokenDao; + } } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java index 298be87c731..4db01625cce 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/MyBatis.java @@ -100,6 +100,8 @@ import org.sonar.db.portfolio.PortfolioDto; import org.sonar.db.portfolio.PortfolioMapper; import org.sonar.db.portfolio.PortfolioProjectDto; import org.sonar.db.portfolio.PortfolioReferenceDto; +import org.sonar.db.project.ProjectBadgeTokenDto; +import org.sonar.db.project.ProjectBadgeTokenMapper; import org.sonar.db.project.ProjectDto; import org.sonar.db.project.ProjectExportMapper; import org.sonar.db.project.ProjectMapper; @@ -117,8 +119,8 @@ import org.sonar.db.qualitygate.QualityGateConditionDto; import org.sonar.db.qualitygate.QualityGateConditionMapper; import org.sonar.db.qualitygate.QualityGateDto; import org.sonar.db.qualitygate.QualityGateGroupPermissionsMapper; -import org.sonar.db.qualitygate.QualityGateUserPermissionsMapper; import org.sonar.db.qualitygate.QualityGateMapper; +import org.sonar.db.qualitygate.QualityGateUserPermissionsMapper; import org.sonar.db.qualityprofile.ActiveRuleDto; import org.sonar.db.qualityprofile.ActiveRuleMapper; import org.sonar.db.qualityprofile.ActiveRuleParamDto; @@ -206,6 +208,7 @@ public class MyBatis implements Startable { confBuilder.loadAlias("PrIssue", PrIssueDto.class); confBuilder.loadAlias("ProjectQgateAssociation", ProjectQgateAssociationDto.class); confBuilder.loadAlias("Project", ProjectDto.class); + confBuilder.loadAlias("ProjectBadgeToken", ProjectBadgeTokenDto.class); confBuilder.loadAlias("ProjectCountPerAnalysisPropertyValue", ProjectCountPerAnalysisPropertyValue.class); confBuilder.loadAlias("ProjectMapping", ProjectMappingDto.class); confBuilder.loadAlias("PurgeableAnalysis", PurgeableAnalysisDto.class); @@ -271,6 +274,7 @@ public class MyBatis implements Startable { ProjectAlmSettingMapper.class, ProjectLinkMapper.class, ProjectMapper.class, + ProjectBadgeTokenMapper.class, ProjectExportMapper.class, ProjectMappingsMapper.class, ProjectQgateAssociationMapper.class, diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditPersister.java b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditPersister.java index 60987dbf424..ac41ffe6e36 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditPersister.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/AuditPersister.java @@ -21,15 +21,16 @@ package org.sonar.db.audit; import org.sonar.core.extension.PlatformLevel; import org.sonar.db.DbSession; +import org.sonar.db.audit.model.AbstractEditorNewValue; import org.sonar.db.audit.model.ComponentKeyNewValue; import org.sonar.db.audit.model.ComponentNewValue; import org.sonar.db.audit.model.DevOpsPlatformSettingNewValue; -import org.sonar.db.audit.model.AbstractEditorNewValue; import org.sonar.db.audit.model.GroupPermissionNewValue; import org.sonar.db.audit.model.LicenseNewValue; import org.sonar.db.audit.model.PermissionTemplateNewValue; import org.sonar.db.audit.model.PersonalAccessTokenNewValue; import org.sonar.db.audit.model.PluginNewValue; +import org.sonar.db.audit.model.ProjectBadgeTokenNewValue; import org.sonar.db.audit.model.PropertyNewValue; import org.sonar.db.audit.model.SecretNewValue; import org.sonar.db.audit.model.UserGroupNewValue; @@ -71,6 +72,8 @@ public interface AuditPersister { void addUserToken(DbSession dbSession, UserTokenNewValue newValue); + void addProjectBadgeToken(DbSession dbSession, ProjectBadgeTokenNewValue newValue); + void updateUserToken(DbSession dbSession, UserTokenNewValue newValue); void deleteUserToken(DbSession dbSession, UserTokenNewValue newValue); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/NoOpAuditPersister.java b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/NoOpAuditPersister.java index 2de7874e9f8..1923b0cca13 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/NoOpAuditPersister.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/NoOpAuditPersister.java @@ -29,6 +29,7 @@ import org.sonar.db.audit.model.LicenseNewValue; import org.sonar.db.audit.model.PermissionTemplateNewValue; import org.sonar.db.audit.model.PersonalAccessTokenNewValue; import org.sonar.db.audit.model.PluginNewValue; +import org.sonar.db.audit.model.ProjectBadgeTokenNewValue; import org.sonar.db.audit.model.PropertyNewValue; import org.sonar.db.audit.model.SecretNewValue; import org.sonar.db.audit.model.UserGroupNewValue; @@ -114,6 +115,11 @@ public class NoOpAuditPersister implements AuditPersister { } @Override + public void addProjectBadgeToken(DbSession dbSession, ProjectBadgeTokenNewValue newValue) { + // no op + } + + @Override public void updateUserToken(DbSession dbSession, UserTokenNewValue newValue) { // no op } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/ProjectBadgeTokenNewValue.java b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/ProjectBadgeTokenNewValue.java new file mode 100644 index 00000000000..9d53395b7a7 --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/audit/model/ProjectBadgeTokenNewValue.java @@ -0,0 +1,43 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.audit.model; + +public class ProjectBadgeTokenNewValue extends NewValue { + + private final String projectKey; + private final String userUuid; + private final String userLogin; + + public ProjectBadgeTokenNewValue(String projectKey, String userUuid, String userLogin) { + this.projectKey = projectKey; + this.userUuid = userUuid; + this.userLogin = userLogin; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("{"); + addField(sb, "\"projectKey\": ", this.projectKey, true); + addField(sb, "\"userUuid\": ", this.userUuid, true); + addField(sb, "\"userLogin\": ", this.userLogin, true); + endString(sb); + return sb.toString(); + } +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDao.java new file mode 100644 index 00000000000..8c9758f1845 --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDao.java @@ -0,0 +1,61 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.project; + +import javax.annotation.CheckForNull; +import org.sonar.api.utils.System2; +import org.sonar.core.util.UuidFactory; +import org.sonar.db.Dao; +import org.sonar.db.DbSession; +import org.sonar.db.audit.AuditPersister; +import org.sonar.db.audit.model.ProjectBadgeTokenNewValue; + +public class ProjectBadgeTokenDao implements Dao { + private final System2 system2; + private final AuditPersister auditPersister; + private final UuidFactory uuidFactory; + + public ProjectBadgeTokenDao(System2 system2, AuditPersister auditPersister, UuidFactory uuidFactory) { + this.system2 = system2; + this.auditPersister = auditPersister; + this.uuidFactory = uuidFactory; + } + + public ProjectBadgeTokenDto insert(DbSession session, String token, ProjectDto projectDto, + String userUuid, String userLogin) { + ProjectBadgeTokenDto projectBadgeTokenDto = new ProjectBadgeTokenDto(uuidFactory.create(), token, + projectDto.getUuid(), system2.now(), system2.now()); + + auditPersister.addProjectBadgeToken(session, new ProjectBadgeTokenNewValue(projectDto.getKey(), userUuid, userLogin)); + + mapper(session).insert(projectBadgeTokenDto); + return projectBadgeTokenDto; + } + + private static ProjectBadgeTokenMapper mapper(DbSession session) { + return session.getMapper(ProjectBadgeTokenMapper.class); + } + + @CheckForNull + public ProjectBadgeTokenDto selectTokenByProject(DbSession session, ProjectDto projectDto) { + return mapper(session).selectTokenByProjectUuid(projectDto.getUuid()); + + } +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDto.java new file mode 100644 index 00000000000..1611ab037c4 --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenDto.java @@ -0,0 +1,86 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.project; + +public class ProjectBadgeTokenDto { + + private String uuid; + private String token; + private String projectUuid; + private long createdAt; + private long updatedAt; + + public ProjectBadgeTokenDto() { + // to keep for mybatis + } + + public ProjectBadgeTokenDto(String uuid, String token, String projectUuid, long createdAt, long updatedAt) { + this.uuid = uuid; + this.token = token; + this.projectUuid = projectUuid; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + } + + public String getUuid() { + return uuid; + } + + public ProjectBadgeTokenDto setUuid(String uuid) { + this.uuid = uuid; + return this; + } + + public String getToken() { + return token; + } + + public ProjectBadgeTokenDto setToken(String token) { + this.token = token; + return this; + } + + public String getProjectUuid() { + return projectUuid; + } + + public ProjectBadgeTokenDto setProjectUuid(String projectUuid) { + this.projectUuid = projectUuid; + return this; + } + + public long getCreatedAt() { + return createdAt; + } + + public ProjectBadgeTokenDto setCreatedAt(long createdAt) { + this.createdAt = createdAt; + return this; + } + + public long getUpdatedAt() { + return updatedAt; + } + + public ProjectBadgeTokenDto setUpdatedAt(long updatedAt) { + this.updatedAt = updatedAt; + return this; + } +} diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenMapper.java b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenMapper.java new file mode 100644 index 00000000000..3f8cda7408c --- /dev/null +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/project/ProjectBadgeTokenMapper.java @@ -0,0 +1,31 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.project; + +import javax.annotation.CheckForNull; +import org.apache.ibatis.annotations.Param; + +public interface ProjectBadgeTokenMapper { + + void insert(ProjectBadgeTokenDto projectBadgeTokenDto); + + @CheckForNull + ProjectBadgeTokenDto selectTokenByProjectUuid(@Param("projectUuid") String projectUuid); +} diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectBadgeTokenMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectBadgeTokenMapper.xml new file mode 100644 index 00000000000..59967a17741 --- /dev/null +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/project/ProjectBadgeTokenMapper.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd"> +<mapper namespace="org.sonar.db.project.ProjectBadgeTokenMapper"> + + <sql id="projectBadgeTokenColumns"> + p.uuid as uuid, + p.token as token, + p.project_uuid as projectUuid, + p.created_at as createdAt, + p.updated_at as updatedAt + </sql> + + <insert id="insert" parameterType="ProjectBadgeToken"> + INSERT INTO project_badge_token ( + uuid, + token, + project_uuid, + created_at, + updated_at + ) + VALUES ( + #{uuid,jdbcType=VARCHAR}, + #{token,jdbcType=VARCHAR}, + #{projectUuid,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT} + ) + </insert> + + <select id="selectTokenByProjectUuid" parameterType="String" resultType="ProjectBadgeToken"> + select + <include refid="projectBadgeTokenColumns"/> + from project_badge_token p + where + p.project_uuid = #{projectUuid,jdbcType=VARCHAR} + </select> + +</mapper> diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectBadgeTokenDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectBadgeTokenDaoTest.java new file mode 100644 index 00000000000..6f99c2cdb13 --- /dev/null +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/project/ProjectBadgeTokenDaoTest.java @@ -0,0 +1,92 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.db.project; + +import javax.annotation.Nullable; +import org.assertj.core.api.Assertions; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.ArgumentCaptor; +import org.sonar.api.impl.utils.TestSystem2; +import org.sonar.api.utils.System2; +import org.sonar.core.util.UuidFactory; +import org.sonar.db.DbTester; +import org.sonar.db.audit.AuditPersister; +import org.sonar.db.audit.model.ProjectBadgeTokenNewValue; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +public class ProjectBadgeTokenDaoTest { + + private final System2 system2 = new TestSystem2().setNow(1000L); + + @Rule + public DbTester db = DbTester.create(system2); + + private final AuditPersister auditPersister = spy(AuditPersister.class); + private final UuidFactory uuidFactory = mock(UuidFactory.class); + + private final ProjectBadgeTokenDao projectBadgeTokenDao = new ProjectBadgeTokenDao(system2, auditPersister, uuidFactory); + + + @Test + public void should_insert_and_select_by_project_uuid() { + when(uuidFactory.create()).thenReturn("generated_uuid_1"); + ProjectDto projectDto = new ProjectDto().setUuid("project_uuid_1"); + + ProjectBadgeTokenDto insertedProjectBadgeToken = projectBadgeTokenDao.insert(db.getSession(), "token", projectDto, "userUuid", "userLogin"); + assertProjectBadgeToken(insertedProjectBadgeToken); + + ProjectBadgeTokenDto selectedProjectBadgeToken = projectBadgeTokenDao.selectTokenByProject(db.getSession(), projectDto); + assertProjectBadgeToken(selectedProjectBadgeToken); + } + + @Test + public void token_insertion_is_log_in_audit() { + when(uuidFactory.create()).thenReturn("generated_uuid_1"); + ProjectDto projectDto = new ProjectDto().setUuid("project_uuid_1"); + + ProjectBadgeTokenDto insertedProjectBadgeToken = projectBadgeTokenDao.insert(db.getSession(), "token", projectDto, "user-uuid", "user-login"); + assertProjectBadgeToken(insertedProjectBadgeToken); + + ArgumentCaptor<ProjectBadgeTokenNewValue> captor = ArgumentCaptor.forClass(ProjectBadgeTokenNewValue.class); + + verify(auditPersister).addProjectBadgeToken(eq(db.getSession()), captor.capture()); + verifyNoMoreInteractions(auditPersister); + + Assertions.assertThat(captor.getValue()).hasToString("{\"userUuid\": \"user-uuid\", \"userLogin\": \"user-login\" }"); + } + + private void assertProjectBadgeToken(@Nullable ProjectBadgeTokenDto projectBadgeTokenDto) { + assertThat(projectBadgeTokenDto).isNotNull(); + assertThat(projectBadgeTokenDto.getToken()).isEqualTo("token"); + assertThat(projectBadgeTokenDto.getProjectUuid()).isEqualTo("project_uuid_1"); + assertThat(projectBadgeTokenDto.getUuid()).isEqualTo("generated_uuid_1"); + assertThat(projectBadgeTokenDto.getCreatedAt()).isEqualTo(1000L); + assertThat(projectBadgeTokenDto.getCreatedAt()).isEqualTo(1000L); + } + +} |