// Path: command-side-project/src/main/java/com/idugalic/commandside/project/command/CreateProjectCommand.java
// public class CreateProjectCommand extends AuditableAbstractCommand {
// 
//     @TargetAggregateIdentifier
//     private String id;
//     @NotNull(message = "Name is mandatory")
//     @NotBlank(message = "Name is mandatory")
//     private String name;
//     @NotNull(message = "Repo Url is mandatory")
//     @NotBlank(message = "Repo Url is mandatory")
//     private String repoUrl;
//     private String siteUrl;
//     private String category;
//     private String description;
// 
//     public CreateProjectCommand(AuditEntry auditEntry, String name, String repoUrl, String siteUrl, String category, String description) {
//         super(auditEntry);
//         this.id = UUID.randomUUID().toString();
//         this.name = name;
//         this.repoUrl = repoUrl;
//         this.siteUrl = siteUrl;
//         this.category = category;
//         this.description = description;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getRepoUrl() {
//         return repoUrl;
//     }
// 
//     public String getSiteUrl() {
//         return siteUrl;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
// }
// 
// Path: command-side-project/src/main/java/com/idugalic/commandside/project/command/UpdateProjectCommand.java
// public class UpdateProjectCommand extends AuditableAbstractCommand {
// 
//     @TargetAggregateIdentifier
//     private String id;
//     @NotNull(message = "Name is mandatory")
//     @NotBlank(message = "Name is mandatory")
//     private String name;
//     @NotNull(message = "Repo Url is mandatory")
//     @NotBlank(message = "Repo Url is mandatory")
//     private String repoUrl;
//     private String siteUrl;
//     private String description;
// 
//     public UpdateProjectCommand(String id, AuditEntry auditEntry, String name, String repoUrl, String siteUrl, String description) {
//         super(auditEntry);
//         this.id = id;
//         this.name = name;
//         this.repoUrl = repoUrl;
//         this.siteUrl = siteUrl;
//         this.description = description;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getRepoUrl() {
//         return repoUrl;
//     }
// 
//     public String getSiteUrl() {
//         return siteUrl;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
// }


import com.idugalic.commandside.project.command.CreateProjectCommand;
import com.idugalic.commandside.project.command.UpdateProjectCommand;
import com.idugalic.common.model.AuditEntry;
import com.idugalic.common.project.event.ProjectCreatedEvent;
import com.idugalic.common.project.event.ProjectUpdatedEvent;
import org.axonframework.messaging.interceptors.BeanValidationInterceptor;
import org.axonframework.messaging.interceptors.JSR303ViolationException;
import org.axonframework.test.aggregate.AggregateTestFixture;
import org.axonframework.test.aggregate.FixtureConfiguration;
import org.junit.Before;
import org.junit.Test;
package com.idugalic.commandside.project.aggregate;



/**
 * Domain (aggregate) test for {@link ProjectAggregate}.
 * 
 * @author idugalic
 *
 */
public class BlogPostAggregateTest {

    private FixtureConfiguration<ProjectAggregate> fixture;
    private AuditEntry auditEntry;
    private static final String WHO = "idugalic";

    @Before
    public void setUp() throws Exception {
        fixture = new AggregateTestFixture<ProjectAggregate>(ProjectAggregate.class);
        fixture.registerCommandDispatchInterceptor(new BeanValidationInterceptor());
        auditEntry = new AuditEntry(WHO);
    }

    @Test
    public void createBlogPostTest() throws Exception {
        CreateProjectCommand command = new CreateProjectCommand(auditEntry, "name", "repoURL", "siteURL", "category", "description");
        fixture.given().when(command).expectEvents(new ProjectCreatedEvent(command.getId(), auditEntry, "name", "repoURL", "siteURL", "category", "description"));
    }
    
