added WrongServiceTypeException
This commit is contained in:
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.vaessl.app.dto.ConnectionRequest;
|
||||
import com.vaessl.app.dto.ConnectionResponse;
|
||||
import com.vaessl.app.exception.WrongServiceTypeException;
|
||||
|
||||
@Service
|
||||
public class ConnectionService {
|
||||
@@ -26,6 +27,10 @@ public class ConnectionService {
|
||||
|
||||
ConnectionProvider provider = providerRegistry.get(request.serviceType());
|
||||
|
||||
if (provider == null) {
|
||||
throw new WrongServiceTypeException();
|
||||
}
|
||||
|
||||
provider.checkCredentials(request);
|
||||
|
||||
ConnectionResponse response = provider.authenticate(request);
|
||||
|
||||
Reference in New Issue
Block a user