Skip to content

Commit

Permalink
fix endorsement test
Browse files Browse the repository at this point in the history
  • Loading branch information
bhtibrewal committed May 5, 2024
1 parent 4b9ba65 commit 7ada796
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 6 additions & 0 deletions skill-tree/skill-tree.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="f8bc8917-36fa-4978-8139-92d76bd84646" />
</component>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@Repository
public interface EndorsementRepository extends JpaRepository<EndorsementModel, UUID> {
List<EndorsementModel> findByUserId(UUID userId);
List<EndorsementModel> findByEndorserId(UUID userId);

List<EndorsementModel> findBySkillId(UUID skillId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.RDS.skilltree.Exceptions.NoEntityException;
import com.RDS.skilltree.Skill.SkillModel;
import com.RDS.skilltree.Skill.SkillRepository;
import com.RDS.skilltree.User.UserRepository;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.persistence.EntityNotFoundException;
Expand All @@ -26,7 +25,6 @@
@RequiredArgsConstructor
public class EndorsementServiceImpl implements EndorsementService {
private final EndorsementRepository endorsementRepository;
private final UserRepository userRepository;
private final SkillRepository skillRepository;

private final ObjectMapper objectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.RDS.skilltree.utils;

import jakarta.persistence.Column;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.MappedSuperclass;
import java.time.Instant;
import java.util.UUID;
Expand All @@ -11,12 +9,11 @@
@Data
@MappedSuperclass
public abstract class TrackedProperties {
@ManyToOne
@JoinColumn(name = "created_by")

@Column(name = "created_by")
private UUID createdBy;

@ManyToOne
@JoinColumn(name = "updated_by")
@Column(name = "updated_by")
private UUID updatedBy;

@Column(name = "created_at")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void testAPIReturns201_OnEndorsementCreation() {
.then()
.statusCode(201)
.contentType("application/json")
.body("data.user.firstName", equalTo("John"))
.body("data.endorserId", equalTo(endorserId.toString()))
.body("data.skill.name", equalTo("Java"));
}

Expand Down

0 comments on commit 7ada796

Please sign in to comment.