    @Test(expected = JSR303ViolationException.class)
    public void createBlogPostWithWrongNameTest() throws Exception {
// Path: command-side-project/src/main/java/com/idugalic/commandside/project/command/CreateProjectCommand.java
// public class CreateProjectCommand extends AuditableAbstractCommand {
// 
//     @TargetAggregateIdentifier
//     private String id;
//     @NotNull(message = "Name is mandatory")
//     @NotBlank(message = "Name is mandatory")
//     private String name;
//     @NotNull(message = "Repo Url is mandatory")
//     @NotBlank(message = "Repo Url is mandatory")
//     private String repoUrl;
//     private String siteUrl;
//     private String category;
//     private String description;
// 
//     public CreateProjectCommand(AuditEntry auditEntry, String name, String repoUrl, String siteUrl, String category, String description) {
//         super(auditEntry);
//         this.id = UUID.randomUUID().toString();
//         this.name = name;
//         this.repoUrl = repoUrl;
//         this.siteUrl = siteUrl;
//         this.category = category;
//         this.description = description;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getRepoUrl() {
//         return repoUrl;
//     }
// 
//     public String getSiteUrl() {
//         return siteUrl;
//     }
// 
//     public String getCategory() {
//         return category;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
// }
// 
// Path: command-side-project/src/main/java/com/idugalic/commandside/project/command/UpdateProjectCommand.java
// public class UpdateProjectCommand extends AuditableAbstractCommand {
// 
//     @TargetAggregateIdentifier
//     private String id;
//     @NotNull(message = "Name is mandatory")
//     @NotBlank(message = "Name is mandatory")
//     private String name;
//     @NotNull(message = "Repo Url is mandatory")
//     @NotBlank(message = "Repo Url is mandatory")
//     private String repoUrl;
//     private String siteUrl;
//     private String description;
// 
//     public UpdateProjectCommand(String id, AuditEntry auditEntry, String name, String repoUrl, String siteUrl, String description) {
//         super(auditEntry);
//         this.id = id;
//         this.name = name;
//         this.repoUrl = repoUrl;
//         this.siteUrl = siteUrl;
//         this.description = description;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public String getRepoUrl() {
//         return repoUrl;
//     }
// 
//     public String getSiteUrl() {
//         return siteUrl;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
// }


// Path: monolithic/src/test/java/com/idugalic/commandside/project/aggregate/BlogPostAggregateTest.java
import com.idugalic.commandside.project.command.CreateProjectCommand;
import com.idugalic.commandside.project.command.UpdateProjectCommand;
import com.idugalic.common.model.AuditEntry;
import com.idugalic.common.project.event.ProjectCreatedEvent;
import com.idugalic.common.project.event.ProjectUpdatedEvent;
import org.axonframework.messaging.interceptors.BeanValidationInterceptor;
import org.axonframework.messaging.interceptors.JSR303ViolationException;
import org.axonframework.test.aggregate.AggregateTestFixture;
import org.axonframework.test.aggregate.FixtureConfiguration;
import org.junit.Before;
import org.junit.Test;

package com.idugalic.commandside.project.aggregate;



/**
 * Domain (aggregate) test for {@link ProjectAggregate}.
 * 
 * @author idugalic
 *
 */
public class BlogPostAggregateTest {

    private FixtureConfiguration<ProjectAggregate> fixture;
    private AuditEntry auditEntry;
    private static final String WHO = "idugalic";

    @Before
    public void setUp() throws Exception {
        fixture = new AggregateTestFixture<ProjectAggregate>(ProjectAggregate.class);
        fixture.registerCommandDispatchInterceptor(new BeanValidationInterceptor());
        auditEntry = new AuditEntry(WHO);
    }

    @Test
    public void createBlogPostTest() throws Exception {
        CreateProjectCommand command = new CreateProjectCommand(auditEntry, "name", "repoURL", "siteURL", "category", "description");
        fixture.given().when(command).expectEvents(new ProjectCreatedEvent(command.getId(), auditEntry, "name", "repoURL", "siteURL", "category", "description"));
    }
    
    @Test(expected = JSR303ViolationException.class)
    public void createBlogPostWithWrongNameTest() throws Exception {
        CreateProjectCommand command = new CreateProjectCommand(auditEntry, null, "repoURL", "siteURL", "category", "description");