Search in sources :

Example 1 with OperationField

use of uk.gov.gchq.gaffer.rest.model.OperationField in project Gaffer by gchq.

the class OperationControllerTest method shouldReturnOptionsAndSummariesForEnumFields.

@Test
public void shouldReturnOptionsAndSummariesForEnumFields() throws Exception {
    // Given
    when(store.getSupportedOperations()).thenReturn(Sets.newHashSet(GetElements.class));
    when(examplesFactory.generateExample(GetElements.class)).thenReturn(new GetElements());
    // When
    OperationDetail operationDetails = operationController.getOperationDetails(GetElements.class.getName());
    List<OperationField> operationFields = operationDetails.getFields();
    // Then
    final List<OperationField> fields = Arrays.asList(new OperationField("input", null, "java.lang.Object[]", null, false), new OperationField("view", null, "uk.gov.gchq.gaffer.data.elementdefinition.view.View", null, false), new OperationField("includeIncomingOutGoing", "Should the edges point towards, or away from your seeds", "java.lang.String", Sets.newHashSet("INCOMING", "EITHER", "OUTGOING"), false), new OperationField("seedMatching", "How should the seeds be matched?", "java.lang.String", Sets.newHashSet("RELATED", "EQUAL"), false), new OperationField("options", null, "java.util.Map<java.lang.String,java.lang.String>", null, false), new OperationField("directedType", "Is the Edge directed?", "java.lang.String", Sets.newHashSet("DIRECTED", "UNDIRECTED", "EITHER"), false), new OperationField("views", null, "java.util.List<uk.gov.gchq.gaffer.data.elementdefinition.view.View>", null, false));
    assertEquals(fields, operationFields);
}
Also used : OperationDetail(uk.gov.gchq.gaffer.rest.model.OperationDetail) OperationField(uk.gov.gchq.gaffer.rest.model.OperationField) GetElements(uk.gov.gchq.gaffer.operation.impl.get.GetElements) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 GetElements (uk.gov.gchq.gaffer.operation.impl.get.GetElements)1 OperationDetail (uk.gov.gchq.gaffer.rest.model.OperationDetail)1 OperationField (uk.gov.gchq.gaffer.rest.model.OperationField)1