test_class.declarator: CREATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP
test_class.modifier: private static final
test_class.original_string: private static final String CREATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP;
test_class.type: String
test_class.var_name: CREATION_TIME_STRING
test_class.declarator: CREATION_TIME = TestDateUtil.parseTimestamp(CREATION_TIME_STRING)
test_class.modifier: private static final
test_class.original_string: private static final Timestamp CREATION_TIME = TestDateUtil.parseTimestamp(CREATION_TIME_STRING);
test_class.type: Timestamp
test_class.var_name: CREATION_TIME
test_class.declarator: DESCRIPTION = "description"
test_class.modifier: private static final
test_class.original_string: private static final String DESCRIPTION = "description";
test_class.type: String
test_class.var_name: DESCRIPTION
test_class.declarator: ID = 1L
test_class.modifier: private static final
test_class.original_string: private static final Long ID = 1L;
test_class.type: Long
test_class.var_name: ID
test_class.declarator: MODIFICATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP
test_class.modifier: private static final
test_class.original_string: private static final String MODIFICATION_TIME_STRING = TestDateUtil.CURRENT_TIMESTAMP;
test_class.type: String
test_class.var_name: MODIFICATION_TIME_STRING
test_class.declarator: MODIFICATION_TIME = TestDateUtil.parseTimestamp(MODIFICATION_TIME_STRING)
test_class.modifier: private static final
test_class.original_string: private static final Timestamp MODIFICATION_TIME = TestDateUtil.parseTimestamp(MODIFICATION_TIME_STRING);
test_class.type: Timestamp
test_class.var_name: MODIFICATION_TIME
test_class.declarator: TITLE = "title"
test_class.modifier: private static final
test_class.original_string: private static final String TITLE = "title";
test_class.type: String
test_class.var_name: TITLE
test_class.declarator: repositoryMock
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TodoRepository repositoryMock;
test_class.type: TodoRepository
test_class.var_name: repositoryMock
test_class.declarator: service
test_class.modifier: private
test_class.original_string: private RepositoryTodoCrudService service;
test_class.type: RepositoryTodoCrudService
test_class.var_name: service
test_class.declarator: transformer
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private JTransfo transformer;
test_class.type: JTransfo
test_class.var_name: transformer
test_class.file: jooq-only/src/test/java/net/petrikainulainen/spring/jooq/todo/service/RepositoryTodoCrudServiceTest.java
test_class.identifier: RepositoryTodoCrudServiceTest
test_case.body: @Test
      public void add_NewTodoEntry_ShouldAddTodoEntryAndReturnAddedEntry() {
          TodoDTO newTodoEntry = new TodoDTOBuilder()
                  .description(DESCRIPTION)
                  .title(TITLE)
                  .build();
  
          Todo addedTodoEntry = Todo.getBuilder(TITLE)
                  .creationTime(CREATION_TIME)
                  .description(DESCRIPTION)
                  .id(ID)
                  .modificationTime(MODIFICATION_TIME)
                  .build();
  
          when(repositoryMock.add(isA(Todo.class))).thenReturn(addedTodoEntry);
  
          TodoDTO returnedTodoEntry = service.add(newTodoEntry);
  
          ArgumentCaptor<Todo> repositoryMethodArgument = ArgumentCaptor.forClass(Todo.class);
  
          verify(repositoryMock, times(1)).add(repositoryMethodArgument.capture());
          verifyNoMoreInteractions(repositoryMock);
  
          Todo repositoryMethodArgumentValue = repositoryMethodArgument.getValue();
  
          assertThatTodo(repositoryMethodArgumentValue)
                  .creationTimeIsNotSet()
                  .hasDescription(DESCRIPTION)
                  .hasNoId()
                  .hasTitle(TITLE)
                  .modificationTimeIsNotSet();
  
          assertThatTodoDTO(returnedTodoEntry)
                  .hasDescription(DESCRIPTION)
                  .hasId(ID)
                  .hasTitle(TITLE)
                  .wasCreatedAt(CREATION_TIME_STRING)
                  .wasModifiedAt(MODIFICATION_TIME_STRING);
      }
