-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from ConductionNL/development
Update main with job test run and job log fixes
- Loading branch information
Showing
5 changed files
with
113 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
namespace OCA\OpenConnector\Controller; | ||
|
||
use GuzzleHttp\Exception\GuzzleException; | ||
use OCA\OpenConnector\Service\ObjectService; | ||
use OCA\OpenConnector\Service\SearchService; | ||
use OCA\OpenConnector\Service\SynchronizationService; | ||
|
@@ -15,6 +16,8 @@ | |
use OCP\IRequest; | ||
use Exception; | ||
use OCP\AppFramework\Db\DoesNotExistException; | ||
use Psr\Container\ContainerExceptionInterface; | ||
use Psr\Container\NotFoundExceptionInterface; | ||
|
||
class SynchronizationsController extends Controller | ||
{ | ||
|
@@ -213,33 +216,36 @@ public function logs(int $id): JSONResponse | |
} | ||
} | ||
|
||
/** | ||
* Tests a synchronization | ||
* | ||
* This method tests a synchronization without persisting anything to the database. | ||
* | ||
* @NoAdminRequired | ||
* @NoCSRFRequired | ||
* | ||
* @param int $id The ID of the synchronization | ||
* | ||
* @return JSONResponse A JSON response containing the test results | ||
* | ||
* @example | ||
* Request: | ||
* empty POST | ||
* | ||
* Response: | ||
* { | ||
* "resultObject": { | ||
* "fullName": "John Doe", | ||
* "userAge": 30, | ||
* "contactEmail": "[email protected]" | ||
* }, | ||
* "isValid": true, | ||
* "validationErrors": [] | ||
* } | ||
*/ | ||
/** | ||
* Tests a synchronization | ||
* | ||
* This method tests a synchronization without persisting anything to the database. | ||
* | ||
* @NoAdminRequired | ||
* @NoCSRFRequired | ||
* | ||
* @param int $id The ID of the synchronization | ||
* | ||
* @return JSONResponse A JSON response containing the test results | ||
* @throws GuzzleException | ||
* @throws ContainerExceptionInterface | ||
* @throws NotFoundExceptionInterface | ||
* | ||
* @example | ||
* Request: | ||
* empty POST | ||
* | ||
* Response: | ||
* { | ||
* "resultObject": { | ||
* "fullName": "John Doe", | ||
* "userAge": 30, | ||
* "contactEmail": "[email protected]" | ||
* }, | ||
* "isValid": true, | ||
* "validationErrors": [] | ||
* } | ||
*/ | ||
public function test(int $id): JSONResponse | ||
{ | ||
try { | ||
|
@@ -263,4 +269,4 @@ public function test(int $id): JSONResponse | |
|
||
return new JSONResponse($resultFromTest, 200); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters