package org.onap.cps.spi.repository;
-
import java.util.Optional;
import javax.validation.constraints.NotNull;
-import org.onap.cps.exceptions.CpsNotFoundException;
+import org.onap.cps.exceptions.DataspaceNotFoundException;
import org.onap.cps.spi.entities.Dataspace;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
default Dataspace getByName(@NotNull String name) {
return findByName(name).orElseThrow(
- () -> new CpsNotFoundException("Not Found", "Dataspace " + name + " does not exist."));
+ () -> new DataspaceNotFoundException("Dataspace " + name + " does not exist."));
}
}
\ No newline at end of file