Search in sources :

Example 1 with PhysicalSpecDefinitionService

use of org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionService in project waltz by khartec.

the class PhysicalSpecDefinitionHarness method main.

public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    PhysicalSpecDefinitionService definitionService = ctx.getBean(PhysicalSpecDefinitionService.class);
    PhysicalSpecDefinitionFieldService fieldService = ctx.getBean(PhysicalSpecDefinitionFieldService.class);
    PhysicalSpecDefinitionSampleFileService sampleFileService = ctx.getBean(PhysicalSpecDefinitionSampleFileService.class);
    long specId = 1;
    String userName = "admin";
    long defId = definitionService.create(userName, specId, ImmutablePhysicalSpecDefinitionChangeCommand.builder().version("1.0").status(ReleaseLifecycleStatus.DRAFT).delimiter(",").type(PhysicalSpecDefinitionType.DELIMITED).build());
    System.out.println(definitionService.findForSpecification(specId));
    long field1Id = fieldService.create(userName, defId, ImmutablePhysicalSpecDefinitionFieldChangeCommand.builder().name("Field1").description("First field").position(1).type(FieldDataType.STRING).build());
    System.out.println(fieldService.findForSpecDefinition(defId));
    sampleFileService.create(defId, ImmutablePhysicalSpecDefinitionSampleFileCreateCommand.builder().name("SampleFile_1.txt").fileData("1,2,3\n4,5,6\n7,8,9").build());
    System.out.println(sampleFileService.findForSpecDefinition(defId));
    // definitionService.delete(userName, defId);
    definitionService.updateStatus(userName, defId, ImmutableReleaseLifecycleStatusChangeCommand.builder().newStatus(ReleaseLifecycleStatus.ACTIVE).build());
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) PhysicalSpecDefinitionFieldService(org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionFieldService) PhysicalSpecDefinitionSampleFileService(org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionSampleFileService) PhysicalSpecDefinitionService(org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionService)

Aggregations

PhysicalSpecDefinitionFieldService (org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionFieldService)1 PhysicalSpecDefinitionSampleFileService (org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionSampleFileService)1 PhysicalSpecDefinitionService (org.finos.waltz.service.physical_specification_definition.PhysicalSpecDefinitionService)1 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)1