package net.nemerosa.ontrack.boot.ui;

import net.nemerosa.ontrack.boot.resource.Resource;
import net.nemerosa.ontrack.it.AbstractITTestSupport;
import net.nemerosa.ontrack.model.structure.NameDescription;
import net.nemerosa.ontrack.model.structure.Project;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class UIStructureTest extends AbstractITTestSupport {

    @Autowired
    private UIStructure structure;

    @Test
    public void createProject() {
        NameDescription nameDescription = nameDescription();
        Resource<Project> resource = structure.newProject(nameDescription);
        assertNotNull("Resource not null", resource);
        Project project = resource.getData();
        assertNotNull("Project not null", project);
        assertNotNull("Project ID defined", project.getId());
        assertEquals("Project name", nameDescription.getName(), project.getName());
        assertEquals("Project description", nameDescription.getDescription(), project.getDescription());
    }

}

@@ -374,66 +374,9 @@
 ert.
-assertEquals;%0Aimport static org.junit.Assert.assertNotNull
+*
 ;%0A%0Ap
@@ -858,15 +858,71 @@
  ID 
-defined
+not null%22, project.getId());%0A        assertTrue(%22Project ID set
 %22, p
@@ -927,32 +927,40 @@
  project.getId()
+.isSet()
 );%0A        asser

Test for projects