Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the dependency for test containers and logging format for console #49

Merged
merged 24 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
993bddc
Added the dependency for test containers and logging format for conso…
vikhyat187 Dec 2, 2023
e6e7a7a
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 3, 2023
79f7883
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 5, 2023
e23092a
Merge branch 'develop' of https://github.com/Real-Dev-Squad/skill-tre…
vikhyat187 Dec 7, 2023
fac304a
Added integration tests for /skills endpoint
vikhyat187 Dec 7, 2023
34377f2
Merge branch 'db-integration-test' of https://github.com/Real-Dev-Squ…
vikhyat187 Dec 7, 2023
77e3551
Fix: assert messages for integration tests
vikhyat187 Dec 7, 2023
79bdddd
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 9, 2023
de2962f
Used @ServiceConnection annotation for test contatiner connection con…
vikhyat187 Dec 9, 2023
690695c
Merge branch 'db-integration-test' of https://github.com/Real-Dev-Squ…
vikhyat187 Dec 9, 2023
1b77688
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 12, 2023
164e38f
Made the single test container run across multiple files
vikhyat187 Dec 12, 2023
e09dd7d
Merge branch 'develop' of https://github.com/Real-Dev-Squad/skill-tre…
vikhyat187 Dec 12, 2023
be626c3
Merge branch 'db-integration-test' of https://github.com/Real-Dev-Squ…
vikhyat187 Dec 12, 2023
8cfac2d
added mysql version 8.1 and fixed typo in the class name
vikhyat187 Dec 14, 2023
6f565e4
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 14, 2023
73131cf
added assertion on skillId and fix unit tests:
vikhyat187 Dec 16, 2023
d30cddf
Merge branch 'db-integration-test' of https://github.com/Real-Dev-Squ…
vikhyat187 Dec 16, 2023
b810e33
Update integration tests
vikhyat187 Dec 16, 2023
ddcc497
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 17, 2023
9978263
Migrate the Junit4 tests to Junit5, and excluded Junit4 dependency
vikhyat187 Dec 17, 2023
af7845d
Merge branch 'db-integration-test' of https://github.com/Real-Dev-Squ…
vikhyat187 Dec 17, 2023
a8dbcde
Resolving merge conflicts
vikhyat187 Dec 19, 2023
ce68b3e
Merge branch 'develop' into db-integration-test
vikhyat187 Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 114 additions & 80 deletions skill-tree /pom.xml
Original file line number Diff line number Diff line change
@@ -1,83 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.RDS</groupId>
<artifactId>skill-tree</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>skill-tree</name>
<description>skill tree project</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.5.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-xml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.RDS</groupId>
<artifactId>skill-tree</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>skill-tree</name>
<description>skill tree project</description>
<properties>
<java.version>17</java.version>
<testcontainers.version>1.17.6</testcontainers.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.5.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy-xml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
<version>3.2.0</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

</project>
</project>
13 changes: 8 additions & 5 deletions skill-tree /src/main/java/com/RDS/skilltree/Skill/SkillDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import lombok.Builder;
import lombok.Getter;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
Expand All @@ -27,11 +28,13 @@ public static SkillDTO toDto(SkillModel skillModel) {
}

public static SkillDTO getSkillsWithUsers(SkillModel skillModel) {
Set<UserDTO> users = skillModel.getUsers()
.stream()
.map(UserDTO::toDTO)
.collect(Collectors.toSet());

Set<UserDTO> users = new HashSet<>();
if (skillModel.getUsers() != null) {
users = skillModel.getUsers()
.stream()
.map(UserDTO::toDTO)
.collect(Collectors.toSet());
}
return SkillDTO.builder()
.id(skillModel.getId())
.name(skillModel.getName())
Expand Down
35 changes: 16 additions & 19 deletions skill-tree /src/main/java/com/RDS/skilltree/User/UserService.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
//package com.RDS.skilltree.User;
//
//
//import org.springframework.stereotype.Service;
//
//import java.util.List;
//import java.util.UUID;
//
//public interface UserService {
// UserDTO createUser(UserDRO user);
//
// void updateUser(UUID id,UserDRO user);
//
// UserDTO getUserById(UUID id);
//
// List<UserDTO> getAllUsers();
//
// void addSkill(UUID skill, UUID userId);
//}
package com.RDS.skilltree.User;

import java.util.List;
import java.util.UUID;

public interface UserService {
UserDTO createUser(UserDRO user);

void updateUser(UUID id,UserDRO user);

UserDTO getUserById(UUID id);

List<UserDTO> getAllUsers();

void addSkill(UUID skill, UUID userId);
}
Loading