profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/cwansart/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Christian Wansart cwansart @id-berlin Bielefeld, Germany Doint stuff with Jakarta EE, MicroProfile, Spring Boot, Angular and Python.

cwansart/gitbackup 1

My personal vimrc and vim folder.

cwansart/Ambience 0

Your music in minecraft

cwansart/arquillian-jacoco-test 0

A test project for demonstrating failing JaCoCo code coverage for blackbox tests with Arquillian.

cwansart/ArsMagica2 0

Ars Magica 2 Bug Tracker

cwansart/AssemblerFun 0

Little assembler programs I write for learning purposes.

PullRequestReviewEvent

Pull request review commentnilshartmann96/todo-app

ELAB-476 Erster Unit Test für den TodoService

+package org.acme.nilshartmann.todo.domain;++import io.quarkus.test.junit.QuarkusTest;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++import javax.inject.Inject;+import java.time.LocalDateTime;+import java.time.Month;+import java.util.List;++import static org.junit.jupiter.api.Assertions.assertEquals;++@QuarkusTest+public class TodoServiceTest {++    @Inject+    TodoService todoService;++    @Test+    @DisplayName("Check if todo list is returned as expected.")+    void correctTodosReturned() {+        List<Todo> todos = createTodosForComparison();+        assertEquals(todos, todoService.getAllTodos());+    }++    private List<Todo> createTodosForComparison() {+        Todo todoObject1 = new Todo();+        todoObject1.setTitle("Unit Tests schreiben");

Für sowas bietet sich im übrigen ein Builder an. :-)

nilshartmann96

comment created time in a month

PullRequestReviewEvent

Pull request review commentnilshartmann96/todo-app

ELAB-476 Erster Unit Test für den TodoService

+package org.acme.nilshartmann.todo.domain;++import io.quarkus.test.junit.QuarkusTest;+import org.junit.jupiter.api.DisplayName;+import org.junit.jupiter.api.Test;++import javax.inject.Inject;+import java.time.LocalDateTime;+import java.time.Month;+import java.util.List;++import static org.junit.jupiter.api.Assertions.assertEquals;++@QuarkusTest+public class TodoServiceTest {++    @Inject+    TodoService todoService;++    @Test+    @DisplayName("Check if todo list is returned as expected.")+    void correctTodosReturned() {+        List<Todo> todos = createTodosForComparison();+        assertEquals(todos, todoService.getAllTodos());+    }++    private List<Todo> createTodosForComparison() {

Gut gelöst!

nilshartmann96

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentnilshartmann96/todo-app

ELAB-476 Route "/todo" gibt alle To-Dos zurück, die im Service manuel…

+package org.acme.nilshartmann.todo.domain.todo;++import javax.enterprise.context.ApplicationScoped;+import java.time.LocalDateTime;+import java.time.Month;+import java.util.ArrayList;+import java.util.List;++@ApplicationScoped+public class TodoService {++    public List<Todo> getAllTodos() {+        Todo todoObject1 = new Todo();

Wobei an der Stelle kannst du es auch direkt mit @OnStartup oder im Konstruktor machen. So würde bei jedem Aufruf die Objekte enu aufgerufen werden.

nilshartmann96

comment created time in a month

PullRequestReviewEvent

Pull request review commentnilshartmann96/todo-app

ELAB-476 Route "/todo" gibt alle To-Dos zurück, die im Service manuel…

+package org.acme.nilshartmann.todo.application;++import org.acme.nilshartmann.todo.domain.todo.TodoService;++import javax.inject.Inject;+import javax.ws.rs.GET;+import javax.ws.rs.Path;+import javax.ws.rs.Produces;+import javax.ws.rs.core.MediaType;+import javax.ws.rs.core.Response;++@Path("/todo")+public class TodoResource {++    @Inject+    TodoService todoService;++    @GET+    @Produces(MediaType.APPLICATION_JSON)

Wenn alle deine Methoden JSON zurückgeben, dann kannst du die Annotation auch an die Klasse packen.

nilshartmann96

comment created time in a month

Pull request review commentnilshartmann96/todo-app

ELAB-476 Route "/todo" gibt alle To-Dos zurück, die im Service manuel…

+package org.acme.nilshartmann.todo.domain.todo;++import java.io.Serializable;+import java.time.LocalDateTime;++public class Todo implements Serializable {++    enum Status {

Gute Idee!

nilshartmann96

comment created time in a month

Pull request review commentnilshartmann96/todo-app

ELAB-476 Route "/todo" gibt alle To-Dos zurück, die im Service manuel…

+package org.acme.nilshartmann.todo.domain.todo;++import javax.enterprise.context.ApplicationScoped;+import java.time.LocalDateTime;+import java.time.Month;+import java.util.ArrayList;+import java.util.List;++@ApplicationScoped+public class TodoService {++    public List<Todo> getAllTodos() {+        Todo todoObject1 = new Todo();

Das Erzeugen der Test-Objekte bitte auslagern. Versuche den "Given"-Teil deiner Tests klein zu halten. Du wirst die To-Dos eventuell noch an anderer Stelle brauchen. Hier reicht es aber vielleicht aus, wenn du dir im Test eine Hilfsfunktion schreibst.

nilshartmann96

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentnilshartmann96/todo-app

ELAB-475 Initialer Commit mit richtiger Ordnerstruktur und Benennung …

 import io.quarkus.test.junit.NativeImageTest;  @NativeImageTest-public class NativeGreetingResourceIT extends GreetingResourceTest {+public class NativeTodoResourceIT extends TodoResourceIT {

Datei enthält keine Tests, kann daher weg.

nilshartmann96

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

push eventcwansart/testcontainers-playground

Christian Wansart

commit sha a773ded41227edca2f716dc48981147f6fd067f8

Update azure-pipelines.yml for Azure Pipelines

view details

push time in 2 months

push eventcwansart/testcontainers-playground

Christian Wansart

commit sha c0f24433472500c3be583813ba9e4761c4af9c99

Set up CI with Azure Pipelines [skip ci]

view details

push time in 2 months

startedhenrypp/simplewall

started time in 3 months

startedoracle/helidon

started time in 3 months