Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions react-frontend/src/__test__/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
javascript
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from '../App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});

// Additional test to check if the component renders without crashing
test('renders App component without crashing', () => {
const { container } = render(<App />);
expect(container).toBeTruthy();
});
47 changes: 16 additions & 31 deletions spring-backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
cloudinary.api-key=******
cloudinary.api-secret=*****
cloudinary.cloud-name=******
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.password=1
spring.datasource.url=jdbc:mysql://localhost:3306/hobbie_backend_db?allowPublicKeyRetrieval=true&useSSL=false&createDatabaseIfNotExist=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Paris
# Database configuration
spring.datasource.url=jdbc:mysql://localhost:3306/hobbydb
spring.datasource.username=root
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto=create
spring.jpa.hibernate.use-new-id-generator-mappings=false
spring.jpa.open-in-view=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.mvc.hiddenmethod.enabled=true
spring.rsocket.server.port=8080
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=10MB
spring.servlet.multipart.max-request-size=10MB
spring.mail.host=smtp.gmail.com
spring.mail.port=25
spring.mail.username=*****
spring.mail.password=*****
spring.mail.protocol=smtp
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.default-encoding=UTF-8
springdoc.swagger-ui.config-url=/v3/api-docs/swagger-config
springdoc.swagger-ui.url=/v3/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.display-request-duration=true
springdoc.swagger-ui.groups-order=DESC
springdoc.swagger-ui.operationsSorter=method
springdoc.swagger-ui.disable-swagger-default-url=true
jwt.secret=secretly123
spring.datasource.password=rootpassword
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# Hibernate configuration
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

# Server configuration
server.port=8080

# Security configuration
spring.security.jwt.secret=mysecretkey
spring.security.jwt.expiration=3600000
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
java
package com.example.demo;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;

@SpringBootTest
@AutoConfigureMockMvc
public class SomeControllerTest {

@Autowired
private MockMvc mockMvc;

@Test
public void shouldReturnDefaultMessage() throws Exception {
this.mockMvc.perform(get("/api/default"))
.andExpect(status().isOk())
.andExpect(result -> assertThat(result.getResponse().getContentAsString()).contains("Hello, World!"));
}
}