Skip to content

Automation tests — CRUD reactors #2798

Description

@stelbailey

What

Integration tests for the automation definition CRUD reactors. Fully synchronous — no async considerations. These are the simplest automation tests and should be written first.

Depends on

#2797 (AutomationTestUtils)

Files to create

test/prerna/testing/automation/
  CreateAutomationReactorTests.java
  GetAutomationReactorTests.java
  ListAutomationsReactorTests.java
  DeleteAutomationReactorTests.java

Test cases

CreateAutomationReactorTests

  • testCreateAutomationSucceeds — valid name + project → returns automationId, name, createdAt
  • testCreateAutomationMissingNameThrows — null/empty name → error
  • testCreateAutomationMissingProjectThrows — null projectId → error
  • testCreateAutomationDuplicateNameSucceeds — same name twice in same project is allowed (names aren't unique keys)

GetAutomationReactorTests

  • testGetAutomationReturnsCorrectFields — create then get, verify all fields match
  • testGetAutomationUnknownIdThrows — random UUID → error
  • testGetAutomationReturnsSavedGraph — create with a graph definition, verify graph round-trips correctly

ListAutomationsReactorTests

  • testListAutomationsEmptyForNewProject — fresh project → empty list
  • testListAutomationsReturnsAllForProject — create 3, list → returns 3
  • testListAutomationsIsScopedToProject — create in two different projects, list each → no cross-contamination

DeleteAutomationReactorTests

  • testDeleteAutomationSucceeds — create then delete → subsequent get throws
  • testDeleteAutomationUnknownIdThrows — random UUID → error

Pattern

Extend AbstractBaseSemossApiTests. Use AutomationTestUtils for all reactor calls. Use ApiSemossTestEngineUtils.createBasicEngine() if a project/engine is needed as a prerequisite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions