@Test(expected = ResourceNotFoundException.class) public void shouldThrowResourceNotFoundExceptionOnInvokeFindOneNull() throws Exception { when(invoker.invokeFindOne(id)).thenReturn(null); mappingManager.merge(contentType, inputMessage, invoker, id, dtoParam); }
public DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id, String dtoParam) { DtoInformation dtoInfo = getDtoInformation(dtoParam); Object dto = convertToDto(contentType, inputMessage, dtoInfo.getDtoType()); Object existingObject = invoker.invokeFindOne(id); if (existingObject == null) { throw new ResourceNotFoundException(); } handle(dto, existingObject); mapperDelegator.merge(dto, existingObject); return new DtoAndEntityWrapper(dto, existingObject); }
MappingManager { public DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id, String dtoParam) { DtoInformation dtoInfo = getDtoInformation(dtoParam); Object dto = convertToDto(contentType, inputMessage, dtoInfo.getDtoType()); Object existingObject = invoker.invokeFindOne(id); if (existingObject == null) { throw new ResourceNotFoundException(); } handle(dto, existingObject); mapperDelegator.merge(dto, existingObject); return new DtoAndEntityWrapper(dto, existingObject); } }
MappingManager { public DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id, String dtoParam) { DtoInformation dtoInfo = getDtoInformation(dtoParam); Object dto = convertToDto(contentType, inputMessage, dtoInfo.getDtoType()); Object existingObject = invoker.invokeFindOne(id); if (existingObject == null) { throw new ResourceNotFoundException(); } handle(dto, existingObject); mapperDelegator.merge(dto, existingObject); return new DtoAndEntityWrapper(dto, existingObject); } MappingManager(@NonNull MapperDelegator mapperDelegator, @NonNull List<HttpMessageConverter<?>> messageConverters,
            @NonNull DtoInformationRegistry dtoInfoRegistry); }
MappingManager { public DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id, String dtoParam) { DtoInformation dtoInfo = getDtoInformation(dtoParam); Object dto = convertToDto(contentType, inputMessage, dtoInfo.getDtoType()); Object existingObject = invoker.invokeFindOne(id); if (existingObject == null) { throw new ResourceNotFoundException(); } handle(dto, existingObject); mapperDelegator.merge(dto, existingObject); return new DtoAndEntityWrapper(dto, existingObject); } MappingManager(@NonNull MapperDelegator mapperDelegator, @NonNull List<HttpMessageConverter<?>> messageConverters,
            @NonNull DtoInformationRegistry dtoInfoRegistry); DtoAndEntityWrapper create(MediaType contentType, HttpInputMessage inputMessage, String dtoParam); DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id,
            String dtoParam); void addHandler(BeforeCreateMappingHandler handler); void addHandler(BeforeUpdateMappingHandler handler); void addHandler(BeforeCreateMappingHandler handler, int index ); void addHandler(BeforeUpdateMappingHandler handler, int index); }
MappingManager { public DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id, String dtoParam) { DtoInformation dtoInfo = getDtoInformation(dtoParam); Object dto = convertToDto(contentType, inputMessage, dtoInfo.getDtoType()); Object existingObject = invoker.invokeFindOne(id); if (existingObject == null) { throw new ResourceNotFoundException(); } handle(dto, existingObject); mapperDelegator.merge(dto, existingObject); return new DtoAndEntityWrapper(dto, existingObject); } MappingManager(@NonNull MapperDelegator mapperDelegator, @NonNull List<HttpMessageConverter<?>> messageConverters,
            @NonNull DtoInformationRegistry dtoInfoRegistry); DtoAndEntityWrapper create(MediaType contentType, HttpInputMessage inputMessage, String dtoParam); DtoAndEntityWrapper merge(MediaType contentType, HttpInputMessage inputMessage, RepositoryInvoker invoker, Serializable id,
            String dtoParam); void addHandler(BeforeCreateMappingHandler handler); void addHandler(BeforeUpdateMappingHandler handler); void addHandler(BeforeCreateMappingHandler handler, int index ); void addHandler(BeforeUpdateMappingHandler handler, int index);  }