This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ourbusinessproject; | |
| import jakarta.transaction.Transactional; | |
| import jakarta.validation.ConstraintViolationException; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Test; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.test.context.SpringBootTest; | |
| import static org.junit.jupiter.api.Assertions.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ourbusinessproject; | |
| import jakarta.persistence.EntityManager; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.Test; | |
| import org.junit.jupiter.api.extension.ExtendWith; | |
| import org.mockito.Mock; | |
| import org.mockito.MockitoAnnotations; | |
| import org.mockito.junit.jupiter.MockitoExtension; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ourbusinessproject; | |
| import jakarta.validation.Validation; | |
| import jakarta.validation.Validator; | |
| import jakarta.validation.ValidatorFactory; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Test; | |
| import static org.junit.jupiter.api.Assertions.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ourbusinessproject; | |
| import jakarta.validation.Validation; | |
| import jakarta.validation.Validator; | |
| import jakarta.validation.ValidatorFactory; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Test; | |
| import static org.junit.jupiter.api.Assertions.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ourbusinessproject; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.test.context.SpringBootTest; | |
| import org.springframework.boot.test.web.client.TestRestTemplate; | |
| import org.springframework.test.context.junit4.SpringRunner; | |
| import static org.hamcrest.CoreMatchers.containsString; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- | |
| -- add an activity | |
| -- | |
| CREATE OR REPLACE FUNCTION add_activity(in_title varchar(500),in_description text, in_owner_id bigint default null) RETURNS activity AS $$ | |
| DECLARE | |
| default_owner "user"%rowtype; | |
| activity_id bigint; | |
| activity_res activity%rowtype; | |
| BEGIN | |
| if in_owner_id is null then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package myactivities.myactivities.controller; | |
| import myactivities.myactivities.model.Activity; | |
| import myactivities.myactivities.model.ActivityDAOService; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Controller; | |
| import org.springframework.ui.Model; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package myactivities.myactivities.model; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.test.context.SpringBootTest; | |
| import org.springframework.test.context.junit4.SpringRunner; | |
| import org.springframework.transaction.annotation.Transactional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package myactivities.myactivities.model; | |
| import org.apache.ibatis.annotations.*; | |
| import org.apache.ibatis.mapping.StatementType; | |
| import org.springframework.stereotype.Service; | |
| import java.util.List; | |
| import java.util.Map; | |
| @Mapper @Service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package myactivities.myactivities.model; | |
| import java.util.Date; | |
| public class Activity { | |
| private Long id; | |
| private String title; | |
| private String description; | |
| private Date creationDate; |