test_case.class_method_signature: RepositoryTodoCrudServiceTest.add_NewTodoEntry_ShouldAddTodoEntryAndReturnAddedEntry()
test_case.full_signature: @Test public void add_NewTodoEntry_ShouldAddTodoEntryAndReturnAddedEntry()
test_case.identifier: add_NewTodoEntry_ShouldAddTodoEntryAndReturnAddedEntry
test_case.invocations: build title description build modificationTime id description creationTime getBuilder thenReturn when add isA add forClass add verify times capture verifyNoMoreInteractions getValue modificationTimeIsNotSet hasTitle hasNoId hasDescription creationTimeIsNotSet assertThatTodo wasModifiedAt wasCreatedAt hasTitle hasId hasDescription assertThatTodoDTO
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void add_NewTodoEntry_ShouldAddTodoEntryAndReturnAddedEntry()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(RepositoryTodoCrudService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(RepositoryTodoCrudService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: repository
focal_class.modifier: private final
focal_class.original_string: private final TodoRepository repository;
focal_class.type: TodoRepository
focal_class.var_name: repository
focal_class.declarator: transformer
focal_class.modifier: private final
focal_class.original_string: private final JTransfo transformer;
focal_class.type: JTransfo
focal_class.var_name: transformer
focal_class.file: jooq-only/src/main/java/net/petrikainulainen/spring/jooq/todo/service/RepositoryTodoCrudService.java
focal_class.identifier: RepositoryTodoCrudService
focal_class.interfaces: implements TodoCrudService
focal_class.class_method_signature: RepositoryTodoCrudService.RepositoryTodoCrudService(TodoRepository repository, JTransfo transformer)
focal_class.full_signature: @Autowired public  RepositoryTodoCrudService(TodoRepository repository, JTransfo transformer)
focal_class.identifier: RepositoryTodoCrudService
focal_class.modifiers: @Autowired public
focal_class.parameters: (TodoRepository repository, JTransfo transformer)
focal_class.signature:  RepositoryTodoCrudService(TodoRepository repository, JTransfo transformer)
focal_class.class_method_signature: RepositoryTodoCrudService.add(TodoDTO dto)
focal_class.full_signature: @Transactional @Override public TodoDTO add(TodoDTO dto)
focal_class.identifier: add
focal_class.modifiers: @Transactional @Override public
focal_class.parameters: (TodoDTO dto)
focal_class.return: TodoDTO
focal_class.signature: TodoDTO add(TodoDTO dto)
focal_class.class_method_signature: RepositoryTodoCrudService.delete(Long id)
focal_class.full_signature: @Transactional @Override public TodoDTO delete(Long id)
focal_class.identifier: delete
focal_class.modifiers: @Transactional @Override public
focal_class.parameters: (Long id)
focal_class.return: TodoDTO
focal_class.signature: TodoDTO delete(Long id)
focal_class.class_method_signature: RepositoryTodoCrudService.findAll()
focal_class.full_signature: @Transactional(readOnly = true) @Override public List<TodoDTO> findAll()
focal_class.identifier: findAll
focal_class.modifiers: @Transactional(readOnly = true) @Override public
focal_class.parameters: ()
focal_class.return: List<TodoDTO>
focal_class.signature: List<TodoDTO> findAll()
focal_class.class_method_signature: RepositoryTodoCrudService.findById(Long id)
focal_class.full_signature: @Transactional(readOnly = true) @Override public TodoDTO findById(Long id)
focal_class.identifier: findById
focal_class.modifiers: @Transactional(readOnly = true) @Override public
focal_class.parameters: (Long id)
focal_class.return: TodoDTO
focal_class.signature: TodoDTO findById(Long id)
focal_class.class_method_signature: RepositoryTodoCrudService.update(TodoDTO dto)
focal_class.full_signature: @Transactional @Override public TodoDTO update(TodoDTO dto)
focal_class.identifier: update
focal_class.modifiers: @Transactional @Override public
focal_class.parameters: (TodoDTO dto)
focal_class.return: TodoDTO
focal_class.signature: TodoDTO update(TodoDTO dto)
focal_class.class_method_signature: RepositoryTodoCrudService.createModel(TodoDTO dto)
focal_class.full_signature: private Todo createModel(TodoDTO dto)
focal_class.identifier: createModel
focal_class.modifiers: private
focal_class.parameters: (TodoDTO dto)
focal_class.return: Todo
focal_class.signature: Todo createModel(TodoDTO dto)
focal_method.body: @Transactional
      @Override
      public TodoDTO add(TodoDTO dto) {
          LOGGER.info("Adding todo entry with information: {}", dto);
  
          Todo added = createModel(dto);
          Todo persisted = repository.add(added);
  
          LOGGER.info("Added todo entry with information: {}", persisted);
  
          return transformer.convert(persisted, new TodoDTO());
      }
focal_method.class_method_signature: RepositoryTodoCrudService.add(TodoDTO dto)
focal_method.full_signature: @Transactional @Override public TodoDTO add(TodoDTO dto)
focal_method.identifier: add
focal_method.invocations: info createModel add info convert
focal_method.modifiers: @Transactional @Override public
focal_method.parameters: (TodoDTO dto)
focal_method.return: TodoDTO
focal_method.signature: TodoDTO add(TodoDTO dto)