Make real Test for BO only
This commit is contained in:
28
src/main/java/fr/eni/demo/bll/ClientServiceImpl.java
Normal file
28
src/main/java/fr/eni/demo/bll/ClientServiceImpl.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package fr.eni.demo.bll;
|
||||
|
||||
import fr.eni.demo.bo.Client;
|
||||
import fr.eni.demo.dal.ClientRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
public class ClientServiceImpl implements ClientService {
|
||||
|
||||
private ClientRepository clientRepository;
|
||||
|
||||
public ClientServiceImpl(ClientRepository clientRepository) {
|
||||
this.clientRepository = clientRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Client client) {
|
||||
clientRepository.save(client);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Client> findById(Long clientId) {
|
||||
return clientRepository.findById(clientId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user