Skip to content

Task organizer application, backend Spring and frontend Angular

Notifications You must be signed in to change notification settings

orestwojtowicz/task-organizer-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Task Organizer SpringBoot + Angular 8

versionjava versionSpring versionAngular mavenVersion

Endpoints

Creating notes

Search note

Send feedback

Tests

Application has unit test for backend part and also frontend.

Sample test for NoteService. This test is checking that data are converter correctly from Entity to ViewModel


    @Test
    void convertEntityToViewModel() {
        // given
        Note singleNote = new Note();
        when(noteRepository.findById(1L)).thenReturn(Optional.of(singleNote));

        var returnView = modelMapper.map(note, NoteViewModel.class);

        assertEquals(note.getText(), returnView.getText());
        assertEquals(note.getTitle(), returnView.getTitle());
        assertEquals(note.getLastModif(), returnView.getLastModif());
        // when
        Optional<Note> foundNote = noteRepository.findById(1L);
        assertThat(foundNote.get()).isNotNull();
        // then
        verify(noteRepository).findById(1L);
        verify(noteRepository).findById(anyLong());
    }
    

Sample test for Angular service, for creating new note


 it ('should create new note ', () => {
    noteService.saveNote(
      {id: '3', text: 'new text', title: 'new title', notebookId: '2', lastModif: new Date()}
    ).subscribe((data: any) => {
      expect(data.id).toBe('3');
      expect(data.title).toBe('new title');
    });
    let req = httpMock.expectOne(noteService.POST_NEW_NOTE_URL);
    expect(req.request.method).toBe("POST");
    httpMock.verify();
  });
  

Getting Started

To launch application, you need to download project and have JRE installed. Use your terminal, go into task-organizer, use command java -jar target/demo-task-organizer.jars It will start whole application on http://www.localhost:8080
mavenVersion

Database

Application is using h2 in memory database, you can check it under
localhost:8080/h2-console
JDBC URL - jdbc:h2:mem:damian
User Name: damian

About

Task organizer application, backend Spring and frontend Angular

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages