All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.beanmapper.spring.web.mockmvc.MockEntityConverter Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package io.beanmapper.spring.web.mockmvc;

import org.springframework.core.convert.converter.Converter;
import org.springframework.data.domain.Persistable;
import org.springframework.data.repository.CrudRepository;

public class MockEntityConverter implements Converter {

    private final CrudRepository repository;

    public MockEntityConverter(CrudRepository respository) {
        this.repository = respository;
    }

    @Override
    public T convert(String id) {
        return repository.findOne(Long.valueOf(id));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy