diff --git a/API/Controllers/ProjectController.cs b/API/Controllers/ProjectController.cs index cabc0a22..5d319959 100644 --- a/API/Controllers/ProjectController.cs +++ b/API/Controllers/ProjectController.cs @@ -359,21 +359,46 @@ public async Task CreateProjectAsync([FromBody] ProjectResource p return BadRequest(problem); } - if(projectResource.CallToAction != null) + if(projectResource.CallToActions != null) { - IEnumerable callToActionOptions = - await callToActionOptionService.GetCallToActionOptionFromValueAsync( - projectResource.CallToAction.OptionValue); - if(!callToActionOptions.Any()) + if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue).Any(cta => cta.Count() > 1)) { ProblemDetails problem = new ProblemDetails { - Title = "Call to action value was not found.", - Detail = "The specified call to action value was not found while creating the project.", - Instance = "40EE82EB-930F-40C8-AE94-0041F7573FE9" + Title = "Duplicate call to action option value.", + Detail = "It is not possible to create a project with multiple of the same call to actions.", + Instance = "D2C8416A-9C55-408B-9468-F0E5C635F9B7" }; return BadRequest(problem); } + + if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) + { + ProblemDetails problem = new ProblemDetails + { + Title = $"Maximum amount of {projectResource.MaximumCallToActions} call to actions exceeded.", + Detail = $"It is not possible to create a project with more than {projectResource.MaximumCallToActions} call to actions.", + Instance = "E780005D-BBEB-423E-BA01-58145D3DBDF5" + }; + return BadRequest(problem); + } + foreach(CallToActionResource callToAction in projectResource.CallToActions) + { + IEnumerable callToActionOptions = + await callToActionOptionService.GetCallToActionOptionFromValueAsync( + callToAction.OptionValue); + if(!callToActionOptions.Any()) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Call to action value was not found.", + Detail = $"The call to action optionvalue: '{callToAction.OptionValue}' was not found while creating the project.", + Instance = "40EE82EB-930F-40C8-AE94-0041F7573FE9" + }; + return BadRequest(problem); + } + } + } Project project = mapper.Map(projectResource); @@ -526,21 +551,50 @@ public async Task UpdateProject(int projectId, [FromBody] Project return Unauthorized(problem); } - if(projectResource.CallToAction != null) + if(projectResource.CallToActions != null) { - IEnumerable callToActionOptions = - await callToActionOptionService.GetCallToActionOptionFromValueAsync( - projectResource.CallToAction.OptionValue); - if(!callToActionOptions.Any()) + if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue).Any(cta => cta.Count() > 1)) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Duplicate call to action option value.", + Detail = "It is not possible to create a project with multiple of the same call to actions.", + Instance = "D2C8416A-9C55-408B-9468-F0E5C635F9B7" + }; + return BadRequest(problem); + } + + if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) { ProblemDetails problem = new ProblemDetails { - Title = "Call to action value was not found.", - Detail = "The specified call to action value was not found while creating the project.", - Instance = "40EE82EB-930F-40C8-AE94-0041F7573FE9" + Title = $"Maximum amount of {projectResource.MaximumCallToActions} call to actions exceeded.", + Detail = + $"It is not possible to create a project with more than {projectResource.MaximumCallToActions} call to actions.", + Instance = "E780005D-BBEB-423E-BA01-58145D3DBDF5" }; return BadRequest(problem); } + + foreach(CallToActionResource callToAction in projectResource.CallToActions) + { + IEnumerable callToActionOptions = + await callToActionOptionService.GetCallToActionOptionFromValueAsync( + callToAction.OptionValue); + + if(!callToActionOptions.Any()) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Call to action value was not found.", + Detail = + $"The call to action optionvalue: '{callToAction.OptionValue}' was not found while creating the project.", + Instance = "40EE82EB-930F-40C8-AE94-0041F7573FE9" + }; + return BadRequest(problem); + } + } + } if (projectResource.InstitutePrivate != project.InstitutePrivate) diff --git a/API/Resources/ProjectResource.cs b/API/Resources/ProjectResource.cs index b6de1140..66b6c66f 100644 --- a/API/Resources/ProjectResource.cs +++ b/API/Resources/ProjectResource.cs @@ -59,7 +59,12 @@ public class ProjectResource /// /// This gets or sets the call to action /// - public CallToActionResource CallToAction { get; set; } + public List CallToActions { get; set; } + + /// + /// The maximum allowed call to actions per project. + /// + public int MaximumCallToActions { get { return 4; } } /// /// This gets or sets the institute private property diff --git a/API/Resources/ProjectResourceResult.cs b/API/Resources/ProjectResourceResult.cs index 09c51d47..9f6654c3 100644 --- a/API/Resources/ProjectResourceResult.cs +++ b/API/Resources/ProjectResourceResult.cs @@ -90,7 +90,7 @@ public class ProjectResourceResult /// /// This gets or sets the call to action. /// - public CallToActionResourceResult CallToAction { get; set; } + public List CallToActions { get; set; } /// /// This gets or sets the likes of the project. diff --git a/API/Resources/ProjectResultResource.cs b/API/Resources/ProjectResultResource.cs index 91e7bade..ede854e5 100644 --- a/API/Resources/ProjectResultResource.cs +++ b/API/Resources/ProjectResultResource.cs @@ -68,9 +68,9 @@ public class ProjectResultResource public FileResourceResult ProjectIcon { get; set; } /// - /// This gets or sets the call to action of the project. + /// This gets or sets the call to actions of the project. /// - public CallToActionResourceResult CallToAction { get; set; } + public List CallToActions { get; set; } /// /// This gets or sets the likes of the project. diff --git a/Data/Migrations/20210528120743_AddMultipleCallToActions.Designer.cs b/Data/Migrations/20210528120743_AddMultipleCallToActions.Designer.cs new file mode 100644 index 00000000..1966bd6f --- /dev/null +++ b/Data/Migrations/20210528120743_AddMultipleCallToActions.Designer.cs @@ -0,0 +1,736 @@ +// +using System; +using Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +namespace _4_Data.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20210528120743_AddMultipleCallToActions")] + partial class AddMultipleCallToActions + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.3") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Models.CallToAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("OptionValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.ToTable("CallToAction"); + }); + + modelBuilder.Entity("Models.CallToActionOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("CallToActionOption"); + }); + + modelBuilder.Entity("Models.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Category"); + }); + + modelBuilder.Entity("Models.Collaborator", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FullName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.Property("Role") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.ToTable("Collaborators"); + }); + + modelBuilder.Entity("Models.DataSource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Guid") + .HasColumnType("nvarchar(max)"); + + b.Property("IconId") + .HasColumnType("int"); + + b.Property("IsVisible") + .HasColumnType("bit"); + + b.Property("Title") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("IconId"); + + b.ToTable("DataSource"); + }); + + modelBuilder.Entity("Models.DataSourceWizardPage", b => + { + b.Property("DataSourceId") + .HasColumnType("int"); + + b.Property("WizardPageId") + .HasColumnType("int"); + + b.Property("AuthFlow") + .HasColumnType("bit"); + + b.Property("OrderIndex") + .HasColumnType("int"); + + b.HasKey("DataSourceId", "WizardPageId", "AuthFlow"); + + b.HasIndex("WizardPageId"); + + b.ToTable("DataSourceWizardPage"); + }); + + modelBuilder.Entity("Models.EmbeddedProject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.HasIndex("UserId"); + + b.ToTable("EmbeddedProject"); + }); + + modelBuilder.Entity("Models.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Path") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UploadDateTime") + .HasColumnType("datetime2"); + + b.Property("UploaderId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UploaderId"); + + b.ToTable("File"); + }); + + modelBuilder.Entity("Models.Highlight", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.HasIndex("ProjectId"); + + b.ToTable("Highlight"); + }); + + modelBuilder.Entity("Models.Institution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("IdentityId") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Institution"); + }); + + modelBuilder.Entity("Models.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Created") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("InstitutePrivate") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ProjectIconId") + .HasColumnType("int"); + + b.Property("ShortDescription") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Updated") + .HasColumnType("datetime2"); + + b.Property("Uri") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProjectIconId"); + + b.HasIndex("UserId"); + + b.ToTable("Project"); + }); + + modelBuilder.Entity("Models.ProjectCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CategoryId") + .HasColumnType("int"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("ProjectId"); + + b.ToTable("ProjectCategory"); + }); + + modelBuilder.Entity("Models.ProjectInstitution", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("InstitutionId") + .HasColumnType("int"); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("InstitutionId"); + + b.HasIndex("ProjectId"); + + b.ToTable("ProjectInstitution"); + }); + + modelBuilder.Entity("Models.ProjectLike", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("LikedProjectId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LikedProjectId"); + + b.HasIndex("UserId"); + + b.ToTable("ProjectLike"); + }); + + modelBuilder.Entity("Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Role"); + }); + + modelBuilder.Entity("Models.RoleScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("RoleId") + .HasColumnType("int"); + + b.Property("Scope") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleScope"); + }); + + modelBuilder.Entity("Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("AccountCreationDate") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ExpectedGraduationDate") + .HasColumnType("datetime2"); + + b.Property("IdentityId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("InstitutionId") + .HasColumnType("int"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ProfileUrl") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("InstitutionId"); + + b.HasIndex("RoleId"); + + b.ToTable("User"); + }); + + modelBuilder.Entity("Models.UserProject", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("ProjectId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.HasIndex("UserId"); + + b.ToTable("UserProject"); + }); + + modelBuilder.Entity("Models.UserTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserTask"); + }); + + modelBuilder.Entity("Models.UserUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("FollowedUserId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("FollowedUserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserUser"); + }); + + modelBuilder.Entity("Models.WizardPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedAt") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.ToTable("WizardPage"); + }); + + modelBuilder.Entity("Models.CallToAction", b => + { + b.HasOne("Models.Project", null) + .WithMany("CallToActions") + .HasForeignKey("ProjectId"); + }); + + modelBuilder.Entity("Models.Collaborator", b => + { + b.HasOne("Models.Project", null) + .WithMany("Collaborators") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.DataSource", b => + { + b.HasOne("Models.File", "Icon") + .WithMany() + .HasForeignKey("IconId"); + }); + + modelBuilder.Entity("Models.DataSourceWizardPage", b => + { + b.HasOne("Models.DataSource", "DataSource") + .WithMany("DataSourceWizardPages") + .HasForeignKey("DataSourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Models.WizardPage", "WizardPage") + .WithMany("DataSourceWizardPages") + .HasForeignKey("WizardPageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.EmbeddedProject", b => + { + b.HasOne("Models.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.File", b => + { + b.HasOne("Models.User", "Uploader") + .WithMany() + .HasForeignKey("UploaderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.Highlight", b => + { + b.HasOne("Models.File", "Image") + .WithMany() + .HasForeignKey("ImageId"); + + b.HasOne("Models.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.Project", b => + { + b.HasOne("Models.File", "ProjectIcon") + .WithMany() + .HasForeignKey("ProjectIconId"); + + b.HasOne("Models.User", "User") + .WithMany("Projects") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.ProjectCategory", b => + { + b.HasOne("Models.Category", "Category") + .WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Models.Project", "Project") + .WithMany("Categories") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.ProjectInstitution", b => + { + b.HasOne("Models.Institution", "Institution") + .WithMany() + .HasForeignKey("InstitutionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Models.Project", "Project") + .WithMany("LinkedInstitutions") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.ProjectLike", b => + { + b.HasOne("Models.Project", "LikedProject") + .WithMany("Likes") + .HasForeignKey("LikedProjectId"); + + b.HasOne("Models.User", "ProjectLiker") + .WithMany("LikedProjectsByUsers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.RoleScope", b => + { + b.HasOne("Models.Role", null) + .WithMany("Scopes") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.User", b => + { + b.HasOne("Models.Institution", "Institution") + .WithMany() + .HasForeignKey("InstitutionId"); + + b.HasOne("Models.Role", "Role") + .WithMany() + .HasForeignKey("RoleId"); + }); + + modelBuilder.Entity("Models.UserProject", b => + { + b.HasOne("Models.Project", "Project") + .WithMany() + .HasForeignKey("ProjectId"); + + b.HasOne("Models.User", "User") + .WithMany("UserProject") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Models.UserTask", b => + { + b.HasOne("Models.User", "User") + .WithMany("UserTasks") + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Models.UserUser", b => + { + b.HasOne("Models.User", "FollowedUser") + .WithMany("FollowedUsers") + .HasForeignKey("FollowedUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Data/Migrations/20210528120743_AddMultipleCallToActions.cs b/Data/Migrations/20210528120743_AddMultipleCallToActions.cs new file mode 100644 index 00000000..268f7d9e --- /dev/null +++ b/Data/Migrations/20210528120743_AddMultipleCallToActions.cs @@ -0,0 +1,74 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace _4_Data.Migrations +{ + public partial class AddMultipleCallToActions : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Project_CallToAction_CallToActionId", + table: "Project"); + + migrationBuilder.DropIndex( + name: "IX_Project_CallToActionId", + table: "Project"); + + migrationBuilder.DropColumn( + name: "CallToActionId", + table: "Project"); + + migrationBuilder.AddColumn( + name: "ProjectId", + table: "CallToAction", + nullable: false); + + migrationBuilder.CreateIndex( + name: "IX_CallToAction_ProjectId", + table: "CallToAction", + column: "ProjectId"); + + migrationBuilder.AddForeignKey( + name: "FK_CallToAction_Project_ProjectId", + table: "CallToAction", + column: "ProjectId", + principalTable: "Project", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_CallToAction_Project_ProjectId", + table: "CallToAction"); + + migrationBuilder.DropIndex( + name: "IX_CallToAction_ProjectId", + table: "CallToAction"); + + migrationBuilder.DropColumn( + name: "ProjectId", + table: "CallToAction"); + + migrationBuilder.AddColumn( + name: "CallToActionId", + table: "Project", + type: "int", + nullable: false); + + migrationBuilder.CreateIndex( + name: "IX_Project_CallToActionId", + table: "Project", + column: "CallToActionId"); + + migrationBuilder.AddForeignKey( + name: "FK_Project_CallToAction_CallToActionId", + table: "Project", + column: "CallToActionId", + principalTable: "CallToAction", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 749ddce9..690f5d6a 100644 --- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -30,12 +30,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired() .HasColumnType("nvarchar(max)"); + b.Property("ProjectId") + .HasColumnType("int"); + b.Property("Value") .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); + b.HasIndex("ProjectId"); + b.ToTable("CallToAction"); }); @@ -265,9 +270,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("CallToActionId") - .HasColumnType("int"); - b.Property("Created") .HasColumnType("datetime2"); @@ -300,8 +302,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CallToActionId"); - b.HasIndex("ProjectIconId"); b.HasIndex("UserId"); @@ -550,6 +550,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("WizardPage"); }); + modelBuilder.Entity("Models.CallToAction", b => + { + b.HasOne("Models.Project", null) + .WithMany("CallToActions") + .HasForeignKey("ProjectId"); + }); + modelBuilder.Entity("Models.Collaborator", b => { b.HasOne("Models.Project", null) @@ -624,10 +631,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Models.Project", b => { - b.HasOne("Models.CallToAction", "CallToAction") - .WithMany() - .HasForeignKey("CallToActionId"); - b.HasOne("Models.File", "ProjectIcon") .WithMany() .HasForeignKey("ProjectIconId"); diff --git a/Models/CallToAction.cs b/Models/CallToAction.cs index e35b8495..e7ce8ff9 100644 --- a/Models/CallToAction.cs +++ b/Models/CallToAction.cs @@ -45,6 +45,13 @@ public class CallToAction [Required] public string Value { get; set; } + /// + /// Gets or sets a value for the ProjectId property. + /// For example, this would be the projectId this call to action is linked to. + /// + [Required] + public int ProjectId { get; set; } + } } diff --git a/Models/Project.cs b/Models/Project.cs index 5a7d3cec..87878628 100644 --- a/Models/Project.cs +++ b/Models/Project.cs @@ -71,7 +71,7 @@ public Project() public File ProjectIcon { get; set; } - public CallToAction CallToAction { get; set; } + public List CallToActions { get; set; } [JsonIgnore] public List Likes { get; set; } diff --git a/Postman/dex.postman_collection.json b/Postman/dex.postman_collection.json index 019ccc33..e98cc184 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "a8f78afe-54ed-470b-a617-6463ece8190f", + "_postman_id": "00d940d8-47d9-4b73-b127-316844648687", "name": "DEV", "description": "Testing Digital Excellence API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -1978,7 +1978,7 @@ "response": [] }, { - "name": "Project-GetAllProjects-Administrator", + "name": "Project-CreateProject-OneCallToAction-Administrator", "event": [ { "listen": "test", @@ -1986,46 +1986,39 @@ "exec": [ "var projectName = pm.environment.get(\"projectName\");", "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.results.length; i++) {", - " if (jsonData.results[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", + "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId2\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", - "});" + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 1);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2033,6 +2026,15 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { "raw": "{{apiUrl}}/api/Project", "host": [ @@ -2047,49 +2049,46 @@ "response": [] }, { - "name": "Project-GetProject-Administrator", + "name": "Project-CreateProject-MultipleCallToActions-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var projectId = parseInt(pm.environment.get(\"projectId\"));", "var projectName = pm.environment.get(\"projectName\");", - "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", - "var adminUserName = pm.environment.get(\"adminUserName\");", "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId3\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"ProjectName is set correctly and matching: \" + projectName, function () {", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", - "});", - "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", - "});" + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 2);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2097,59 +2096,64 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction2-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Administrator", + "name": "Project-CreateProject-CallToActionValueInvalid-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", - "pm.environment.set(\"projectName\", projectName);", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", - "pm.test(\"Images are removed\", function () {", - " pm.expect(jsonData.projectIcon).to.eql(null);", - " pm.expect(jsonData.images.length).to.eql(0);", - "})" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2159,7 +2163,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"role\": \"postmantest_Project-UpdateProject-Administrator\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"projectIconId\": 0,\r\n \"imageIds\": []\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"postmantest_Project\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", "options": { "raw": { "language": "json" @@ -2167,57 +2171,54 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-GetUpdatedProject-Administrator", + "name": "Project-CreateProject-CallToActionLimitExceeded-Administrator", "event": [ { "listen": "test", "script": { "exec": [ "var projectName = pm.environment.get(\"projectName\");", - "var adminUserName = pm.environment.get(\"adminUserName\");", "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"ProjectName is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2225,47 +2226,64 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"role\": \"postmantest_Project-CreateProject-Administrator\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Provide feedback\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"More information\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Get in touch\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-GetProject-NonExisting-Administrator", + "name": "Project-CreateProject-CallToActionSameAction-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2273,114 +2291,156 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"role\": \"postmantest_Project-CreateProject-Administrator\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/98989", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "98989" + "Project" ] } }, "response": [] }, { - "name": "Project-LikeProject-Administrator", + "name": "Project-GetAllProjects-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", - "host": [ + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findProject(jsonData, name) {", + " for (var i = 0; i < jsonData.results.length; i++) {", + " if (jsonData.results[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project: \" + projectName + \" is in list\", function () {", + " foundAt = findProject(jsonData, projectName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project", + "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-Administrator", + "name": "Project-GetProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + "var projectId = parseInt(pm.environment.get(\"projectId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"ProjectName is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "like", "{{projectId}}" ] } @@ -2388,36 +2448,37 @@ "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Administrator", + "name": "Project-UpdateProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 404 and have the right error\", function () {\r", - " pm.response.to.have.status(404);\r", - " pm.expect(jsonData.detail).to.eql('The creator of the project send in the request is not bound to an institution and can therefore not make the project private.');\r", - " //This test must fail on this status, because its not really possible to add an institution to the administrator with how the tests are setup. Therefore the authentication works (which this test tests), but fails because the administrator doesn't have an institution which is fine because that isn't in the scope of this test.\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.notFound;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "var projectName = pm.environment.get(\"projectNameUpdated\");", + "pm.environment.set(\"projectName\", projectName);", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"Images are removed\", function () {", + " pm.expect(jsonData.projectIcon).to.eql(null);", + " pm.expect(jsonData.images.length).to.eql(0);", + "})" ], "type": "text/javascript" } @@ -2428,28 +2489,995 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "true\r\n", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-UpdateProject-Administrator\",\r\n \"role\": \"postmantest_Project-UpdateProject-Administrator\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"projectIconId\": 0,\r\n \"imageIds\": []\r\n}", "options": { "raw": { "language": "json" } } - }, + }, + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-GetUpdatedProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"ProjectName is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-GetProject-NonExisting-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/98989", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "98989" + ] + } + }, + "response": [] + }, + { + "name": "Project-LikeProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "like", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteLikeProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "like", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-MakeInstitutionPrivate-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 404 and have the right error\", function () {\r", + " pm.response.to.have.status(404);\r", + " pm.expect(jsonData.detail).to.eql('The creator of the project send in the request is not bound to an institution and can therefore not make the project private.');\r", + " //This test must fail on this status, because its not really possible to add an institution to the administrator with how the tests are setup. Therefore the authentication works (which this test tests), but fails because the administrator doesn't have an institution which is fine because that isn't in the scope of this test.\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.notFound;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "instituteprivate", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-MakeInstitutionPrivate-Other-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "var temporaryProjectId = pm.environment.get('temporaryProjectId');\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "instituteprivate", + "{{projectToMakePrivateId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-LinkInstitutionToProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "pm.test(\"The right institution and project were linked\", function(){\r", + " pm.expect(jsonData.projectId).to.eql(pm.environment.get(\"projectId\"));\r", + " pm.expect(jsonData.institutionId).to.eql(1);\r", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "linkedinstitution", + "{{projectId}}", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Project-UnlinkInstitution-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.ok\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "linkedinstitution", + "{{projectId}}", + "1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "FollowProject", + "item": [ + { + "name": "Project-FollowProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "var projectId = pm.environment.get(\"projectIdToFollow\");", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if created Username matches: \" + projectId, function () {", + " pm.expect(jsonData.id).to.eql(projectId);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "project", + "follow", + "{{projectIdToFollow}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-UnFollowProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "project", + "follow", + "{{projectIdToFollow}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "CategorizeProject", + "item": [ + { + "name": "Project-CategorizeProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-UncategorizeProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Highlight", + "item": [ + { + "name": "Highlight-CreateHighlight-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"highlightId\", jsonData.id);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_Highlight-CreateHighlight-Administrator\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Highlight", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-GetAllActiveHighlights-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var adminProjectId = pm.environment.get(\"adminProjectId\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findItem(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].projectId == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "function findHighlight(jsonData, idToFind){", + " for(var i = 0; i< jsonData.length; i++)", + " {", + " if(jsonData[i].project.id == idToFind) ", + " { ", + " return i; ", + " }", + " }", + " return -1;", + " ", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight is in list and matching: \" + adminProjectId, function () {", + " foundAt = findHighlight(jsonData, adminProjectId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-GetHighlight-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "{{highlightId}}" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-GetHighlight-ByProject-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var projectId = parseInt(pm.environment.get(\"projectId\"));", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findHighlightId(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "function findProjectId(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].project.id == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project is in list and matching: \" + projectId, function () {", + " foundAt = findProjectId(jsonData, projectId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Highlight is in list and matching:\" + highlightId, function () {", + " foundAt = findHighlightId(jsonData, highlightId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", + "Highlight", "Project", - "instituteprivate", "{{projectId}}" ] } @@ -2457,25 +3485,31 @@ "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-Administrator", + "name": "Highlight-UpdateHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "var temporaryProjectId = pm.environment.get('temporaryProjectId');\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var highlightStartDate = pm.environment.get(\"highlightStartDate\");", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -2485,7 +3519,8 @@ "listen": "prerequest", "script": { "exec": [ - "" + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" ], "type": "text/javascript" } @@ -2496,13 +3531,13 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "true\r\n", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_Highlight-UpdateHighlight-Administrator\"\r\n}", "options": { "raw": { "language": "json" @@ -2510,51 +3545,53 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectToMakePrivateId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Administrator", + "name": "Highlight-GetUpdatedHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 201\", function () {\r", - " pm.response.to.have.status(201);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "\r", - "pm.test(\"The right institution and project were linked\", function(){\r", - " pm.expect(jsonData.projectId).to.eql(pm.environment.get(\"projectId\"));\r", - " pm.expect(jsonData.institutionId).to.eql(1);\r", - "})" + "var highlightUpdateTimestamp = pm.environment.get(\"current_timestamp\");", + "var highlightEndDate = pm.environment.get(\"highlightEndDate\");", + "var highlightId = pm.environment.get(\"highlightId\");", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -2563,37 +3600,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-Administrator", + "name": "Highlight-GetHighlight-NonExisting-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.ok\r", - "});\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", "" ], "type": "text/javascript" @@ -2601,25 +3640,23 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Highlight/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Highlight", + "98989" ] } }, @@ -2628,22 +3665,24 @@ ] }, { - "name": "FollowProject", + "name": "Embed", "item": [ { - "name": "Project-FollowProject-Administrator", + "name": "Embed-CreateEmbed-Administrator", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", - "var projectId = pm.environment.get(\"projectIdToFollow\");", + "", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", @@ -2651,10 +3690,7 @@ " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "pm.test(\"Check if created Username matches: \" + projectId, function () {", - " pm.expect(jsonData.id).to.eql(projectId);", - "});" + "" ], "type": "text/javascript" } @@ -2671,7 +3707,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -2679,103 +3715,63 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-Administrator", + "name": "Embed-GetAllEmbeds-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var embedGuid = pm.environment.get(\"embedGuid\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findItem(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].guid == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "project", - "follow", - "{{projectIdToFollow}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ - { - "name": "Project-CategorizeProject-Administrator", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Embed is in list and matches: \" + embedGuid, function () {", + " foundAt = findItem(jsonData, embedGuid);", + " pm.expect(foundAt).to.not.eql(-1);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -2784,49 +3780,51 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Administrator", + "name": "Embed-GetEmbed-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -2835,72 +3833,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Administrator", + "name": "Embed-GetEmbed-NonExisting-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightId\", jsonData.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", - "" - ], - "type": "text/javascript" - } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -2908,78 +3881,41 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_Highlight-CreateHighlight-Administrator\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Embed/cdaadc49-b4b9-4c11-8937-e602174cba30", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Embed", + "cdaadc49-b4b9-4c11-8937-e602174cba30" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-Administrator", + "name": "Embed-GetEmbed-NonExisting-NoGUID-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var adminProjectId = pm.environment.get(\"adminProjectId\");", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findItem(jsonData, item) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "function findHighlight(jsonData, idToFind){", - " for(var i = 0; i< jsonData.length; i++)", - " {", - " if(jsonData[i].project.id == idToFind) ", - " { ", - " return i; ", - " }", - " }", - " return -1;", - " ", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.notFound;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "pm.test(\"Highlight is in list and matching: \" + adminProjectId, function () {", - " foundAt = findHighlight(jsonData, adminProjectId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});" + "" ], "type": "text/javascript" } @@ -2990,52 +3926,61 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Embed/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Embed", + "98989" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Role", + "item": [ { - "name": "Highlight-GetHighlight-Administrator", + "name": "Role-CreateRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "var scopeName = pm.environment.get(\"scopeName\");", + "var roleName = pm.environment.get(\"roleName\");", "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", - "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "pm.environment.set(\"roleId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + "pm.test(\"Role Name is set correctly and matching: \" + roleName, function () {", + " pm.expect(jsonData.name).to.eql(roleName);", + "});", + "", + "pm.test(\"Scope is correct and matching: \" + scopeName, function () {", + " pm.expect(jsonData.scopes.scope).to.eql(scopeName);", "});" ], "type": "text/javascript" @@ -3043,55 +3988,53 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role" ] - } + }, + "description": "Is deleted in the latest cleanup folder" }, "response": [] }, { - "name": "Highlight-GetHighlight-ByProject-Administrator", + "name": "Role-GetAllRoles-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var projectId = parseInt(pm.environment.get(\"projectId\"));", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "var roleName = pm.environment.get(\"roleName\");", "", "var jsonData = pm.response.json();", "", "var foundAt;", "", - "function findHighlightId(jsonData, item) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == item) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "function findProjectId(jsonData, item) {", + "function findProject(jsonData, name) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].project.id == item) {", + " if (jsonData[i].name == name) {", " return i;", " }", " }", @@ -3110,14 +4053,13 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project is in list and matching: \" + projectId, function () {", - " foundAt = findProjectId(jsonData, projectId);", + "pm.test(\"Role: \" + roleName + \" is in list\", function () {", + " foundAt = findProject(jsonData, roleName);", " pm.expect(foundAt).to.not.eql(-1);", "});", "", - "pm.test(\"Highlight is in list and matching:\" + highlightId, function () {", - " foundAt = findHighlightId(jsonData, highlightId);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Role Name is set correctly with matching: \" + roleName, function () {", + " pm.expect(jsonData[foundAt].name).to.eql(roleName);", "});" ], "type": "text/javascript" @@ -3134,32 +4076,41 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], - "path": [ - "api", - "Highlight", - "Project", - "{{projectId}}" + "path": [ + "api", + "Role" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Administrator", + "name": "Scope-GetAllScopes-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var highlightStartDate = pm.environment.get(\"highlightStartDate\");", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", "", + "var foundAt;", + "", + "function findProject(jsonData, name) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -3167,31 +4118,17 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" - ], - "type": "text/javascript" - } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -3199,39 +4136,30 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_Highlight-UpdateHighlight-Administrator\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "Highlight-GetUpdatedHighlight-Administrator", + "name": "Role-GetRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var highlightUpdateTimestamp = pm.environment.get(\"current_timestamp\");", - "var highlightEndDate = pm.environment.get(\"highlightEndDate\");", - "var highlightId = pm.environment.get(\"highlightId\");", + "var roleId = parseInt(pm.environment.get(\"roleId\"));", + "var roleName = pm.environment.get(\"roleName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", @@ -3246,8 +4174,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + "pm.test(\"Role Name is set correctly\", function () {", + " pm.expect(jsonData.name).to.eql(roleName);", "});" ], "type": "text/javascript" @@ -3259,52 +4187,57 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-NonExisting-Administrator", + "name": "Role-UpdateRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedRoleName = pm.environment.get(\"updatedRoleName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", - "" + "", + "pm.test(\"Role Name is set correctly\", function () {", + " pm.expect(jsonData.name).to.eql(updatedRoleName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -3312,56 +4245,62 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/98989", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "98989" + "Role", + "{{roleId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Embed", - "item": [ + }, { - "name": "Embed-CreateEmbed-Administrator", + "name": "Role-GetUpdatedRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var updatedRoleName = pm.environment.get(\"updatedRoleName\");", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", - "" + "", + "pm.test(\"Role Name is set correctly and matches: \" + updatedRoleName, function () {", + " pm.expect(jsonData.name).to.eql(updatedRoleName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -3369,50 +4308,31 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-Administrator", + "name": "Role-SetRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var embedGuid = pm.environment.get(\"embedGuid\");", + "var roleId = parseInt(pm.environment.get(\"roleId\"));", "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findItem(jsonData, item) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].guid == item) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -3420,14 +4340,13 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Embed is in list and matches: \" + embedGuid, function () {", - " foundAt = findItem(jsonData, embedGuid);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Role is set correctly and matches: \" + roleId, function () {", + " pm.expect(jsonData.role.id).to.eql(roleId);", "});" ], "type": "text/javascript" @@ -3435,7 +4354,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -3443,27 +4362,49 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Role/setRole?userId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Role", + "setRole" + ], + "query": [ + { + "key": "userId", + "value": "{{createdUserId}}", + "description": "Id of the user that we want to update" + }, + { + "key": "roleId", + "value": "{{roleId}}", + "description": "Id of the role that you want to update the user with" + } ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Administrator", + "name": "User-GetRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", + "var roleId = parseInt(pm.environment.get(\"roleId\"));", "", "var jsonData = pm.response.json();", "", @@ -3479,8 +4420,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", - " pm.expect(jsonData.id).to.eql(embeddedProjectId);", + "pm.test(\"Check if user has role that matches: \" + roleId, function () {", + " pm.expect(jsonData.role.id).to.eql(roleId);", "});" ], "type": "text/javascript" @@ -3497,21 +4438,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-NonExisting-Administrator", + "name": "Role-GetRole-NonExisting-Administrator", "event": [ { "listen": "test", @@ -3546,40 +4487,50 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/cdaadc49-b4b9-4c11-8937-e602174cba30", + "raw": "{{apiUrl}}/api/Role/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "cdaadc49-b4b9-4c11-8937-e602174cba30" + "Role", + "98989" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "Embed-GetEmbed-NonExisting-NoGUID-Administrator", + "name": "Search-SearchInternal-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[0].name).to.eql(projectName);", + "});" ], "type": "text/javascript" } @@ -3595,14 +4546,15 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/98989", + "raw": "{{apiUrl}}/api/Search/internal/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "98989" + "Search", + "internal", + "{{projectId}}" ] } }, @@ -3611,41 +4563,34 @@ ] }, { - "name": "Role", + "name": "Wizard", + "item": [] + }, + { + "name": "File", "item": [ { - "name": "Role-CreateRole-Administrator", + "name": "File-CreateFile-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var scopeName = pm.environment.get(\"scopeName\");", - "var roleName = pm.environment.get(\"roleName\");", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"roleId\", jsonData.id);", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Role Name is set correctly and matching: \" + roleName, function () {", - " pm.expect(jsonData.name).to.eql(roleName);", - "});", - "", - "pm.test(\"Scope is correct and matching: \" + scopeName, function () {", - " pm.expect(jsonData.scopes.scope).to.eql(scopeName);", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "pm.environment.set(\"adminFileId\", jsonData.id)\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.success;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "" ], "type": "text/javascript" } @@ -3656,74 +4601,48 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" } - } + ] }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "File" ] - }, - "description": "Is deleted in the latest cleanup folder" + } }, "response": [] }, { - "name": "Role-GetAllRoles-Administrator", + "name": "Files-GetAll-Adminstrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleName = pm.environment.get(\"roleName\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Role: \" + roleName + \" is in list\", function () {", - " foundAt = findProject(jsonData, roleName);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "", - "pm.test(\"Role Name is set correctly with matching: \" + roleName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(roleName);", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.success;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -3740,51 +4659,31 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "File" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-Administrator", + "name": "File-Delete-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var projectName = pm.environment.get(\"projectName\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.ok;\r", "});" ], "type": "text/javascript" @@ -3792,116 +4691,185 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/File/{{adminFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "File", + "{{adminFileId}}" ] } }, "response": [] }, { - "name": "Role-GetRole-Administrator", + "name": "File-CreateFile-MaxFileSize", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", - "var roleName = pm.environment.get(\"roleName\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Role Name is set correctly\", function () {", - " pm.expect(jsonData.name).to.eql(roleName);", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "pm.environment.set(\"adminFileId\", jsonData.id)\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.badRequest;\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage4MB.jpg" + } + ] + }, + "url": { + "raw": "{{apiUrl}}/api/File", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File" + ] + } + }, + "response": [] + }, + { + "name": "File-CreateFile-AllowedExtensions", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "pm.environment.set(\"adminFileId\", jsonData.id)\r", + "\r", + "pm.test(\"Status code is 400\", function () {\r", + " pm.response.to.have.status(400);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.badRequest;\r", + "});\r", + "\r", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testfile.txt" + } + ] + }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "File" ] } }, "response": [] - }, + } + ] + }, + { + "name": "CallToActionOption", + "item": [ { - "name": "Role-UpdateRole-Administrator", + "name": "CallToActionOption-CreateCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedRoleName = pm.environment.get(\"updatedRoleName\");", - "", "var jsonData = pm.response.json();", "", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "pm.test(\"Role Name is set correctly\", function () {", - " pm.expect(jsonData.name).to.eql(updatedRoleName);", - "});" + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -3911,7 +4879,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"type\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\",\r\n \"value\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\"\r\n}", "options": { "raw": { "language": "json" @@ -3919,30 +4887,40 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "CallToActionOption" ] } }, "response": [] }, { - "name": "Role-GetUpdatedRole-Administrator", + "name": "CallToActionOption-GetAllCallToActionOptions-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedRoleName = pm.environment.get(\"updatedRoleName\");", + "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", "", "var jsonData = pm.response.json();", "", + "var foundAt;", + "", + "function findOption(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -3950,14 +4928,16 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Role Name is set correctly and matches: \" + updatedRoleName, function () {", - " pm.expect(jsonData.name).to.eql(updatedRoleName);", - "});" + "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", + " foundAt = findOption(jsonData, optionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } @@ -3973,30 +4953,29 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "CallToActionOption" ] } }, "response": [] }, { - "name": "Role-SetRole-Administrator", + "name": "CallToActionOption-GetCallToActionOptionById-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", - "", "var jsonData = pm.response.json();", "", + "pm.environment.set(\"callToActionOptionType\", jsonData.type);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -4009,16 +4988,24 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Role is set correctly and matches: \" + roleId, function () {", - " pm.expect(jsonData.role.id).to.eql(roleId);", - "});" + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -4028,7 +5015,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Collaborate\"\r\n}", "options": { "raw": { "language": "json" @@ -4036,42 +5023,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/setRole?userId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "setRole" - ], - "query": [ - { - "key": "userId", - "value": "{{createdUserId}}", - "description": "Id of the user that we want to update" - }, - { - "key": "roleId", - "value": "{{roleId}}", - "description": "Id of the role that you want to update the user with" - } + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "User-GetRole-Administrator", + "name": "CallToActionOption-GetCallToActionOptionByType-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", + "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", "", "var jsonData = pm.response.json();", "", + "function findOptionType(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -4079,61 +5063,14 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if user has role that matches: \" + roleId, function () {", - " pm.expect(jsonData.role.id).to.eql(roleId);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "User", - "{{createdUserId}}" - ] - } - }, - "response": [] - }, - { - "name": "Role-GetRole-NonExisting-Administrator", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", "});", "" ], @@ -4151,32 +5088,30 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/98989", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "98989" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-Administrator", + "name": "CallToActionOption-UpdateCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var updatedCallToActionType = pm.environment.get(\"updatedCallToActionType\");", + "var updatedCallToActionValue = pm.environment.get(\"updatedCallToActionValue\");", + "pm.environment.set(\"callToActionOptionType\", updatedCallToActionType);", "", "var jsonData = pm.response.json();", "", @@ -4192,16 +5127,21 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[0].name).to.eql(projectName);", - "});" + "pm.test(\"Check if updated Call to action Type matches: \" + updatedCallToActionType, function () {", + " pm.expect(jsonData.type).to.eql(updatedCallToActionType);", + "});", + "", + "pm.test(\"Check if updated Call to action Value matches: \" + updatedCallToActionValue, function () {", + " pm.expect(jsonData.value).to.eql(updatedCallToActionValue);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -4209,16 +5149,24 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"type\": \"{{updatedCallToActionType}}\",\r\n \"value\": \"{{updatedCallToActionValue}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, @@ -4227,33 +5175,31 @@ ] }, { - "name": "Wizard", - "item": [] - }, - { - "name": "File", + "name": "WizardPage", "item": [ { - "name": "File-CreateFile-Administrator", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"adminFileId\", jsonData.id)\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.success;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "\r", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"wizardPageId\", jsonData.id);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "" ], "type": "text/javascript" @@ -4265,49 +5211,71 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "options": { + "raw": { + "language": "json" } - ] + } }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "WizardPage" ] } }, "response": [] }, { - "name": "Files-GetAll-Adminstrator", + "name": "WizardPage-GetAllWizardPages-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.success;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" + "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findOption(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", + " foundAt = findOption(jsonData, pageId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } @@ -4323,169 +5291,197 @@ } ], "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "WizardPage" ] } }, "response": [] }, { - "name": "File-Delete-Administrator", + "name": "WizardPage-GetWizardPageById-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.ok;\r", - "});" + "var jsonData = pm.response.json();", + "", + "var wizardPageId = pm.environment.get(\"wizardPageId\");", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", + " pm.expect(jsonData.id).to.eql(wizardPageId);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File/{{adminFileId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{adminFileId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "File-CreateFile-MaxFileSize", + "name": "WizardPage-UpdateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"adminFileId\", jsonData.id)\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.badRequest;\r", - "});\r", - "\r", - "" + "var wizardPageName = pm.environment.get(\"updatedWizardPageName\");", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if updated Wizard Page Name matches: \" + wizardPageName, function () {", + " pm.expect(jsonData.name).to.eql(wizardPageName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage4MB.jpg" + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "options": { + "raw": { + "language": "json" } - ] + } }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "File-CreateFile-AllowedExtensions", + "name": "WizardPage-GetUpdatedWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"adminFileId\", jsonData.id)\r", - "\r", - "pm.test(\"Status code is 400\", function () {\r", - " pm.response.to.have.status(400);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.badRequest;\r", - "});\r", - "\r", - "" + "var wizardPageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "var updatedWizardPageName = pm.environment.get(\"updatedWizardPageName\");", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if updated Wizard Page Id matches: \" + wizardPageId, function () {", + " pm.expect(jsonData.id).to.eql(wizardPageId);", + "});", + "", + "pm.test(\"Check if updated Wizard Page Name matches: \" + updatedWizardPageName, function () {", + " pm.expect(jsonData.name).to.eql(updatedWizardPageName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testfile.txt" - } - ] - }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "WizardPage", + "{{wizardPageId}}" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } ] } }, @@ -4494,10 +5490,10 @@ ] }, { - "name": "CallToActionOption", + "name": "DataSource", "item": [ { - "name": "CallToActionOption-CreateCallToActionOption-Administrator", + "name": "DataSource-GetAllDataSources-Administrator", "event": [ { "listen": "test", @@ -4505,26 +5501,21 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "pm.test(\"Retrieved data sources are not empty\", function () {", + " pm.expect(jsonData[0]).not.equal(null);", + " pm.environment.set(\"dataSourceId\", jsonData[0].guid);", "});", "" ], @@ -4533,7 +5524,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -4541,49 +5532,29 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"type\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\",\r\n \"value\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "DataSource" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-Administrator", + "name": "WizardPage-GetWizardPageById-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findOption(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", + "var dataSourceId = pm.environment.get(\"dataSourceId\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -4597,9 +5568,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", - " foundAt = findOption(jsonData, optionId);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", "});", "" ], @@ -4617,28 +5587,29 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-Administrator", + "name": "WizardPage-UpdateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var wizardPageName = pm.environment.get(\"updatedDataSourceName\");", "", - "pm.environment.set(\"callToActionOptionType\", jsonData.type);", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -4652,24 +5623,16 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", - "" + "pm.test(\"Check if updated Wizard Page Name matches: \" + wizardPageName, function () {", + " pm.expect(jsonData.title).to.eql(wizardPageName);", + "});" ], "type": "text/javascript" } } ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -4679,7 +5642,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Collaborate\"\r\n}", + "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", "options": { "raw": { "language": "json" @@ -4687,39 +5650,30 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-Administrator", + "name": "WizardPage-GetUpdatedWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var dataSourceId = pm.environment.get(\"dataSourceId\");", "", "var jsonData = pm.response.json();", "", - "function findOptionType(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -4727,14 +5681,66 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", - " foundAt = findOptionType(jsonData, callToActionOptionId);", - " pm.expect(foundAt).to.not.eql(-1);", + "", + "pm.test(\"Check if Data Source Id matches: \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "DataSource", + "{{dataSourceId}}" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Cleanup", + "item": [ + { + "name": "Embed-DeleteEmbed-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "" ], @@ -4743,7 +5749,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -4752,60 +5758,82 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "CallToActionOption-UpdateCallToActionOption-Administrator", + "name": "Highlight-DeleteHighlight-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "{{highlightId}}" + ] + } + }, + "response": [] + }, + { + "name": "Category-DeleteCategory-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedCallToActionType = pm.environment.get(\"updatedCallToActionType\");", - "var updatedCallToActionValue = pm.environment.get(\"updatedCallToActionValue\");", - "pm.environment.set(\"callToActionOptionType\", updatedCallToActionType);", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if updated Call to action Type matches: \" + updatedCallToActionType, function () {", - " pm.expect(jsonData.type).to.eql(updatedCallToActionType);", - "});", - "", - "pm.test(\"Check if updated Call to action Value matches: \" + updatedCallToActionValue, function () {", - " pm.expect(jsonData.value).to.eql(updatedCallToActionValue);", - "});", - "" + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -4813,57 +5841,32 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n\t\"type\": \"{{updatedCallToActionType}}\",\r\n \"value\": \"{{updatedCallToActionValue}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Category", + "{{categoryId}}" ] } }, "response": [] - } - ] - }, - { - "name": "WizardPage", - "item": [ + }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "Project-DeleteProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", - "", "" ], "type": "text/javascript" @@ -4871,7 +5874,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -4879,66 +5882,32 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-Administrator", + "name": "Project-DeleteProject2-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findOption(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", "" ], "type": "text/javascript" @@ -4946,7 +5915,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -4955,44 +5924,31 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Project", + "{{projectId2}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Administrator", + "name": "Project-DeleteProject3-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", - "});", "" ], "type": "text/javascript" @@ -5000,7 +5956,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5009,44 +5965,30 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Project", + "{{projectId3}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Administrator", + "name": "Role-DeleteRole-WithUsers-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var wizardPageName = pm.environment.get(\"updatedWizardPageName\");", - "", - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if updated Wizard Page Name matches: \" + wizardPageName, function () {", - " pm.expect(jsonData.name).to.eql(wizardPageName);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -5054,7 +5996,7 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5062,59 +6004,31 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetUpdatedWizardPage-Administrator", + "name": "Institution-DeleteInstitution-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var wizardPageId = parseInt(pm.environment.get(\"wizardPageId\"));", - "var updatedWizardPageName = pm.environment.get(\"updatedWizardPageName\");", - "", - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if updated Wizard Page Id matches: \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", - "});", - "", - "pm.test(\"Check if updated Wizard Page Name matches: \" + updatedWizardPageName, function () {", - " pm.expect(jsonData.name).to.eql(updatedWizardPageName);", "});" ], "type": "text/javascript" @@ -5122,7 +6036,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5131,56 +6045,31 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } + "Institution", + "{{createdInstitutionId}}" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-Administrator", + "name": "User-DeleteUser-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Retrieved data sources are not empty\", function () {", - " pm.expect(jsonData[0]).not.equal(null);", - " pm.environment.set(\"dataSourceId\", jsonData[0].guid);", - "});", "" ], "type": "text/javascript" @@ -5188,7 +6077,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5197,52 +6086,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Administrator", + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "var dataSourceId = pm.environment.get(\"dataSourceId\");", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", - "});", - "" + " pm.response.to.have.status(200);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5251,52 +6126,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Administrator", + "name": "WizardPage-DeleteWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var wizardPageName = pm.environment.get(\"updatedDataSourceName\");", - "", - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if updated Wizard Page Name matches: \" + wizardPageName, function () {", - " pm.expect(jsonData.title).to.eql(wizardPageName);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5304,55 +6166,46 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Checkup-on-Cleanup", + "item": [ { - "name": "WizardPage-GetUpdatedWizardPage-Administrator", + "name": "Category-Get-Deleted-Category-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var dataSourceId = pm.environment.get(\"dataSourceId\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.notFound;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "", - "pm.test(\"Check if Data Source Id matches: \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", "});" ], "type": "text/javascript" @@ -5369,33 +6222,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } + "Category", + "{{categoryId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup", - "item": [ + }, { - "name": "Embed-DeleteEmbed-Administrator", + "name": "Project-Get-Deleted-Project-Administrator", "event": [ { "listen": "test", @@ -5403,17 +6244,22 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5422,21 +6268,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Administrator", + "name": "User-Get-Deleted-User-Administrator", "event": [ { "listen": "test", @@ -5444,8 +6290,14 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5453,7 +6305,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5462,34 +6314,36 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-Administrator", + "name": "Embed-Get-Deleted-Embed-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", "", - "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5497,7 +6351,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5506,21 +6360,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "Highlight-Get-Deleted-Highlight-Administrator", "event": [ { "listen": "test", @@ -5528,17 +6382,22 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5547,30 +6406,37 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Role-DeleteRole-WithUsers-Administrator", + "name": "Institution-Get-Deleted-Institution-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", + "pm.test(\"Status code is 404\", function () {", + " pm.response.to.have.status(404);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5578,7 +6444,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5587,30 +6453,66 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Institution", + "{{createdInstitutionId}}" ] } }, "response": [] - }, + } + ] + } + ] + }, + { + "name": "Guest", + "item": [ + { + "name": "Preparation", + "item": [ { - "name": "Institution-DeleteInstitution-Administrator", + "name": "Project-CreateProject", "event": [ { "listen": "test", "script": { "exec": [ + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"projectId\", jsonData.id);", + "pm.environment.set(\"adminProjectId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", "});" ], "type": "text/javascript" @@ -5618,7 +6520,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -5626,40 +6528,66 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Guest_Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_Guest_Project-CreateProject\",\r\n \"uri\": \"postmantest_Guest_Project-CreateProject-CreateProjecttest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Guest_Project-CreateProject\",\r\n \"role\": \"postmantest_Guest_Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "Project" ] } }, "response": [] }, { - "name": "User-DeleteUser-Administrator", + "name": "Category-CreateCategory", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "var categoryName = pm.environment.get(\"categoryName\");", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"categoryId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", + "});", + "", + "pm.test(\"Category Name is set correctly and matching: \" + categoryName, function () {", + " pm.expect(jsonData.name).to.eql(categoryName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -5667,39 +6595,71 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Category" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "Highlight-CreateHighlight", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"highlightId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "" + ], + "type": "text/javascript" + } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -5707,40 +6667,56 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Highlight" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "Embed-CreateEmbed", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -5748,54 +6724,65 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Embed" ] } }, "response": [] - } - ] - }, - { - "name": "Checkup-on-Cleanup", - "item": [ + }, { - "name": "Category-Get-Deleted-Category-Administrator", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", - "});" + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -5803,83 +6790,127 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "CallToActionOption" ] } }, "response": [] + } + ], + "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-Get-Deleted-Project-Administrator", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "User", + "item": [ + { + "name": "User-CreateUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"postman_User-CreateUser-Guest\",\n \"email\": \"postman_User-CreateUser-Guest@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "User" ] } }, "response": [] }, { - "name": "User-Get-Deleted-User-Administrator", + "name": "User-GetUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5887,45 +6918,44 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{createdUserId}}" + "1" ] } }, "response": [] }, { - "name": "Embed-Get-Deleted-Embed-Administrator", + "name": "User-UpdateUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5933,45 +6963,53 @@ } ], "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "auth": { + "type": "noauth" + }, + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "User", + "1" ] } }, "response": [] }, { - "name": "Highlight-Get-Deleted-Highlight-Administrator", + "name": "User-DeleteUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -5979,140 +7017,141 @@ } ], "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "method": "DELETE", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "User", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Institution-Get-Deleted-Institution-Administrator", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FollowUser", + "item": [ + { + "name": "User-FollowUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.notFound;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "auth": { + "type": "noauth" + }, + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "", + "disabled": true } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] - } - ] - } - ] - }, - { - "name": "Guest", - "item": [ - { - "name": "Preparation", - "item": [ + }, { - "name": "Project-CreateProject", + "name": "User-UnFollowUser-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", - "var projectName = pm.environment.get(\"projectName\");", - "var adminUserName = pm.environment.get(\"adminUserName\");", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"projectId\", jsonData.id);", - "pm.environment.set(\"adminProjectId\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", - "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "auth": { + "type": "noauth" + }, + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Guest_Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_Guest_Project-CreateProject\",\r\n \"uri\": \"postmantest_Guest_Project-CreateProject-CreateProjecttest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Guest_Project-CreateProject\",\r\n \"role\": \"postmantest_Guest_Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -6120,63 +7159,58 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Category", + "item": [ { - "name": "Category-CreateCategory", + "name": "Category-CreateCategory-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", - "var categoryName = pm.environment.get(\"categoryName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"categoryId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Category Name is set correctly and matching: \" + categoryName, function () {", - " pm.expect(jsonData.name).to.eql(categoryName);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], "body": { "mode": "raw", "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", @@ -6200,40 +7234,72 @@ "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "Category-GetAllCategories-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "" ], "type": "text/javascript" } + } + ], + "request": { + "auth": { + "type": "noauth" }, + "method": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Category", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Category" + ] + } + }, + "response": [] + }, + { + "name": "Category-GetCategory-Guest", + "event": [ { - "listen": "prerequest", + "listen": "test", "script": { "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "" ], "type": "text/javascript" @@ -6241,56 +7307,42 @@ } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } + "auth": { + "type": "noauth" }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed", + "name": "Category-UpdateCategory-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -6298,17 +7350,14 @@ } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "auth": { + "type": "noauth" + }, + "method": "PUT", + "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", "options": { "raw": { "language": "json" @@ -6316,20 +7365,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "Category-DeleteCategory-Guest", "event": [ { "listen": "test", @@ -6337,65 +7387,43 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, + "method": "DELETE", + "header": [], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Category", + "{{categoryId}}" ] } }, "response": [] } ], - "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "auth": { + "type": "noauth" + }, "event": [ { "listen": "prerequest", @@ -6418,10 +7446,10 @@ ] }, { - "name": "User", + "name": "Project", "item": [ { - "name": "User-CreateUser-Guest", + "name": "Project-CreateProject-Guest", "event": [ { "listen": "test", @@ -6436,10 +7464,11 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", + "", "" ], "type": "text/javascript" @@ -6454,7 +7483,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"postman_User-CreateUser-Guest\",\n \"email\": \"postman_User-CreateUser-Guest@example.com\"\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -6462,37 +7491,109 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, + { + "name": "Project-GetAllProjects-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findProject(jsonData, name) {", + " for (var i = 0; i < jsonData.results.length; i++) {", + " if (jsonData.results[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project: \" + projectName + \" is in list\", function () {", + " foundAt = findProject(jsonData, projectName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Project name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Guest", + "name": "Project-GetProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -6506,28 +7607,26 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "User-UpdateUser-Guest", + "name": "Project-UpdateProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 401\", function () {", @@ -6535,9 +7634,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -6552,7 +7651,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -6560,13 +7659,13 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Project/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", + "Project", "1" ] } @@ -6574,7 +7673,7 @@ "response": [] }, { - "name": "User-DeleteUser-Guest", + "name": "Project-DeleteProject-Guest", "event": [ { "listen": "test", @@ -6602,61 +7701,39 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Project/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", + "Project", "1" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "FollowUser", - "item": [ - { - "name": "User-FollowUser-Guest", + "name": "Project-LikeProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", "" ], "type": "text/javascript" @@ -6671,47 +7748,46 @@ "header": [ { "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", "type": "text", - "value": "", "disabled": true } ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "User-UnFollowUser-Guest", + "name": "Project-DeleteLikeProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", "" ], "type": "text/javascript" @@ -6726,14 +7802,75 @@ "header": [ { "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", "type": "text", + "disabled": true + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "like", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-MakeInstitutionPrivate-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", "value": "", + "type": "text", "disabled": true } ], "body": { "mode": "raw", - "raw": "", + "raw": "true\r\n", "options": { "raw": { "language": "json" @@ -6741,101 +7878,87 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Category", - "item": [ + }, { - "name": "Category-CreateCategory-Guest", + "name": "Project-LinkInstitutionToProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" ], "type": "text/javascript" } } - ], - "request": { - "auth": { - "type": "noauth" - }, + ], + "request": { "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } + "header": [ + { + "key": "IdentityId", + "value": "", + "type": "text", + "disabled": true } - }, + ], "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-Guest", + "name": "Project-UnlinkInstitution-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.unauthorized\r", + "});\r", "" ], "type": "text/javascript" @@ -6843,26 +7966,61 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "", + "type": "text", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Category-GetCategory-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FollowProject", + "item": [ + { + "name": "Project-FollowProject-Guest", "event": [ { "listen": "test", @@ -6872,16 +8030,9 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", - "", "" ], "type": "text/javascript" @@ -6892,24 +8043,41 @@ "auth": { "type": "noauth" }, - "method": "GET", - "header": [], + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Category-UpdateCategory-Guest", + "name": "Project-UnFollowProject-Guest", "event": [ { "listen": "test", @@ -6920,12 +8088,7 @@ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" ], "type": "text/javascript" } @@ -6935,11 +8098,18 @@ "auth": { "type": "noauth" }, - "method": "PUT", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -6947,38 +8117,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "CategorizeProject", + "item": [ { - "name": "Category-DeleteCategory-Guest", + "name": "Project-CategorizeProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", "});" ], "type": "text/javascript" @@ -6986,52 +8156,82 @@ } ], "request": { - "method": "DELETE", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } + "name": "Project-UncategorizeProject-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" + ] + } + }, + "response": [] } ] }, { - "name": "Project", + "name": "Highlight", "item": [ { - "name": "Project-CreateProject-Guest", + "name": "Highlight-CreateHighlight-Guest", "event": [ { "listen": "test", @@ -7050,7 +8250,15 @@ " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -7058,14 +8266,11 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "POST", "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -7073,40 +8278,27 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Highlight" ] } }, "response": [] }, { - "name": "Project-GetAllProjects-Guest", + "name": "Highlight-GetAllActiveHighlights-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.results.length; i++) {", - " if (jsonData.results[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -7117,15 +8309,6 @@ " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "", - "pm.test(\"Project name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -7133,35 +8316,35 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Highlight" ] } }, "response": [] }, { - "name": "Project-GetProject-Guest", + "name": "Highlight-GetHighlight-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", "", "var jsonData = pm.response.json();", "", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -7174,8 +8357,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -7183,32 +8366,31 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Guest", + "name": "Highlight-GetHighlight-ByProject-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 401\", function () {", @@ -7219,43 +8401,33 @@ " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", + "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/1", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", + "Highlight", "Project", - "1" + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Guest", + "name": "Highlight-UpdateHighlight-Guest", "event": [ { "listen": "test", @@ -7270,229 +8442,231 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/1", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "1" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Project-LikeProject-Guest", + "name": "Highlight-DeleteHighlight-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text", - "disabled": true - } - ], + "method": "DELETE", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-DeleteLikeProject-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Embed", + "item": [ + { + "name": "Embed-CreateEmbed-Guest", "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text", - "disabled": true + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Guest", + "name": "Embed-GetAllEmbeds-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "\r", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectId}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Guest", + "name": "Embed-GetEmbed-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -7500,48 +8674,42 @@ } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-Guest", + "name": "Embed-DeleteEmbed-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.unauthorized\r", - "});\r", - "" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } @@ -7549,25 +8717,16 @@ ], "request": { "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Embed", + "{{embedGuid}}" ] } }, @@ -7599,10 +8758,61 @@ ] }, { - "name": "FollowProject", + "name": "Role", "item": [ { - "name": "Project-FollowProject-Guest", + "name": "Role-CreateRole-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Role", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role" + ] + } + }, + "response": [] + }, + { + "name": "Role-GetAllRoles-Guest", "event": [ { "listen": "test", @@ -7615,6 +8825,12 @@ "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", "" ], "type": "text/javascript" @@ -7622,54 +8838,41 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Role" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-Guest", + "name": "Scope-GetAllScopes-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", "" ], "type": "text/javascript" @@ -7677,143 +8880,119 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Role", + "Scopes" ] } }, "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ + }, { - "name": "Project-CategorizeProject-Guest", + "name": "Role-GetRole-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "", - "disabled": true - } - ], + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Role/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Role", + "1" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Guest", + "name": "Role-UpdateRole-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", + "method": "PUT", "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Role/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Role", + "1" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Guest", + "name": "Role-SetRole-Guest", "event": [ { "listen": "test", @@ -7836,23 +9015,14 @@ ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } } ], "request": { - "method": "POST", + "method": "PUT", "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -7860,27 +9030,105 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId=1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Role", + "setRole" + ], + "query": [ + { + "key": "createdUserId", + "value": "{{createdUserId}}", + "description": "Id of the user that we want to update" + }, + { + "key": "roleId", + "value": "1", + "description": "Id of the role that you want to update the user with" + } + ] + } + }, + "response": [] + }, + { + "name": "Role-DeleteRole-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], + "url": { + "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role", + "{{roleId}}" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Highlight-GetAllActiveHighlights-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Search", + "item": [ + { + "name": "Search-SearchInternal-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -7888,9 +9136,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -7898,74 +9146,137 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Search/internal/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Search", + "internal", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Highlight-GetHighlight-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Wizard", + "item": [], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Institution", + "item": [ + { + "name": "Institution-CreateInstitution-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", - "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", - "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "auth": { + "type": "noauth" + }, + "method": "POST", "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_initial_description\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Institution", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Institution" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-ByProject-Guest", + "name": "Institution-GetInstitution-Guest", "event": [ { "listen": "test", @@ -7980,36 +9291,37 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Institution/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "Institution", + "1" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Guest", + "name": "Institution-UpdateInstitution-Guest", "event": [ { "listen": "test", @@ -8024,31 +9336,24 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { + "auth": { + "type": "noauth" + }, "method": "PUT", "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "raw": "{\r\n \"name\": \"{{institutionName}}\",\r\n \"description\": \"postmantest_initial_description\"\r\n}", "options": { "raw": { "language": "json" @@ -8056,21 +9361,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Institution/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Institution", + "1" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Guest", + "name": "Instituiton-DeleteInstitution-Guest", "event": [ { "listen": "test", @@ -8098,14 +9403,14 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Institution/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Institution", + "1" ] } }, @@ -8137,27 +9442,27 @@ ] }, { - "name": "Embed", + "name": "File", "item": [ { - "name": "Embed-CreateEmbed-Guest", + "name": "Post-File-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -8165,49 +9470,90 @@ } ], "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" + } + ] + }, + "url": { + "raw": "{{apiUrl}}/api/File", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File" + ] + } + }, + "response": [] + }, + { + "name": "Get-Files-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "noauth" }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "File" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-Guest", + "name": "File-Delete-Guest", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.unauthorized;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -8215,23 +9561,32 @@ } ], "request": { - "method": "GET", + "auth": { + "type": "noauth" + }, + "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/File/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "File", + "1" ] } }, "response": [] - }, + } + ] + }, + { + "name": "DataSource", + "item": [ { - "name": "Embed-GetEmbed-Guest", + "name": "DataSource-GetAllDataSources-Guest", "event": [ { "listen": "test", @@ -8249,31 +9604,46 @@ " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "pm.test(\"Retrieved data sources are not empty\", function () {", + " pm.expect(jsonData[0]).not.equal(null);", + " pm.environment.set(\"dataSourceId\", jsonData[0].guid);", + "});", + "" ], "type": "text/javascript" } } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "DataSource" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Guest", + "name": "WizardPage-GetWizardPageById-Guest", "event": [ { "listen": "test", @@ -8291,59 +9661,42 @@ " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Role", - "item": [ - { - "name": "Role-CreateRole-Guest", + "name": "WizardPage-UpdateWizardPage-Guest", "event": [ { "listen": "test", @@ -8358,9 +9711,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8369,11 +9722,21 @@ } ], "request": { - "method": "POST", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", "options": { "raw": { "language": "json" @@ -8381,20 +9744,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "Role-GetAllRoles-Guest", + "name": "WizardPage-GetUpdatedWizardPage-Guest", "event": [ { "listen": "test", @@ -8409,9 +9773,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8420,23 +9784,46 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "WizardPage", + "{{wizardPageId}}" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } ] } }, "response": [] - }, + } + ] + }, + { + "name": "WizardPage", + "item": [ { - "name": "Scope-GetAllScopes-Guest", + "name": "WizardPage-CreateWizardPage-Guest", "event": [ { "listen": "test", @@ -8451,9 +9838,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8462,24 +9849,42 @@ } ], "request": { - "method": "GET", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "WizardPage" ] } }, "response": [] }, { - "name": "Role-GetRole-Guest", + "name": "WizardPage-GetAllWizardPages-Guest", "event": [ { "listen": "test", @@ -8494,9 +9899,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8505,24 +9910,33 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Role/1", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "1" + "WizardPage" ] } }, "response": [] }, { - "name": "Role-UpdateRole-Guest", + "name": "WizardPage-GetWizardPageById-Guest", "event": [ { "listen": "test", @@ -8537,9 +9951,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8548,33 +9962,34 @@ } ], "request": { - "method": "PUT", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } + "auth": { + "type": "noauth" }, + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Role/1", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "1" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "Role-SetRole-Guest", + "name": "WizardPage-UpdateWizardPage-Guest", "event": [ { "listen": "test", @@ -8589,9 +10004,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -8600,11 +10015,21 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "PUT", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}", + "disabled": true + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", "options": { "raw": { "language": "json" @@ -8612,115 +10037,103 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId=1", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "setRole" - ], - "query": [ - { - "key": "createdUserId", - "value": "{{createdUserId}}", - "description": "Id of the user that we want to update" - }, - { - "key": "roleId", - "value": "1", - "description": "Id of the role that you want to update the user with" - } + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "Role-DeleteRole-Guest", + "name": "WizardPage-GetUpdatedWizardPage-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", - "});" + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "auth": { + "type": "noauth" + }, + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "", + "value": "{{administratorUserIdentityId}}", "disabled": true } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "WizardPage", + "{{wizardPageId}}" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } ] } }, "response": [] } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } ] }, { - "name": "Search", + "name": "CallToActionOption", "item": [ { - "name": "Search-SearchInternal-Guest", + "name": "CallToActionOption-CreateCallToActionOption-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -8731,80 +10144,76 @@ "auth": { "type": "noauth" }, - "method": "GET", + "method": "POST", "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Search/internal/1", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "1" + "CallToActionOption" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Wizard", - "item": [], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } + "name": "CallToActionOption-GetAllCallToActionOptions-Guest", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption" + ] + } + }, + "response": [] }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Institution", - "item": [ - { - "name": "Institution-CreateInstitution-Guest", + "name": "CallToActionOption-GetCallToActionOptionById-Guest", "event": [ { "listen": "test", @@ -8819,11 +10228,10 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } @@ -8833,32 +10241,24 @@ "auth": { "type": "noauth" }, - "method": "POST", + "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_initial_description\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Institution", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-Guest", + "name": "CallToActionOption-GetCallToActionOptionByType-Guest", "event": [ { "listen": "test", @@ -8873,9 +10273,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -8889,21 +10289,22 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Institution/1", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "1" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] }, { - "name": "Institution-UpdateInstitution-Guest", + "name": "CallToActionOption-UpdateCallToActionOption-Guest", "event": [ { "listen": "test", @@ -8918,9 +10319,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -8935,7 +10336,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{institutionName}}\",\r\n \"description\": \"postmantest_initial_description\"\r\n}", + "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", "options": { "raw": { "language": "json" @@ -8943,21 +10344,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Institution/1", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "1" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Instituiton-DeleteInstitution-Guest", + "name": "CallToActionOption-DeleteCallToActionOption-Guest", "event": [ { "listen": "test", @@ -8972,9 +10373,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -8985,14 +10386,14 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Institution/1", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "1" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, @@ -9024,74 +10425,20 @@ ] }, { - "name": "File", + "name": "Cleanup Administrator", "item": [ { - "name": "Post-File-Guest", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" - } - ] - }, - "url": { - "raw": "{{apiUrl}}/api/File", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "File" - ] - } - }, - "response": [] - }, - { - "name": "Get-Files-Guest", + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", "" ], "type": "text/javascript" @@ -9099,226 +10446,217 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{apiUrl}}/api/File", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "File" - ] - } - }, - "response": [] - }, - { - "name": "File-Delete-Guest", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.unauthorized;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, "method": "DELETE", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/File/1", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "1" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-Guest", + "name": "Project-DeleteProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Retrieved data sources are not empty\", function () {", - " pm.expect(jsonData[0]).not.equal(null);", - " pm.environment.set(\"dataSourceId\", jsonData[0].guid);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "Project", + "{{adminProjectId}}" ] } }, "response": [] - }, + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Registered", + "item": [ + { + "name": "Preparation", + "item": [ { - "name": "WizardPage-GetWizardPageById-Guest", + "name": "User-CreateUser", "event": [ { "listen": "test", "script": { "exec": [ + "var userName = pm.environment.get(\"userName\");", + "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"createdUserId\", jsonData.id);", + "pm.environment.set(\"identityId\", jsonData.id);", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_Registered_User-CreateUser@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "User" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Guest", + "name": "Project-CreateProject", "event": [ { "listen": "test", "script": { "exec": [ + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"projectId\", jsonData.id);", + "pm.environment.set(\"adminProjectId\", jsonData.id);", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Registered-Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_Registered-Project-CreateProject\",\r\n \"uri\": \"postmantest_Registered-Project-CreateProject\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Registered-Project-CreateProject\",\r\n \"role\": \"postmantest_Registered-Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -9326,39 +10664,53 @@ } }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "Project" ] } }, "response": [] }, { - "name": "WizardPage-GetUpdatedWizardPage-Guest", + "name": "Highlight-CreateHighlight", "event": [ { "listen": "test", "script": { "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"highlightId\", jsonData.id);", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", "" ], "type": "text/javascript" @@ -9366,46 +10718,38 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Registered_Highlight-CreateHighlight\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } + "Highlight" ] } }, "response": [] - } - ] - }, - { - "name": "WizardPage", - "item": [ + }, { - "name": "WizardPage-CreateWizardPage-Guest", + "name": "Embed-CreateEmbed", "event": [ { "listen": "test", @@ -9413,39 +10757,36 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -9453,20 +10794,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Embed" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-Guest", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", @@ -9474,17 +10815,26 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", "" ], "type": "text/javascript" @@ -9492,33 +10842,38 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Guest", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", @@ -9526,17 +10881,20 @@ "exec": [ "var jsonData = pm.response.json();", "", + "pm.environment.set(\"wizardPageId\", jsonData.id);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", + "", "" ], "type": "text/javascript" @@ -9544,34 +10902,64 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "WizardPage" ] } }, "response": [] + } + ], + "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "WizardPage-UpdateWizardPage-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "User", + "item": [ + { + "name": "User-CreateUser-Registered", "event": [ { "listen": "test", @@ -9579,39 +10967,32 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\",\n \"institutionId\": 1\n}", "options": { "raw": { "language": "json" @@ -9619,21 +11000,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "User" ] } }, "response": [] }, { - "name": "WizardPage-GetUpdatedWizardPage-Guest", + "name": "User-GetUser-Other-Registered", "event": [ { "listen": "test", @@ -9643,12 +11023,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", @@ -9659,63 +11039,54 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}", - "disabled": true + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } + "User", + "{{createdUserId}}" ] } }, "response": [] - } - ] - }, - { - "name": "CallToActionOption", - "item": [ + }, { - "name": "CallToActionOption-CreateCallToActionOption-Guest", + "name": "User-GetUser-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var aliceIdentityId = parseInt(pm.environment.get(\"registeredUserIdentityId\"));", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"registeredUserId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + aliceIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(aliceIdentityId);", "});" ], "type": "text/javascript" @@ -9723,52 +11094,52 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", - "options": { - "raw": { - "language": "json" - } + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" } - }, + ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "User" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-Guest", + "name": "User-UpdateUser-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", + " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", "});" ], "type": "text/javascript" @@ -9776,26 +11147,39 @@ } ], "request": { - "auth": { - "type": "noauth" + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_User-UpdateUser-Self-Registered_alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{registeredUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", + "options": { + "raw": { + "language": "json" + } + } }, - "method": "GET", - "header": [], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/User/{{registeredUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "User", + "{{registeredUserId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-Guest", + "name": "User-UpdateUser-Other-Registered", "event": [ { "listen": "test", @@ -9810,9 +11194,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -9820,44 +11204,51 @@ } ], "request": { - "auth": { - "type": "noauth" + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } }, - "method": "GET", - "header": [], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-Guest", + "name": "User-DeleteUser-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", "pm.test(\"Status code is 401\", function () {", " pm.response.to.have.status(401);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -9865,45 +11256,78 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "User", + "{{createdUserId}}" ] } }, "response": [] + } + ], + "description": "Requests executed as the Alice user with the registered role.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "CallToActionOption-UpdateCallToActionOption-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FollowUser", + "item": [ + { + "name": "User-FollowUser-Registered", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", + "var userId = pm.environment.get(\"userIdToFollow\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if created Username matches: \" + userId, function () {", + " pm.expect(jsonData.id).to.eql(userId);", "});" ], "type": "text/javascript" @@ -9911,14 +11335,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", - "header": [], + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], "body": { "mode": "raw", - "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -9926,39 +11353,33 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-Guest", + "name": "User-UnFollowUser-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" ], "type": "text/javascript" } @@ -9966,25 +11387,38 @@ ], "request": { "method": "DELETE", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] } ], - "auth": { - "type": "noauth" - }, "event": [ { "listen": "prerequest", @@ -10007,20 +11441,29 @@ ] }, { - "name": "Cleanup Administrator", + "name": "Category", "item": [ { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "Category-CreateCategory-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", + "", "" ], "type": "text/javascript" @@ -10028,125 +11471,130 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Category" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "Category-GetAllCategories-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var categoryName = pm.environment.get(\"categoryName\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findCategory(jsonData, name) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", + " foundAt = findCategory(jsonData, categoryName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", + " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "{{adminProjectId}}" - ] - } - }, - "response": [] - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Registered", - "item": [ - { - "name": "Preparation", - "item": [ + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Category", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Category" + ] + } + }, + "response": [] + }, { - "name": "User-CreateUser", + "name": "Category-GetCategory-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var userName = pm.environment.get(\"userName\");", + "var categoryName = pm.environment.get(\"categoryNameInitial\");", "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"createdUserId\", jsonData.id);", - "pm.environment.set(\"identityId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Username matches: \" + userName, function () {", - " pm.expect(jsonData.name).to.eql(userName);", + "pm.test(\"Category name is set correctly and matches: \" + categoryName, function () {", + " pm.expect(jsonData.name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -10154,73 +11602,45 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_Registered_User-CreateUser@example.com\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-CreateProject", + "name": "Category-UpdateCategory-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", - "var projectName = pm.environment.get(\"projectName\");", - "var adminUserName = pm.environment.get(\"adminUserName\");", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"projectId\", jsonData.id);", - "pm.environment.set(\"adminProjectId\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -10228,17 +11648,17 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Registered-Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_Registered-Project-CreateProject\",\r\n \"uri\": \"postmantest_Registered-Project-CreateProject\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Registered-Project-CreateProject\",\r\n \"role\": \"postmantest_Registered-Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", "options": { "raw": { "language": "json" @@ -10246,112 +11666,133 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "Category-DeleteCategory-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", - "" - ], - "type": "text/javascript" - } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Registered_Highlight-CreateHighlight\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Embed-CreateEmbed", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Project", + "item": [ + { + "name": "Project-CreateProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "var fileId = pm.environment.get(\"generalFileId\");", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId\", jsonData.id);", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", + "});", + "", + "pm.test(\"Image should be stored\", function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", + " pm.expect(jsonData.images.length).to.eql(1);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -10363,12 +11804,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true,\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -10376,47 +11817,57 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "Project-CreateProject-OneCallToAction-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId2\", jsonData.id);", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", "});", "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 1);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -10429,12 +11880,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -10442,28 +11893,30 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Project" ] } }, "response": [] }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "Project-CreateProject-MultipleCallToActions-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", + "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId3\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -10471,12 +11924,25 @@ " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", "});", "", + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 2);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -10489,12 +11955,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction2-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -10502,62 +11968,48 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Project" ] } }, "response": [] - } - ], - "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "User", - "item": [ - { - "name": "User-CreateUser-Registered", + "name": "Project-CreateProject-CallToActionValueInvalid-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -10574,7 +12026,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\",\n \"institutionId\": 1\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"postmantest_Project\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -10582,38 +12034,47 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Other-Registered", + "name": "Project-CreateProject-CallToActionLimitExceeded-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -10621,7 +12082,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -10629,54 +12090,64 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Provide feedback\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"More information\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Get in touch\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Self-Registered", + "name": "Project-CreateProject-CallToActionSameAction-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var aliceIdentityId = parseInt(pm.environment.get(\"registeredUserIdentityId\"));", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"registeredUserId\", jsonData.id);", "", - "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", "});", "", - "pm.test(\"Identity ID is correct and matching: \" + aliceIdentityId, function () {", - " pm.expect(parseInt(jsonData.identityId)).to.eql(aliceIdentityId);", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -10684,30 +12155,50 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"role\": \"postmantest_Project-CreateProject-Administrator\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-Self-Registered", + "name": "Project-GetAllProjects-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", "", + "var foundAt;", + "", + "function findProject(jsonData, name) {", + " for (var i = 0; i < jsonData.results.length; i++) {", + " if (jsonData.results[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -10715,13 +12206,18 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", - " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", + "pm.test(\"Project: \" + projectName + \" is in list\", function () {", + " foundAt = findProject(jsonData, projectName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -10729,7 +12225,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -10737,48 +12233,44 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_User-UpdateUser-Self-Registered_alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{registeredUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{registeredUserId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{registeredUserId}}" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-Registered", + "name": "Project-GetProject-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -10786,7 +12278,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -10794,43 +12286,37 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ - "api", - "User", - "{{createdUserId}}" + "api", + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "User-DeleteUser-Other-Registered", + "name": "Project-GetProject-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -10838,7 +12324,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -10847,54 +12333,29 @@ } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] - } - ], - "description": "Requests executed as the Alice user with the registered role.", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "FollowUser", - "item": [ - { - "name": "User-FollowUser-Registered", + "name": "Project-UpdateProject-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectNameUpdated\");", + "", "var jsonData = pm.response.json();", - "var userId = pm.environment.get(\"userIdToFollow\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -10903,21 +12364,26 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if created Username matches: \" + userId, function () {", - " pm.expect(jsonData.id).to.eql(userId);", - "});" + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"Images are removed\", function () {", + " pm.expect(jsonData.projectIcon).to.eql(null);", + " pm.expect(jsonData.images.length).to.eql(0);", + "})" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -10927,7 +12393,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -10935,22 +12401,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "User-UnFollowUser-Registered", + "name": "Project-UpdateProject-Other-Registered", "event": [ { "listen": "test", @@ -10958,17 +12423,22 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -10978,7 +12448,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -10986,66 +12456,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Category", - "item": [ - { - "name": "Category-CreateCategory-Registered", + "name": "Project-LikeProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", "" ], "type": "text/javascript" @@ -11057,73 +12500,89 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-Registered", + "name": "Project-DeleteLikeProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryName\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findCategory(jsonData, name) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", - " foundAt = findCategory(jsonData, categoryName);", - " pm.expect(foundAt).to.not.eql(-1);", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "like", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject-Other-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", - "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -11131,7 +12590,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -11140,90 +12599,115 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "{{projectToBeDeletedByUnauthorizedRoles}}" ] } }, "response": [] }, { - "name": "Category-GetCategory-Registered", + "name": "Project-MakeInstitutionPrivate-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Category name is set correctly and matches: \" + categoryName, function () {", - " pm.expect(jsonData.name).to.eql(categoryName);", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 403\", function () {\r", + " pm.response.to.have.status(403);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.forbidden;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "instituteprivate", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Category-UpdateCategory-Registered", + "name": "Project-MakeInstitutionPrivate-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "pm.test(\"instituteprivate is set correctly\", function(){\r", + " pm.expect(jsonData.institutePrivate).to.eql(true);\r", + "})\r", + "\r", + "pm.test(\"institute is added\", function(){\r", + " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -11234,13 +12718,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "true\r\n", "options": { "raw": { "language": "json" @@ -11248,38 +12732,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-Registered", + "name": "Project-LinkInstitutionToProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 403\", function () {\r", + " pm.response.to.have.status(403);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.forbidden;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -11287,94 +12772,96 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Project", - "item": [ - { - "name": "Project-CreateProject-Registered", + "name": "Project-UnlinkInstitution-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var registeredUserId = pm.environment.get(\"registeredUserId\");", - "var projectName = pm.environment.get(\"projectName\");", - "var fileId = pm.environment.get(\"generalFileId\");", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId\", jsonData.id);", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", - " pm.expect(jsonData.user.id).to.eql(registeredUserId);", - "});", - "", - "pm.test(\"Image should be stored\", function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", - " pm.expect(jsonData.images.length).to.eql(1);", - "})" + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 403\", function () {\r", + " pm.response.to.have.status(403);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.forbidden\r", + "});\r", + "" ], "type": "text/javascript" } - }, + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "linkedinstitution", + "{{projectId}}", + "1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "UserProjects", + "item": [ + { + "name": "UserProject-CreateProject-Registered", + "event": [ { - "listen": "prerequest", + "listen": "test", "script": { "exec": [ - "" + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"userProjectProjectId1\", jsonData.id)", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});" ], "type": "text/javascript" } @@ -11391,7 +12878,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true,\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", + "raw": "{\r\n \"name\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"description\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"uri\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"role\": \"postmantest_UserProject-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -11412,46 +12899,18 @@ "response": [] }, { - "name": "Project-GetAllProjects-Registered", + "name": "UserProject-CreateProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.results.length; i++) {", - " if (jsonData.results[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", + "pm.environment.set(\"userProjectProjectId2\", jsonData.id)", "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});" ], "type": "text/javascript" @@ -11459,7 +12918,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -11467,6 +12926,15 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"description\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"uri\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"role\": \"postmantest_UserProject-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { "raw": "{{apiUrl}}/api/Project", "host": [ @@ -11481,7 +12949,7 @@ "response": [] }, { - "name": "Project-GetProject-Self-Registered", + "name": "UserProject-GetProject-Self-Registered", "event": [ { "listen": "test", @@ -11503,8 +12971,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Project count matches: 6\", function () {", + " pm.expect(jsonData.length).to.eql(6);", "});" ], "type": "text/javascript" @@ -11521,36 +12989,28 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/user/projects", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "user", + "projects" ] } }, "response": [] }, { - "name": "Project-GetProject-Other-Registered", + "name": "UserProject-DeleteProject-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -11558,7 +13018,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -11567,57 +13027,36 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId1}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{adminProjectId}}" + "{{userProjectProjectId1}}" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Self-Registered", + "name": "UserProject-DeleteProject-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"Images are removed\", function () {", - " pm.expect(jsonData.projectIcon).to.eql(null);", - " pm.expect(jsonData.images.length).to.eql(0);", - "})" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -11625,46 +13064,50 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{projectId}}" + "{{userProjectProjectId2}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "FollowProject", + "item": [ { - "name": "Project-UpdateProject-Other-Registered", + "name": "Project-FollowProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectId = pm.environment.get(\"projectIdToFollow\");", + "", + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if created Username matches: \" + projectId, function () {", + " pm.expect(jsonData.id).to.eql(projectId);", "});" ], "type": "text/javascript" @@ -11672,17 +13115,17 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -11690,89 +13133,32 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "{{adminProjectId}}" - ] - } - }, - "response": [] - }, - { - "name": "Project-LikeProject-Registered", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-Registered", + "name": "Project-UnFollowProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", "" ], "type": "text/javascript" @@ -11785,38 +13171,77 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-DeleteProject-Other-Registered", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "CategorizeProject", + "item": [ + { + "name": "Project-CategorizeProject-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -11824,7 +13249,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -11833,21 +13258,23 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{projectToBeDeletedByUnauthorizedRoles}}" + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-Registered", + "name": "Project-CategorizeProject-Other-Registered", "event": [ { "listen": "test", @@ -11857,56 +13284,41 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.forbidden;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});\r", - "" + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{adminProjectId}}" + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Registered", + "name": "Project-UncategorizeProject-Self-Registered", "event": [ { "listen": "test", @@ -11924,64 +13336,39 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", - "\r", - "pm.test(\"instituteprivate is set correctly\", function(){\r", - " pm.expect(jsonData.institutePrivate).to.eql(true);\r", - "})\r", - "\r", - "pm.test(\"institute is added\", function(){\r", - " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", - "})" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{projectId}}" + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Registered", + "name": "Project-UncategorizeProject-Other-Registered", "event": [ { "listen": "test", @@ -11991,14 +13378,8 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.forbidden;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", "});" ], "type": "text/javascript" @@ -12006,46 +13387,58 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Embed", + "item": [ { - "name": "Project-UnlinkInstitution-Registered", + "name": "Embed-CreateEmbed-Self-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.forbidden\r", - "});\r", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", "" ], "type": "text/javascript" @@ -12053,37 +13446,38 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Embed" ] } }, "response": [] - } - ] - }, - { - "name": "UserProjects", - "item": [ + }, { - "name": "UserProject-CreateProject-Registered", + "name": "Embed-CreateEmbed-Other-Registered", "event": [ { "listen": "test", @@ -12091,10 +13485,16 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"userProjectProjectId1\", jsonData.id)", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12112,7 +13512,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"description\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"uri\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"role\": \"postmantest_UserProject-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", "options": { "raw": { "language": "json" @@ -12120,20 +13520,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Embed" ] } }, "response": [] }, { - "name": "UserProject-CreateProject-Registered", + "name": "Embed-GetAllEmbeds-Registered", "event": [ { "listen": "test", @@ -12141,10 +13541,16 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"userProjectProjectId2\", jsonData.id)", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12152,7 +13558,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12160,36 +13566,27 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"description\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"uri\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_UserProject-CreateProject-Registered\",\r\n \"role\": \"postmantest_UserProject-CreateProject-Registered\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Embed" ] } }, "response": [] }, { - "name": "UserProject-GetProject-Self-Registered", + "name": "Embed-GetEmbed-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", "", "var jsonData = pm.response.json();", "", @@ -12205,8 +13602,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project count matches: 4\", function () {", - " pm.expect(jsonData.length).to.eql(4);", + "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", "});" ], "type": "text/javascript" @@ -12223,21 +13620,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/user/projects", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "user", - "projects" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "UserProject-DeleteProject-Other-Registered", + "name": "Embed-DeleteEmbed-Self-Registered", "event": [ { "listen": "test", @@ -12245,6 +13642,11 @@ "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -12261,28 +13663,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId1}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{userProjectProjectId1}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "UserProject-DeleteProject-Other-Registered", + "name": "Embed-DeleteEmbed-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -12299,14 +13706,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId2}}", + "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{userProjectProjectId2}}" + "Embed", + "{{adminEmbedGuid}}" ] } }, @@ -12315,84 +13722,41 @@ ] }, { - "name": "FollowProject", + "name": "Highlight", "item": [ { - "name": "Project-FollowProject-Registered", + "name": "Highlight-CreateHighlight-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectId = pm.environment.get(\"projectIdToFollow\");", - "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if created Username matches: \" + projectId, function () {", - " pm.expect(jsonData.id).to.eql(projectId);", "});" ], "type": "text/javascript" } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } }, - "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "project", - "follow", - "{{projectIdToFollow}}" - ] - } - }, - "response": [] - }, - { - "name": "Project-UnFollowProject-Registered", - "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", "" ], "type": "text/javascript" @@ -12400,17 +13764,17 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -12418,108 +13782,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "project", - "follow", - "{{projectIdToFollow}}" - ] - } - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "CategorizeProject", - "item": [ - { - "name": "Project-CategorizeProject-Self-Registered", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "Highlight" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-Registered", + "name": "Highlight-GetAllActiveHighlights-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", + "var projectId = pm.environment.get(\"adminProjectId\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findItem(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].project.id == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight is in list and matching: \" + projectId, function () {", + " foundAt = findItem(jsonData, projectId);", + " pm.expect(foundAt).to.not.eql(-1);", "});" ], "type": "text/javascript" @@ -12527,7 +13838,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12536,40 +13847,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Highlight" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Self-Registered", + "name": "Highlight-GetHighlight-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -12577,7 +13895,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12586,42 +13904,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Other-Registered", + "name": "Highlight-GetHighlight-ByProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", - "});" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12630,28 +13953,22 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", + "Highlight", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Embed", - "item": [ + }, { - "name": "Embed-CreateEmbed-Self-Registered", + "name": "Highlight-UpdateHighlight-Registered", "event": [ { "listen": "test", @@ -12659,38 +13976,34 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -12698,20 +14011,69 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-Other-Registered", + "name": "Highlight-DeleteHighlight-Other-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "{{highlightId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Role", + "item": [ + { + "name": "Role-CreateRole-Registered", "event": [ { "listen": "test", @@ -12721,12 +14083,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -12746,7 +14108,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -12754,20 +14116,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Role" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-Registered", + "name": "Role-GetAllRoles-Registered", "event": [ { "listen": "test", @@ -12801,43 +14163,37 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Role" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Registered", + "name": "Scope-GetAllScopes-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", - "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", - " pm.expect(jsonData.id).to.eql(embeddedProjectId);", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12854,33 +14210,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Self-Registered", + "name": "Role-GetRole-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12888,7 +14249,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12897,33 +14258,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-Registered", + "name": "Role-UpdateRole-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12931,7 +14297,7 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -12939,27 +14305,31 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{adminEmbedGuid}}" + "Role", + "{{roleId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Registered", + "name": "Role-SetRole-Registered", "event": [ { "listen": "test", @@ -12981,24 +14351,10 @@ ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", - "" - ], - "type": "text/javascript" - } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -13008,7 +14364,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -13016,55 +14372,45 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Role", + "setRole" + ], + "query": [ + { + "key": "createdUserId", + "value": "{{createdUserId}}", + "description": "Id of the user that we want to update" + }, + { + "key": "roleId", + "value": "{{roleId}}", + "description": "Id of the role that you want to update the user with" + } ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-Registered", + "name": "Role-DeleteRole-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectId = pm.environment.get(\"adminProjectId\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findItem(jsonData, item) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].project.id == item) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Highlight is in list and matching: \" + projectId, function () {", - " foundAt = findItem(jsonData, projectId);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.forbidden;", "});" ], "type": "text/javascript" @@ -13072,7 +14418,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -13081,33 +14427,31 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Role", + "{{roleId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "Highlight-GetHighlight-Registered", + "name": "Search-SearchInternal-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", - "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -13115,13 +14459,9 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -13134,25 +14474,35 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Search", + "internal", + "{{projectName}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Wizard", + "item": [] + }, + { + "name": "Institution", + "item": [ { - "name": "Highlight-GetHighlight-ByProject-Registered", + "name": "Institution-CreateInstitution-Registered", "event": [ { "listen": "test", @@ -13162,14 +14512,14 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -13178,31 +14528,41 @@ } ], "request": { - "method": "GET", + "auth": { + "type": "noauth" + }, + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "User" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Registered", + "name": "Institution-GetInstitution-Registered", "event": [ { "listen": "test", @@ -13212,12 +14572,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -13227,7 +14587,10 @@ } ], "request": { - "method": "PUT", + "auth": { + "type": "noauth" + }, + "method": "GET", "header": [ { "key": "IdentityId", @@ -13235,43 +14598,39 @@ "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Other-Registered", + "name": "Institution-UpdateInstitution-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -13279,35 +14638,42 @@ } ], "request": { - "method": "DELETE", + "auth": { + "type": "noauth" + }, + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "User", + "1" ] } }, "response": [] - } - ] - }, - { - "name": "Role", - "item": [ + }, { - "name": "Role-CreateRole-Registered", + "name": "Instituiton-DeleteInstitution-Registered", "event": [ { "listen": "test", @@ -13317,12 +14683,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -13332,55 +14698,81 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "User", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Role-GetAllRoles-Registered", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "ProjectIcon", + "item": [ + { + "name": "ProjectIcon-Post-File-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response includes fileId\", function () {\r", + " pm.expect(jsonData.id).to.exist;\r", + "})\r", + "\r", + "pm.environment.set(\"ProjectIconRegisteredFileId\", jsonData.id);\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.success;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -13388,46 +14780,58 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" + } + ] + }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "File" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-Registered", + "name": "ProjectIcon-CreateProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"ProjectIconProjectId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -13435,7 +14839,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -13443,39 +14847,58 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{ProjectIconRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Project" ] } }, "response": [] }, { - "name": "Role-GetRole-Registered", + "name": "ProjectIcon-GetProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "var ProjectIconRegisteredFileId = pm.environment.get(\"ProjectIconRegisteredFileId\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"ProjectIconId is set correctly and matches: \" + ProjectIconRegisteredFileId, function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(ProjectIconRegisteredFileId)", "});" ], "type": "text/javascript" @@ -13492,38 +14915,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "Role-UpdateRole-Registered", + "name": "ProjectIcon-GetIcon-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -13531,7 +14954,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -13539,48 +14962,45 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "file", + "{{ProjectIconRegisteredFileId}}" ] } }, "response": [] }, { - "name": "Role-SetRole-Registered", + "name": "ProjectIcon-UpdateProject-Same-ProjectIcon", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectNameUpdated\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -13598,7 +15018,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{ProjectIconRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -13606,45 +15026,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "setRole" - ], - "query": [ - { - "key": "createdUserId", - "value": "{{createdUserId}}", - "description": "Id of the user that we want to update" - }, - { - "key": "roleId", - "value": "{{roleId}}", - "description": "Id of the role that you want to update the user with" - } + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "Role-DeleteRole-Registered", + "name": "ProjectIcon-GetIcon-Registered-After-Edit", "event": [ { "listen": "test", "script": { - "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -13652,7 +15065,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -13661,41 +15074,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "file", + "{{ProjectIconRegisteredFileId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-Registered", + "name": "ProjectIcon-Post-New-File-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response includes fileId\", function () {\r", + " pm.expect(jsonData.id).to.exist;\r", + "})\r", + "\r", + "pm.environment.set(\"newRegisteredFileId\", jsonData.id);\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.success;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -13703,79 +15119,80 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage2.png" + } + ] + }, "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectName}}" + "File" ] } }, "response": [] - } - ] - }, - { - "name": "Wizard", - "item": [] - }, - { - "name": "Institution", - "item": [ + }, { - "name": "Institution-CreateInstitution-Registered", + "name": "ProjectIcon-UpdateProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectNameUpdated\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\n}", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{newRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -13783,37 +15200,49 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-Registered", + "name": "ProjectIcon-GetUpdatedProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "var newRegisteredFileId = pm.environment.get(\"newRegisteredFileId\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"ProjectIconId is set correctly and matches: \" + newRegisteredFileId, function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(newRegisteredFileId)", "});" ], "type": "text/javascript" @@ -13821,50 +15250,47 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "Institution-UpdateInstitution-Registered", + "name": "ProjectIcon-GetNewIcon-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -13872,42 +15298,56 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/file/{{newRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "file", + "{{newRegisteredFileId}}" ] } }, "response": [] + } + ], + "description": "Testing if the icons are accessible, and get deleted when they are supposed to ", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Instituiton-DeleteInstitution-Registered", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "CallToActionOption", + "item": [ + { + "name": "CallToActionOption-CreateCallToActionOption-Registered", "event": [ { "listen": "test", @@ -13917,22 +15357,23 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -13940,181 +15381,173 @@ "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "CallToActionOption" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "ProjectIcon", - "item": [ - { - "name": "ProjectIcon-Post-File-Registered", + "name": "CallToActionOption-GetAllCallToActionOptions-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response includes fileId\", function () {\r", - " pm.expect(jsonData.id).to.exist;\r", - "})\r", - "\r", - "pm.environment.set(\"ProjectIconRegisteredFileId\", jsonData.id);\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.success;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" + "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findOption(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", + " foundAt = findOption(jsonData, optionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" - } - ] - }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "CallToActionOption" ] } }, "response": [] }, { - "name": "ProjectIcon-CreateProject-Registered", + "name": "CallToActionOption-GetCallToActionOptionById-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var registeredUserId = pm.environment.get(\"registeredUserId\");", - "var projectName = pm.environment.get(\"projectName\");", - "", "var jsonData = pm.response.json();", - "pm.environment.set(\"ProjectIconProjectId\", jsonData.id);", + "", + "pm.environment.set(\"callToActionOptionType\", jsonData.type);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});" + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{ProjectIconRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "ProjectIcon-GetProject-Registered", + "name": "CallToActionOption-GetCallToActionOptionByType-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "var ProjectIconRegisteredFileId = pm.environment.get(\"ProjectIconRegisteredFileId\");", + "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", "", "var jsonData = pm.response.json();", "", + "function findOptionType(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -14122,18 +15555,16 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", "});", - "", - "pm.test(\"ProjectIconId is set correctly and matches: \" + ProjectIconRegisteredFileId, function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(ProjectIconRegisteredFileId)", - "});" + "" ], "type": "text/javascript" } @@ -14149,38 +15580,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] }, { - "name": "ProjectIcon-GetIcon-Registered", + "name": "CallToActionOption-UpdateCallToActionOption-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -14188,53 +15620,56 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{ProjectIconRegisteredFileId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "ProjectIcon-UpdateProject-Same-ProjectIcon", + "name": "CallToActionOption-DeleteCallToActionOption-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", - "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -14242,39 +15677,55 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{ProjectIconRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "ProjectIcon-GetIcon-Registered-After-Edit", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "File", + "item": [ + { + "name": "Get-Files-Registered", "event": [ { "listen": "test", @@ -14284,12 +15735,7 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", "});" @@ -14303,26 +15749,25 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{ProjectIconRegisteredFileId}}" + "File" ] } }, "response": [] }, { - "name": "ProjectIcon-Post-New-File-Registered", + "name": "Post-File-Registered", "event": [ { "listen": "test", @@ -14330,18 +15775,14 @@ "exec": [ "var jsonData = pm.response.json();\r", "\r", + "pm.environment.set(\"registeredFileId\", jsonData.id)\r", + "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", "pm.test(\"Status code is 200\", function () {\r", " pm.response.to.have.status(200);\r", "});\r", "\r", - "pm.test(\"Response includes fileId\", function () {\r", - " pm.expect(jsonData.id).to.exist;\r", - "})\r", - "\r", - "pm.environment.set(\"newRegisteredFileId\", jsonData.id);\r", - "\r", "pm.test(\"Response must be valid and have a json body\", function () {\r", " pm.response.to.be.success;\r", " pm.response.to.be.withBody;\r", @@ -14357,8 +15798,8 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "body": { @@ -14367,7 +15808,7 @@ { "key": "File", "type": "file", - "src": "Postman/testimage2.png" + "src": "Postman/testimage.png" } ] }, @@ -14385,18 +15826,63 @@ "response": [] }, { - "name": "ProjectIcon-UpdateProject-Registered", + "name": "Delete-File-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.ok;\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File/{{registeredFileId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File", + "{{registeredFileId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "DataSource", + "item": [ + { + "name": "DataSource-GetAllDataSources-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", - "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", - "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", @@ -14406,17 +15892,14 @@ " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -14424,41 +15907,30 @@ "value": "{{registeredUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"uri\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectIcon-CreateProject-Registered\",\r\n \"role\": \"postmantest_ProjectIcon-CreateProject-Registered\"\r\n }\r\n ],\r\n \"iconId\": {{newRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "DataSource" ] } }, "response": [] }, { - "name": "ProjectIcon-GetUpdatedProject-Registered", + "name": "WizardPage-GetWizardPageById-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "var newRegisteredFileId = pm.environment.get(\"newRegisteredFileId\");", - "", "var jsonData = pm.response.json();", "", + "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -14466,18 +15938,15 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", "});", - "", - "pm.test(\"ProjectIconId is set correctly and matches: \" + newRegisteredFileId, function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(newRegisteredFileId)", - "});" + "" ], "type": "text/javascript" } @@ -14493,95 +15962,85 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "ProjectIcon-GetNewIcon-Registered", + "name": "WizardPage-UpdateWizardPage-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "disabled": true } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/file/{{newRegisteredFileId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{newRegisteredFileId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] } - ], - "description": "Testing if the icons are accessible, and get deleted when they are supposed to ", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } ] }, { - "name": "CallToActionOption", + "name": "WizardPage", "item": [ { - "name": "CallToActionOption-CreateCallToActionOption-Registered", + "name": "WizardPage-CreateWizardPage-Registered", "event": [ { "listen": "test", @@ -14611,13 +16070,13 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", "options": { "raw": { "language": "json" @@ -14625,26 +16084,26 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "WizardPage" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-Registered", + "name": "WizardPage-GetAllWizardPages-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", "", "var jsonData = pm.response.json();", "", @@ -14671,8 +16130,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", - " foundAt = findOption(jsonData, optionId);", + "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", + " foundAt = findOption(jsonData, pageId);", " pm.expect(foundAt).to.not.eql(-1);", "});", "" @@ -14691,20 +16150,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "WizardPage" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-Registered", + "name": "WizardPage-GetWizardPageById-Registered", "event": [ { "listen": "test", @@ -14712,7 +16171,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionType\", jsonData.type);", + "var wizardPageId = pm.environment.get(\"wizardPageId\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -14726,12 +16185,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", + " pm.expect(jsonData.id).to.eql(wizardPageId);", "});", "" ], @@ -14744,60 +16199,44 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-Registered", + "name": "WizardPage-UpdateWizardPage-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", - "", "var jsonData = pm.response.json();", "", - "function findOptionType(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", - " foundAt = findOptionType(jsonData, callToActionOptionId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", "" ], "type": "text/javascript" @@ -14805,7 +16244,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -14813,40 +16252,143 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Cleanup Registered", + "item": [ { - "name": "CallToActionOption-UpdateCallToActionOption-Registered", + "name": "Project-DeleteProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "eval(pm.environment.get(\"commonTests\"))();", "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject2-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId2}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject3-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14854,23 +16396,68 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" } } }, + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId3}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Cleanup Administrator", + "item": [ + { + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], "url": { "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ @@ -14886,24 +16473,16 @@ "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-Registered", + "name": "Project-DeleteProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14915,63 +16494,35 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", + "value": "{{administratorUserIdentityId}}", "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "File", - "item": [ - { - "name": "Get-Files-Registered", + "name": "User-DeleteUser-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -14979,48 +16530,43 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Post-File-Registered", + "name": "WizardPage-DeleteWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"registeredFileId\", jsonData.id)\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.success;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", "});" ], "type": "text/javascript" @@ -15028,52 +16574,84 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" - } - ] - }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Delete-File-Registered", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ] + }, + { + "name": "Data Officer", + "item": [ + { + "name": "Preparation", + "item": [ + { + "name": "Institution-CreateInstitution", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.ok;\r", + "var institutionName = pm.environment.get(\"institutionName\");", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"createdInstitutionId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Name matches: \" + institutionName, function () {", + " pm.expect(jsonData.name).to.eql(institutionName);", "});" ], "type": "text/javascript" @@ -15081,173 +16659,218 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_DataOfficer-Institution-CreateInstitution\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/File/{{registeredFileId}}", + "raw": "{{apiUrl}}/api/Institution", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{registeredFileId}}" + "Institution" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-Registered", + "name": "User-CreateUserWithoutInstitution", "event": [ { "listen": "test", "script": { "exec": [ + "var userName = pm.environment.get(\"userName\");", + "", "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.environment.set(\"createdUserId\", jsonData.id);", + "pm.environment.set(\"identityId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithoutInstitution@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "User" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Registered", + "name": "User-CreateUserWithInstitution", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var userName = pm.environment.get(\"userName\");", "", - "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"createdUserWithInstitutionId\", jsonData.id);", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", - "});", - "" + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithInstitution@example.com\",\n \"institutionId\": {{institutionIdFromUser}}\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "User" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Registered", + "name": "Project-CreateProject-DifferentInstitution", "event": [ { "listen": "test", "script": { "exec": [ + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"projectId\", jsonData.id);", + "pm.environment.set(\"adminProjectId\", jsonData.id);", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"shortDescription\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"uri\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"role\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -15255,26 +16878,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "Project" ] } }, "response": [] - } - ] - }, - { - "name": "WizardPage", - "item": [ + }, { - "name": "WizardPage-CreateWizardPage-Registered", + "name": "Project-CreateProject-SameInstitution", "event": [ { "listen": "test", @@ -15282,14 +16899,14 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"projectIdWithInstitution\", jsonData.id);", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", @@ -15305,12 +16922,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "9996" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"shortDescription\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"uri\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"role\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -15318,56 +16935,53 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Project" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-Registered", + "name": "Highlight-CreateHighlight", "event": [ { "listen": "test", "script": { "exec": [ - "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findOption(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"highlightId\", jsonData.id);", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", "" ], "type": "text/javascript" @@ -15375,29 +16989,38 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_DataOfficer-Highlight-CreateHighlight\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Highlight" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Registered", + "name": "Embed-CreateEmbed-DifferentInstitution", "event": [ { "listen": "test", @@ -15405,54 +17028,57 @@ "exec": [ "var jsonData = pm.response.json();", "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", - "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Embed" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Registered", + "name": "Embed-CreateEmbed-SameInstitution", "event": [ { "listen": "test", @@ -15460,35 +17086,34 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"embedGuidWithInstitution\", jsonData.guid);", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "9996" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "raw": "{\r\n \"projectId\": {{projectIdWithInstitution}}\r\n}", "options": { "raw": { "language": "json" @@ -15496,53 +17121,65 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Embed" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup Registered", - "item": [ + }, { - "name": "Project-DeleteProject-Registered", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", "options": { "raw": { "language": "json" @@ -15550,43 +17187,49 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "CallToActionOption" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup Administrator", - "item": [ + }, { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"wizardPageId\", jsonData.id);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -15594,71 +17237,140 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage" ] } }, "response": [] + } + ], + "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-DeleteProject-Administrator", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "User", + "item": [ + { + "name": "User-CreateUser-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\",\n \"institutionId\": {{createdInstitutionId}}\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "User" ] } }, "response": [] }, { - "name": "User-DeleteUser-Administrator", + "name": "User-UpdateUser-SelfWithSameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "", + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", + " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", + "});", + "", + "pm.test(\"Check if institution id is 1\", function () {", + " pm.expect(jsonData.institution.id).to.equal(1);", "});" ], "type": "text/javascript" @@ -15666,146 +17378,141 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{createdUserId}}" + "{{dataOfficerUserId}}" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "User-UpdateUser-SelfWithWrongInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", - "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", - "});" + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Instance guid should be: DD72C521-1D06-4E11-A0E0-AAE515E7F900\", function () {", + " pm.expect(jsonData.instance).to.equal(\"DD72C521-1D06-4E11-A0E0-AAE515E7F900\");", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\",\r\n \"institutionId\": {{createdInstitutionId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "User", + "{{dataOfficerUserId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - } - ] - }, - { - "name": "Data Officer", - "item": [ - { - "name": "Preparation", - "item": [ - { - "name": "Institution-CreateInstitution", + "name": "User-UpdateUser-OtherWithSameInstitution-SameInstitutionId-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var institutionName = pm.environment.get(\"institutionName\");", - "", "var jsonData = pm.response.json();", + "var institutionId = pm.environment.get(\"institutionIdFromUser\");", "", - "pm.environment.set(\"createdInstitutionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Name matches: \" + institutionName, function () {", - " pm.expect(jsonData.name).to.eql(institutionName);", - "});" + "pm.test(\"Institution Id is \" + institutionId, function() {", + " pm.expect(jsonData.institution.id).to.equal(parseInt(institutionId));", + "})" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_DataOfficer-Institution-CreateInstitution\"\n}", + "raw": "{\r\n \"name\": \"User-UpdateUser-OtherWithSameInstitution\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"institutionId\": {{institutionIdFromUser}},\r\n \"identityId\": \"9996\"\r\n}", "options": { "raw": { "language": "json" @@ -15813,108 +17520,87 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Institution", + "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution" + "User", + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "User-CreateUserWithoutInstitution", + "name": "User-GetUser-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var userName = pm.environment.get(\"userName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"createdUserId\", jsonData.id);", - "pm.environment.set(\"identityId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Username matches: \" + userName, function () {", - " pm.expect(jsonData.name).to.eql(userName);", - "});" + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithoutInstitution@example.com\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "User", + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "User-CreateUserWithInstitution", + "name": "User-UpdateUser-Other-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var userName = pm.environment.get(\"userName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"createdUserWithInstitutionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Username matches: \" + userName, function () {", - " pm.expect(jsonData.name).to.eql(userName);", "});" ], "type": "text/javascript" @@ -15922,17 +17608,17 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithInstitution@example.com\",\n \"institutionId\": {{institutionIdFromUser}}\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": \"99966\"\r\n}", "options": { "raw": { "language": "json" @@ -15940,184 +17626,169 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Project-CreateProject-DifferentInstitution", + "name": "User-GetUser-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", - "var projectName = pm.environment.get(\"projectName\");", - "var adminUserName = pm.environment.get(\"adminUserName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"projectId\", jsonData.id);", - "pm.environment.set(\"adminProjectId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", - "});", - "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"shortDescription\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"uri\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\",\r\n \"role\": \"postmantest_DataOfficer-Project-CreateProject-DifferentInstitution\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Project-CreateProject-SameInstitution", + "name": "User-GetUser-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var aliceIdentityId = parseInt(pm.environment.get(\"dataOfficerUserIdentityId\"));", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"dataOfficerUserId\", jsonData.id);", "", - "pm.environment.set(\"projectIdWithInstitution\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "pm.test(\"Identity ID is correct and matching: \" + aliceIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(aliceIdentityId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "9996" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"shortDescription\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"uri\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\",\r\n \"role\": \"postmantest_DataOfficer-Project-CreateProject-SameInstitution\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User" ] } }, "response": [] + } + ], + "description": "Requests executed as the Alice user with the registered role.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Highlight-CreateHighlight", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Category", + "item": [ + { + "name": "Category-CreateCategory-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "" ], "type": "text/javascript" @@ -16130,12 +17801,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_DataOfficer-Highlight-CreateHighlight\"\r\n}", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", "options": { "raw": { "language": "json" @@ -16143,39 +17814,59 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Category" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-DifferentInstitution", + "name": "Category-GetAllCategories-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var categoryName = pm.environment.get(\"categoryName\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "var foundAt;", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "function findCategory(jsonData, name) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", + " foundAt = findCategory(jsonData, categoryName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", + " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -16183,55 +17874,52 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Category" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-SameInstitution", + "name": "Category-GetCategory-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuidWithInstitution\", jsonData.guid);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Tag name is set correctly and matches: \" + categoryName, function () {", + " pm.expect(jsonData.name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -16239,83 +17927,63 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "9996" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectIdWithInstitution}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "Category-UpdateCategory-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", - "" + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", "options": { "raw": { "language": "json" @@ -16323,20 +17991,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "Category-DeleteCategory-DataOfficer", "event": [ { "listen": "test", @@ -16344,59 +18013,46 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] } ], - "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", "event": [ { "listen": "prerequest", @@ -16419,29 +18075,40 @@ ] }, { - "name": "User", + "name": "Project", "item": [ { - "name": "User-CreateUser-DataOfficer", + "name": "Project-CreateProject-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"dataOfficerUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "var fileId = pm.environment.get(\"generalFileId\");", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", - "" + "", + "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", + "});", + "", + "pm.test(\"Image should be stored\", function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", + " pm.expect(jsonData.images.length).to.eql(1);", + "})" ], "type": "text/javascript" } @@ -16458,7 +18125,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\",\n \"institutionId\": {{createdInstitutionId}}\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"uri\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"role\": \"postmantest_Project-CreateProject-DataOfficer\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -16466,109 +18133,57 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-SelfWithSameInstitution-DataOfficer", + "name": "Project-CreateProject-OneCallToAction-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "var dataOfficerUserId = pm.environment.get(\"dataOfficerUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId2\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", - " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", + "pm.test(\"Identity Id is set correctly and matches: \" + dataOfficerUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(dataOfficerUserId);", "});", "", - "pm.test(\"Check if institution id is 1\", function () {", - " pm.expect(jsonData.institution.id).to.equal(1);", - "});" + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 1);", + "})" ], "type": "text/javascript" } - } - ], - "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", - "options": { - "raw": { - "language": "json" - } - } }, - "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "User", - "{{dataOfficerUserId}}" - ] - } - }, - "response": [] - }, - { - "name": "User-UpdateUser-SelfWithWrongInstitution-DataOfficer", - "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Instance guid should be: DD72C521-1D06-4E11-A0E0-AAE515E7F900\", function () {", - " pm.expect(jsonData.instance).to.equal(\"DD72C521-1D06-4E11-A0E0-AAE515E7F900\");", - "});", "" ], "type": "text/javascript" @@ -16576,7 +18191,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16586,7 +18201,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\",\r\n \"institutionId\": {{createdInstitutionId}}\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -16594,51 +18209,64 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{dataOfficerUserId}}" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-OtherWithSameInstitution-SameInstitutionId-DataOfficer", + "name": "Project-CreateProject-MultipleCallToActions-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var dataOfficerUserId = pm.environment.get(\"dataOfficerUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", - "var institutionId = pm.environment.get(\"institutionIdFromUser\");", + "pm.environment.set(\"projectId3\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"Institution Id is \" + institutionId, function() {", - " pm.expect(jsonData.institution.id).to.equal(parseInt(institutionId));", + "pm.test(\"Identity Id is set correctly and matches: \" + dataOfficerUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(dataOfficerUserId);", + "});", + "", + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 2);", "})" ], "type": "text/javascript" } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16648,7 +18276,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"User-UpdateUser-OtherWithSameInstitution\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"institutionId\": {{institutionIdFromUser}},\r\n \"identityId\": \"9996\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction2-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -16656,39 +18284,46 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Other-SameInstitution-DataOfficer", + "name": "Project-CreateProject-CallToActionValueInvalid-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -16696,7 +18331,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16704,47 +18339,64 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"postmantest_Project\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-DataOfficer", + "name": "Project-CreateProject-CallToActionLimitExceeded-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16754,7 +18406,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": \"99966\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Provide feedback\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"More information\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Get in touch\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -16762,39 +18414,46 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Other-DifferentInstitution-DataOfficer", + "name": "Project-CreateProject-CallToActionSameAction-Data Officer", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -16802,7 +18461,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16810,31 +18469,49 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"role\": \"postmantest_Project-CreateProject-Administrator\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Self-DataOfficer", + "name": "Project-GetAllProjects-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var aliceIdentityId = parseInt(pm.environment.get(\"dataOfficerUserIdentityId\"));", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"dataOfficerUserId\", jsonData.id);", + "", + "var foundAt;", + "", + "function findProject(jsonData, name) {", + " for (var i = 0; i < jsonData.results.length; i++) {", + " if (jsonData.results[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -16843,13 +18520,18 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Identity ID is correct and matching: \" + aliceIdentityId, function () {", - " pm.expect(parseInt(jsonData.identityId)).to.eql(aliceIdentityId);", + "pm.test(\"Project: \" + projectName + \" is in list\", function () {", + " foundAt = findProject(jsonData, projectName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -16866,73 +18548,51 @@ } ], "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] - } - ], - "description": "Requests executed as the Alice user with the registered role.", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Category", - "item": [ - { - "name": "Category-CreateCategory-DataOfficer", + "name": "Project-GetProject-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "" + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -16940,50 +18600,27 @@ "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-DataOfficer", + "name": "Project-GetProject-Other-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryName\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findCategory(jsonData, name) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -16994,15 +18631,6 @@ " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", - " foundAt = findCategory(jsonData, categoryName);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "", - "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -17019,26 +18647,27 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Category-GetCategory-DataOfficer", + "name": "Project-UpdateProject-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "var projectName = pm.environment.get(\"projectNameUpdated\");", "", "var jsonData = pm.response.json();", "", @@ -17049,44 +18678,58 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Tag name is set correctly and matches: \" + categoryName, function () {", - " pm.expect(jsonData.name).to.eql(categoryName);", - "});" + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", + "", + "pm.test(\"Images are removed\", function () {", + " pm.expect(jsonData.projectIcon).to.eql(null);", + " pm.expect(jsonData.images.length).to.eql(0);", + "})" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", "value": "{{dataOfficerUserIdentityId}}" } - ], + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"shortDescription\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"uri\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"role\": \"postmantest_Project-UpdateProject-Self-DataOfficer\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Category-UpdateCategory-DataOfficer", + "name": "Project-UpdateProject-Other-DataOfficer", "event": [ { "listen": "test", @@ -17094,12 +18737,12 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -17119,7 +18762,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", "options": { "raw": { "language": "json" @@ -17127,46 +18770,47 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-DataOfficer", + "name": "Project-LikeProject-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17175,83 +18819,48 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Project", - "item": [ - { - "name": "Project-CreateProject-DataOfficer", + "name": "Project-DeleteLikeProject-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var registeredUserId = pm.environment.get(\"dataOfficerUserId\");", - "var projectName = pm.environment.get(\"projectName\");", - "var fileId = pm.environment.get(\"generalFileId\");", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId\", jsonData.id);", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", - " pm.expect(jsonData.user.id).to.eql(registeredUserId);", - "});", - "", - "pm.test(\"Image should be stored\", function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", - " pm.expect(jsonData.images.length).to.eql(1);", - "})" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -17259,69 +18868,35 @@ "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"uri\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-DataOfficer\",\r\n \"role\": \"postmantest_Project-CreateProject-DataOfficer\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-GetAllProjects-DataOfficer", + "name": "Project-DeleteProject-Other-OtherInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findProject(jsonData, name) {", - " for (var i = 0; i < jsonData.results.length; i++) {", - " if (jsonData.results[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -17329,7 +18904,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -17338,66 +18913,88 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "{{projectToBeDeletedByUnauthorizedRoles}}" ] } }, "response": [] }, { - "name": "Project-GetProject-Self-DataOfficer", + "name": "Project-MakeInstitutionPrivate-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "pm.test(\"instituteprivate is set correctly\", function(){\r", + " pm.expect(jsonData.institutePrivate).to.eql(true);\r", + "})\r", + "\r", + "pm.test(\"institute is added\", function(){\r", + " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", + "instituteprivate", "{{projectId}}" ] } @@ -17405,176 +19002,184 @@ "response": [] }, { - "name": "Project-GetProject-Other-DataOfficer", + "name": "Project-MakeInstitutionPrivate-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.ok;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});\r", + "\r", + "pm.test(\"instituteprivate is set correctly\", function(){\r", + " pm.expect(jsonData.institutePrivate).to.eql(false);\r", + "})\r", + "\r", + "pm.test(\"institute is added\", function(){\r", + " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "false\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{adminProjectId}}" + "instituteprivate", + "{{projectToMakePrivateId}}" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Self-DataOfficer", + "name": "Project-LinkInstitutionToProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", - "", - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"Images are removed\", function () {", - " pm.expect(jsonData.projectIcon).to.eql(null);", - " pm.expect(jsonData.images.length).to.eql(0);", - "})" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 403\", function () {\r", + " pm.response.to.have.status(403);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.forbidden;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"shortDescription\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"uri\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-UpdateProject-Self-DataOfficer\",\r\n \"role\": \"postmantest_Project-UpdateProject-Self-DataOfficer\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{projectId}}" + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Other-DataOfficer", + "name": "Project-UnlinkInstitution-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 403\", function () {\r", + " pm.response.to.have.status(403);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.forbidden\r", + "});\r", + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{adminProjectId}}" + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] - }, + } + ] + }, + { + "name": "CategorizeProject", + "item": [ { - "name": "Project-LikeProject-DataOfficer", + "name": "Project-CategorizeProject-Self-DataOfficer", "event": [ { "listen": "test", @@ -17592,8 +19197,7 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", - "" + "});" ], "type": "text/javascript" } @@ -17609,22 +19213,23 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "like", - "{{projectId}}" + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-DataOfficer", + "name": "Project-CategorizeProject-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", @@ -17642,15 +19247,14 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17659,34 +19263,34 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "like", - "{{projectId}}" + "category", + "{{projectIdWithInstitution}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Other-OtherInstitution-DataOfficer", + "name": "Project-CategorizeProject-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", "});" ], "type": "text/javascript" @@ -17694,7 +19298,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17703,21 +19307,23 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{projectToBeDeletedByUnauthorizedRoles}}" + "category", + "{{projectToBeDeletedByUnauthorizedRoles}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-DataOfficer", + "name": "Project-UncategorizeProject-Self-DataOfficer", "event": [ { "listen": "test", @@ -17735,64 +19341,39 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", - "\r", - "pm.test(\"instituteprivate is set correctly\", function(){\r", - " pm.expect(jsonData.institutePrivate).to.eql(true);\r", - "})\r", - "\r", - "pm.test(\"institute is added\", function(){\r", - " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", - "})" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{projectId}}" + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-SameInstitution-DataOfficer", + "name": "Project-UncategorizeProject-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", @@ -17810,64 +19391,39 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", - "\r", - "pm.test(\"instituteprivate is set correctly\", function(){\r", - " pm.expect(jsonData.institutePrivate).to.eql(false);\r", - "})\r", - "\r", - "pm.test(\"institute is added\", function(){\r", - " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", - "})" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "false\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{projectToMakePrivateId}}" + "category", + "{{projectIdWithInstitution}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Registered", + "name": "Project-UncategorizeProject-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", @@ -17877,14 +19433,8 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.forbidden;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "pm.test(\"Status code is 401\", function () {\r", + " pm.response.to.have.status(401);\r", "});" ], "type": "text/javascript" @@ -17892,46 +19442,58 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "category", + "{{projectToBeDeletedByUnauthorizedRoles}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Embed", + "item": [ { - "name": "Project-UnlinkInstitution-Registered", + "name": "Embed-CreateEmbed-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.forbidden\r", - "});\r", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", "" ], "type": "text/javascript" @@ -17939,54 +19501,55 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Embed" ] } }, "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ + }, { - "name": "Project-CategorizeProject-Self-DataOfficer", + "name": "Embed-CreateEmbed-Other-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18002,41 +19565,47 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-SameInstitution-DataOfficer", + "name": "Embed-GetAllEmbeds-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18044,7 +19613,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -18053,34 +19622,43 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdWithInstitution}}", - "{{categoryIdToBeCategorized}}" + "Embed" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-DifferentInstitution-DataOfficer", + "name": "Embed-GetEmbed-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", + "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", + "", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", "});" ], "type": "text/javascript" @@ -18088,7 +19666,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -18097,40 +19675,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectToBeDeletedByUnauthorizedRoles}}", - "{{categoryIdToBeCategorized}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Self-DataOfficer", + "name": "Embed-DeleteEmbed-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -18147,40 +19718,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Other-SameInstitution-DataOfficer", + "name": "Embed-DeleteEmbed-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.ok;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -18197,34 +19761,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdWithInstitution}}", - "{{categoryIdToBeCategorized}}" + "Embed", + "{{adminEmbedGuid}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Other-DifferentInstitution-DataOfficer", + "name": "Embed-DeleteEmbed-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 401\", function () {\r", - " pm.response.to.have.status(401);\r", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -18241,16 +19804,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuidWithInstitution}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectToBeDeletedByUnauthorizedRoles}}", - "{{categoryIdToBeCategorized}}" + "Embed", + "{{embedGuidWithInstitution}}" ] } }, @@ -18259,10 +19820,10 @@ ] }, { - "name": "Embed", + "name": "Highlight", "item": [ { - "name": "Embed-CreateEmbed-Self-DataOfficer", + "name": "Highlight-CreateHighlight-DataOfficer", "event": [ { "listen": "test", @@ -18270,77 +19831,31 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } }, - "url": { - "raw": "{{apiUrl}}/api/Embed", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Embed" - ] - } - }, - "response": [] - }, - { - "name": "Embed-CreateEmbed-Other-DataOfficer", - "event": [ { - "listen": "test", + "listen": "prerequest", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "" ], "type": "text/javascript" } @@ -18357,7 +19872,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -18365,37 +19880,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-DataOfficer", + "name": "Highlight-GetAllActiveHighlights-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var projectId = pm.environment.get(\"adminProjectId\");", + "", "var jsonData = pm.response.json();", "", + "var foundAt;", + "", + "function findItem(jsonData, item) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].project.id == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Highlight is in list and matching: \" + projectId, function () {", + " foundAt = findItem(jsonData, projectId);", + " pm.expect(foundAt).to.not.eql(-1);", "});" ], "type": "text/javascript" @@ -18412,29 +19945,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-DataOfficer", + "name": "Highlight-GetHighlight-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", "", "var jsonData = pm.response.json();", "", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -18447,8 +19984,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", - " pm.expect(jsonData.id).to.eql(embeddedProjectId);", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -18465,41 +20002,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Self-DataOfficer", + "name": "Highlight-GetHighlight-ByProject-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", + "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});", + "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - "});" + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -18508,33 +20051,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Highlight", + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-DifferentInstitution-DataOfficer", + "name": "Highlight-UpdateHighlight-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18542,42 +20091,51 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{adminEmbedGuid}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-SameInstitution-DataOfficer", + "name": "Highlight-DeleteHighlight-Other-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.forbidden;", "});" ], "type": "text/javascript" @@ -18594,14 +20152,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuidWithInstitution}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuidWithInstitution}}" + "Highlight", + "{{highlightId}}" ] } }, @@ -18610,10 +20168,10 @@ ] }, { - "name": "Highlight", + "name": "Role", "item": [ { - "name": "Highlight-CreateHighlight-DataOfficer", + "name": "Role-CreateRole-DataOfficer", "event": [ { "listen": "test", @@ -18635,20 +20193,6 @@ ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", - "" - ], - "type": "text/javascript" - } } ], "request": { @@ -18662,7 +20206,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -18670,55 +20214,37 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Role" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-DataOfficer", + "name": "Role-GetAllRoles-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var projectId = pm.environment.get(\"adminProjectId\");", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", - "", - "function findItem(jsonData, item) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].project.id == item) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Highlight is in list and matching: \" + projectId, function () {", - " foundAt = findItem(jsonData, projectId);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18735,47 +20261,37 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Role" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-DataOfficer", + "name": "Scope-GetAllScopes-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", - "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18792,21 +20308,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-ByProject-DataOfficer", + "name": "Role-GetRole-DataOfficer", "event": [ { "listen": "test", @@ -18821,11 +20337,10 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } @@ -18841,22 +20356,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-DataOfficer", + "name": "Role-UpdateRole-DataOfficer", "event": [ { "listen": "test", @@ -18885,13 +20399,13 @@ "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", + "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -18899,33 +20413,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Other-DataOfficer", + "name": "Role-SetRole-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18933,7 +20452,7 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -18941,44 +20460,55 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Role", + "setRole" + ], + "query": [ + { + "key": "createdUserId", + "value": "{{createdUserId}}", + "description": "Id of the user that we want to update" + }, + { + "key": "roleId", + "value": "{{roleId}}", + "description": "Id of the role that you want to update the user with" + } ] } }, "response": [] - } - ] - }, - { - "name": "Role", - "item": [ + }, { - "name": "Role-CreateRole-DataOfficer", + "name": "Role-DeleteRole-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -18986,7 +20516,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -18994,45 +20524,40 @@ "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Role", + "{{roleId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "Role-GetAllRoles-DataOfficer", + "name": "Search-SearchInternal-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19051,20 +20576,31 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Search", + "internal", + "{{projectName}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Wizard", + "item": [] + }, + { + "name": "Institution", + "item": [ { - "name": "Scope-GetAllScopes-DataOfficer", + "name": "Institution-CreateInstitution-DataOfficer", "event": [ { "listen": "test", @@ -19074,45 +20610,51 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "User" ] } }, "response": [] }, { - "name": "Role-GetRole-DataOfficer", + "name": "Institution-GetInstitution-DataOfficer", "event": [ { "listen": "test", @@ -19122,12 +20664,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19137,30 +20679,27 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "Role-UpdateRole-DataOfficer", + "name": "Institution-UpdateInstitution-DataOfficer", "event": [ { "listen": "test", @@ -19170,12 +20709,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19185,17 +20724,14 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "PUT", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], + "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", "options": { "raw": { "language": "json" @@ -19203,21 +20739,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "Role-SetRole-DataOfficer", + "name": "Instituiton-DeleteInstitution-DataOfficer", "event": [ { "listen": "test", @@ -19227,12 +20763,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19242,104 +20778,129 @@ } ], "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"createdUserId\": {{createdUserId}},\r\n \"name\": \"{{projectNameUpdated}}\",\r\n \"description\": \"postmantest_description\",\r\n \"shortDescription\": \"postmantest_shortdesc\",\r\n \"uri\": \"postmantest_uri\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_collfullname\",\r\n \"role\": \"postmantest_collrole\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, + "method": "DELETE", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "setRole" - ], - "query": [ - { - "key": "createdUserId", - "value": "{{createdUserId}}", - "description": "Id of the user that we want to update" - }, - { - "key": "roleId", - "value": "{{roleId}}", - "description": "Id of the role that you want to update the user with" - } + "User", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Role-DeleteRole-DataOfficer", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "CallToActionOption", + "item": [ + { + "name": "CallToActionOption-CreateCallToActionOption-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", "pm.test(\"Response must be valid and have a json body\", function () {", " pm.response.to.be.forbidden;", - "});" + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "CallToActionOption" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-DataOfficer", + "name": "CallToActionOption-GetAllCallToActionOptions-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", + "", + "function findOption(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -19350,7 +20911,13 @@ " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", + " foundAt = findOption(jsonData, optionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } @@ -19366,31 +20933,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectName}}" + "CallToActionOption" ] } }, "response": [] - } - ] - }, - { - "name": "Wizard", - "item": [] - }, - { - "name": "Institution", - "item": [ + }, { - "name": "Institution-CreateInstitution-DataOfficer", + "name": "CallToActionOption-GetCallToActionOptionById-DataOfficer", "event": [ { "listen": "test", @@ -19398,17 +20954,27 @@ "exec": [ "var jsonData = pm.response.json();", "", + "pm.environment.set(\"callToActionOptionType\", jsonData.type);", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", + "", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", "" ], "type": "text/javascript" @@ -19416,80 +20982,96 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\n}", - "options": { - "raw": { - "language": "json" - } + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } - }, + ], "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-DataOfficer", + "name": "CallToActionOption-GetCallToActionOptionByType-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "", "var jsonData = pm.response.json();", "", + "function findOptionType(jsonData, id) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].id == id) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] }, { - "name": "Institution-UpdateInstitution-DataOfficer", + "name": "CallToActionOption-UpdateCallToActionOption-DataOfficer", "event": [ { "listen": "test", @@ -19499,12 +21081,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19514,14 +21096,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "PUT", - "header": [], + "header": [ + { + "key": "IdentityId", + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", "options": { "raw": { "language": "json" @@ -19529,21 +21114,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Instituiton-DeleteInstitution-DataOfficer", + "name": "CallToActionOption-DeleteCallToActionOption-DataOffficer", "event": [ { "listen": "test", @@ -19553,12 +21138,12 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -19569,25 +21154,28 @@ ], "request": { "method": "DELETE", - "header": [], + "header": [ + { + "key": "IdentityId", + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" + } + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] } ], - "auth": { - "type": "noauth" - }, "event": [ { "listen": "prerequest", @@ -19610,29 +21198,29 @@ ] }, { - "name": "CallToActionOption", + "name": "File", "item": [ { - "name": "CallToActionOption-CreateCallToActionOption-DataOfficer", + "name": "Post-File-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + "var jsonData = pm.response.json();\r", + "\r", + "pm.environment.set(\"dataOfficerFileId\", jsonData.id)\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" ], "type": "text/javascript" } @@ -19648,73 +21236,95 @@ } ], "body": { - "mode": "raw", - "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", - "options": { - "raw": { - "language": "json" + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" } - } + ] }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "File" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-DataOfficer", + "name": "Get-Files-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findOption(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", - " foundAt = findOption(jsonData, optionId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "" + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid and have a json body\", function () {\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File" + ] + } + }, + "response": [] + }, + { + "name": "Delete-File-DataOfficer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Response must be valid\", function () {\r", + " pm.response.to.be.ok;\r", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -19723,20 +21333,26 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/File/{{dataOfficerFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "File", + "{{dataOfficerFileId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "WizardPage", + "item": [ { - "name": "CallToActionOption-GetCallToActionOptionById-DataOfficer", + "name": "WizardPage-CreateWizardPage-DataOfficer", "event": [ { "listen": "test", @@ -19744,27 +21360,17 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionType\", jsonData.type);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", "" ], "type": "text/javascript" @@ -19772,40 +21378,50 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-DataOfficer", + "name": "WizardPage-GetAllWizardPages-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", "", "var jsonData = pm.response.json();", "", - "function findOptionType(jsonData, id) {", + "var foundAt;", + "", + "function findOption(jsonData, id) {", " for (var i = 0; i < jsonData.length; i++) {", " if (jsonData[i].id == id) {", " return i;", @@ -19826,8 +21442,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", - " foundAt = findOptionType(jsonData, callToActionOptionId);", + "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", + " foundAt = findOption(jsonData, pageId);", " pm.expect(foundAt).to.not.eql(-1);", "});", "" @@ -19846,22 +21462,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "WizardPage" ] } }, "response": [] }, { - "name": "CallToActionOption-UpdateCallToActionOption-DataOfficer", + "name": "WizardPage-GetWizardPageById-DataOfficer", "event": [ { "listen": "test", @@ -19869,56 +21483,54 @@ "exec": [ "var jsonData = pm.response.json();", "", + "var wizardPageId = pm.environment.get(\"wizardPageId\");", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", + " pm.expect(jsonData.id).to.eql(wizardPageId);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-DataOffficer", + "name": "WizardPage-UpdateWizardPage-DataOfficer", "event": [ { "listen": "test", @@ -19936,135 +21548,70 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } ] }, { - "name": "File", + "name": "DataSource", "item": [ { - "name": "Post-File-DataOfficer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"dataOfficerFileId\", jsonData.id)\r", - "\r", - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" - } - ], - "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" - } - ] - }, - "url": { - "raw": "{{apiUrl}}/api/File", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "File" - ] - } - }, - "response": [] - }, - { - "name": "Get-Files-DataOfficer", + "name": "DataSource-GetAllDataSources-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid and have a json body\", function () {\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", - "});" + "var jsonData = pm.response.json();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "" ], "type": "text/javascript" } @@ -20075,46 +21622,57 @@ "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "DataSource" ] } }, "response": [] }, { - "name": "Delete-File-DataOfficer", + "name": "WizardPage-GetWizardPageById-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();\r", - "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response must be valid\", function () {\r", - " pm.response.to.be.ok;\r", - "});" + "var jsonData = pm.response.json();", + "", + "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -20123,26 +21681,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/File/{{dataOfficerFileId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{dataOfficerFileId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] - } - ] - }, - { - "name": "WizardPage", - "item": [ + }, { - "name": "WizardPage-CreateWizardPage-DataOfficer", + "name": "WizardPage-UpdateWizardPage-DataOfficer", "event": [ { "listen": "test", @@ -20168,17 +21721,18 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", "options": { "raw": { "language": "json" @@ -20186,40 +21740,31 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Cleanup Data Officer", + "item": [ { - "name": "WizardPage-GetAllWizardPages-DataOfficer", + "name": "Project-DeleteProject-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", - "", - "var jsonData = pm.response.json();", - "", - "var foundAt;", - "", - "function findOption(jsonData, id) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].id == id) {", - " return i;", - " }", - " }", - " return -1;", - "}", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -20228,22 +21773,14 @@ "", "pm.test(\"Response must be valid and have a json body\", function () {", " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -20252,52 +21789,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-DataOfficer", + "name": "Project-DeleteProject2-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -20305,48 +21828,48 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Project", + "{{projectId2}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-DataOfficer", + "name": "Project-DeleteProject3-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -20356,7 +21879,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -20364,33 +21887,76 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Project", + "{{projectId3}}" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-DataOfficer", + "name": "Project-DeleteProject-Other-SameInstitution-DataOfficer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.ok;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectIdWithInstitution}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectIdWithInstitution}}" + ] + } + }, + "response": [] + }, + { + "name": "User-UpdateUser-SelfWithNoInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "", "var jsonData = pm.response.json();", "", + "eval(pm.environment.get(\"commonTests\"))();", + "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", @@ -20401,14 +21967,20 @@ " pm.response.to.be.json;", "});", "", - "" + "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", + " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", + "});", + "", + "pm.test(\"Check if institution is null\", function () {", + " pm.expect(jsonData.institution).to.equal(null);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -20416,45 +21988,66 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "User", + "{{dataOfficerUserId}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "WizardPage-GetWizardPageById-DataOfficer", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Cleanup Administrator", + "item": [ + { + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "var dataSourceId = pm.environment.get(\"dataSourceId\");", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", - "});", "" ], "type": "text/javascript" @@ -20462,94 +22055,70 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-DataOfficer", + "name": "Project-DeleteProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "" + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}", - "disabled": true + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"Title\": \"{{updatedDataSourceName}}\",\r\n \"description\": \"postmantest_DataSource-UpdateDataSource-Administrator\",\r\n \"IsVisible\": true,\r\n \"IconId\": 0,\r\n \"WizardPageResources\": null\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup Data Officer", - "item": [ + }, { - "name": "Project-DeleteProject-Self-DataOfficer", + "name": "Institution-DeleteInstitution-Administrator", "event": [ { "listen": "test", @@ -20559,10 +22128,6 @@ "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -20575,25 +22140,25 @@ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Institution", + "{{createdInstitutionId}}" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Other-SameInstitution-DataOfficer", + "name": "User-DeleteUser-Other-SameInstitution-Administrator", "event": [ { "listen": "test", @@ -20619,34 +22184,30 @@ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectIdWithInstitution}}", + "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectIdWithInstitution}}" + "User", + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "User-UpdateUser-SelfWithNoInstitution-DataOfficer", + "name": "User-DeleteUser-Other-DifferentInstitution-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", - "", - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -20655,16 +22216,6 @@ "", "pm.test(\"Response must be valid and have a json body\", function () {", " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if email update matches: \" + updatedAliceEmail, function () {", - " pm.expect(jsonData.email).to.eql(updatedAliceEmail);", - "});", - "", - "pm.test(\"Check if institution is null\", function () {", - " pm.expect(jsonData.institution).to.equal(null);", "});" ], "type": "text/javascript" @@ -20672,75 +22223,44 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{dataOfficerUserId}}" + "{{createdUserId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Cleanup Administrator", - "item": [ - { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "WizardPage-DeleteWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});", - "" + "", + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", + "});" ], "type": "text/javascript" } @@ -20756,70 +22276,131 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] - }, + } + ] + } + ] + }, + { + "name": "PR", + "item": [ + { + "name": "Preparation", + "item": [ { - "name": "Project-DeleteProject-Administrator", + "name": "User-CreateUser", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var userName = pm.environment.get(\"userName\");", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"createdUserId\", jsonData.id);", + "pm.environment.set(\"identityId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_PR-User-CreateUser@example.com\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "User" ] } }, "response": [] }, { - "name": "Institution-DeleteInstitution-Administrator", + "name": "Project-CreateProject", "event": [ { "listen": "test", "script": { "exec": [ + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", + "", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"projectId\", jsonData.id);", + "pm.environment.set(\"adminProjectId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", + "});", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", + " pm.expect(jsonData.user.name).to.eql(adminUserName);", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", "});" ], "type": "text/javascript" @@ -20827,7 +22408,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -20835,43 +22416,71 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_PR-Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_PR-Project-CreateProject\",\r\n \"uri\": \"postmantest_PR-Project-CreateProject\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_PR-Project-CreateProject\",\r\n \"role\": \"postmantest_PR-Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "Project" ] } }, "response": [] }, { - "name": "User-DeleteUser-Other-SameInstitution-Administrator", + "name": "Highlight-CreateHighlight", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"highlightId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "\r", + "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", + "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "" + ], + "type": "text/javascript" + } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -20879,35 +22488,48 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_PR-Highlight-CreateHighlight\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "Highlight" ] } }, "response": [] }, { - "name": "User-DeleteUser-Other-DifferentInstitution-Administrator", + "name": "Embed-CreateEmbed", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", + "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -20915,7 +22537,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -20923,43 +22545,65 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Embed" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", - "});" + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "});", + "", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -20967,43 +22611,40 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "CallToActionOption" ] } }, "response": [] - } - ] - } - ] - }, - { - "name": "PR", - "item": [ - { - "name": "Preparation", - "item": [ + }, { - "name": "User-CreateUser", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var userName = pm.environment.get(\"userName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"createdUserId\", jsonData.id);", - "pm.environment.set(\"identityId\", jsonData.id);", + "pm.environment.set(\"wizardPageId\", jsonData.id);", + "", + "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", @@ -21015,10 +22656,6 @@ " pm.response.to.be.json;", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Username matches: \" + userName, function () {", - " pm.expect(jsonData.name).to.eql(userName);", - "});", "" ], "type": "text/javascript" @@ -21036,7 +22673,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_PR-User-CreateUser@example.com\"\n}", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", "options": { "raw": { "language": "json" @@ -21044,56 +22681,65 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "WizardPage" ] } }, "response": [] + } + ], + "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-CreateProject", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "User", + "item": [ + { + "name": "User-CreateUser-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", - "var projectName = pm.environment.get(\"projectName\");", - "var adminUserName = pm.environment.get(\"adminUserName\");", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"projectId\", jsonData.id);", - "pm.environment.set(\"adminProjectId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", - "", - "pm.test(\"User Name is correct and matching: \" + adminUserName, function () {", - " pm.expect(jsonData.user.name).to.eql(adminUserName);", - "});", - "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", - "});" + "" ], "type": "text/javascript" } @@ -21105,12 +22751,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{prUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_PR-Project-CreateProject\",\r\n \"shortDescription\": \"postmantest_PR-Project-CreateProject\",\r\n \"uri\": \"postmantest_PR-Project-CreateProject\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_PR-Project-CreateProject\",\r\n \"role\": \"postmantest_PR-Project-CreateProject\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", "options": { "raw": { "language": "json" @@ -21118,53 +22764,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "User-GetUser-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", - "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\r", + "});", "" ], "type": "text/javascript" @@ -21172,56 +22803,54 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postmantest_PR-Highlight-CreateHighlight\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed", + "name": "User-GetUser-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var prUserIdentityId = parseInt(pm.environment.get(\"prUserIdentityId\"));", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"PrUserId\", jsonData.id);", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Identity ID is correct and matching: \" + prUserIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(prUserIdentityId);", "});" ], "type": "text/javascript" @@ -21229,83 +22858,70 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "User" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "User-UpdateUser-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedPrUserEmail = pm.environment.get(\"updatedPrUserEmail\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Call to action option type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", - "});", - "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", - "" + "pm.test(\"Check if email update matches: \" + updatedPrUserEmail, function () {", + " pm.expect(jsonData.email).to.eql(updatedPrUserEmail);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "raw": "{\r\n \"name\": \"postman_Pr_jerry\",\r\n \"email\": \"{{updatedPrUserEmail}}\",\r\n \"identityId\": \"{{prUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", "options": { "raw": { "language": "json" @@ -21313,20 +22929,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/User/{{PrUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "User", + "{{PrUserId}}" ] } }, "response": [] }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "User-UpdateUser-Other-PR", "event": [ { "listen": "test", @@ -21334,38 +22951,34 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", + "pm.test(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", + " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{prUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", "options": { "raw": { "language": "json" @@ -21373,20 +22986,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "User", + "{{createdUserId}}" ] } }, "response": [] } ], - "description": "For some requests, we need to have data available. The variables need to be filled so the request can succeed. We put these preparation requests in this folder. We will clean them up in the cleanup folder.", + "description": "Requests executed as the Alice user with the registered role.", "event": [ { "listen": "prerequest", @@ -21409,29 +23023,33 @@ ] }, { - "name": "User", + "name": "FollowUser", "item": [ { - "name": "User-CreateUser-PR", + "name": "User-FollowUser-PR", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", + "var userId = pm.environment.get(\"userIdToFollow\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", + " pm.response.to.be.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});", - "" + "", + "pm.test(\"Check if created Username matches: \" + userId, function () {", + " pm.expect(jsonData.id).to.eql(userId);", + "});" ], "type": "text/javascript" } @@ -21448,7 +23066,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -21456,37 +23074,31 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] }, { - "name": "User-GetUser-Other-PR", + "name": "User-UnFollowUser-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", - "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "" ], @@ -21495,7 +23107,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -21503,54 +23115,84 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{createdUserId}}" + "follow", + "{{userIdToFollow}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "User-GetUser-Self-PR", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Category", + "item": [ + { + "name": "Category-CreateCategory-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var prUserIdentityId = parseInt(pm.environment.get(\"prUserIdentityId\"));", - "", "var jsonData = pm.response.json();", - "pm.environment.set(\"PrUserId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Identity ID is correct and matching: \" + prUserIdentityId, function () {", - " pm.expect(parseInt(jsonData.identityId)).to.eql(prUserIdentityId);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -21558,29 +23200,49 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Category" ] } }, "response": [] }, { - "name": "User-UpdateUser-Self-PR", + "name": "Category-GetAllCategories-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedPrUserEmail = pm.environment.get(\"updatedPrUserEmail\");", + "var categoryName = pm.environment.get(\"categoryName\");", + "", + "var jsonData = pm.response.json();", + "", + "var foundAt;", "", - "var jsonData = pm.response.json();", + "function findCategory(jsonData, name) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].name == name) {", + " return i;", + " }", + " }", + " return -1;", + "}", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -21589,13 +23251,18 @@ "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if email update matches: \" + updatedPrUserEmail, function () {", - " pm.expect(jsonData.email).to.eql(updatedPrUserEmail);", + "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", + " foundAt = findCategory(jsonData, categoryName);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "", + "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", + " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -21603,56 +23270,52 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"postman_Pr_jerry\",\r\n \"email\": \"{{updatedPrUserEmail}}\",\r\n \"identityId\": \"{{prUserIdentityId}}\",\r\n \"institutionId\": 1\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{PrUserId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{PrUserId}}" + "Category" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-PR", + "name": "Category-GetCategory-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "", + "pm.test(\"Category name is set correctly and matches: \" + categoryName, function () {", + " pm.expect(jsonData.name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -21660,7 +23323,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -21668,79 +23331,37 @@ "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - } - ], - "description": "Requests executed as the Alice user with the registered role.", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "FollowUser", - "item": [ - { - "name": "User-FollowUser-PR", + "name": "Category-UpdateCategory-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "var userId = pm.environment.get(\"userIdToFollow\");", - "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", - "", - "pm.test(\"Check if created Username matches: \" + userId, function () {", - " pm.expect(jsonData.id).to.eql(userId);", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -21748,7 +23369,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -21758,7 +23379,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", "options": { "raw": { "language": "json" @@ -21766,33 +23387,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "User-UnFollowUser-PR", + "name": "Category-DeleteCategory-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", - "" + "", + "pm.test(\"Response must be valid and have a json body\", function () {", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});" ], "type": "text/javascript" } @@ -21807,25 +23434,15 @@ "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, @@ -21854,30 +23471,40 @@ ] }, { - "name": "Category", + "name": "Project", "item": [ { - "name": "Category-CreateCategory-PR", + "name": "Project-CreateProject-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var PrUserId = pm.environment.get(\"PrUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "var fileId = pm.environment.get(\"generalFileId\");", + "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "" + "pm.test(\"User Id is set correctly and matches: \" + PrUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(PrUserId);", + "});", + "", + "pm.test(\"Image should be stored\", function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", + " pm.expect(jsonData.images.length).to.eql(1);", + "})" ], "type": "text/javascript" } @@ -21888,13 +23515,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-PR\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-PR\",\r\n \"uri\": \"postmantest_Project-CreateProject-PR\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-PR\",\r\n \"role\": \"postmantest_Project-CreateProject-PR\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -21902,67 +23529,65 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-PR", + "name": "Project-CreateProject-OneCallToAction-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryName\");", - "", - "var jsonData = pm.response.json();", + "var PrUserId = pm.environment.get(\"PrUserId\");", + "var projectName = pm.environment.get(\"projectName\");", "", - "var foundAt;", "", - "function findCategory(jsonData, name) {", - " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", - " return i;", - " }", - " }", - " return -1;", - "}", + "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId2\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", - " foundAt = findCategory(jsonData, categoryName);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Identity Id is set correctly and matches: \" + PrUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(PrUserId);", "});", "", - "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", - "});" + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 1);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -21970,52 +23595,74 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project" ] } }, "response": [] }, { - "name": "Category-GetCategory-PR", + "name": "Project-CreateProject-MultipleCallToActions-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "var PrUserId = pm.environment.get(\"PrUserId\");", + "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId3\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.ok;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});", "", - "pm.test(\"Category name is set correctly and matches: \" + categoryName, function () {", - " pm.expect(jsonData.name).to.eql(categoryName);", - "});" + "pm.test(\"Identity Id is set correctly and matches: \" + PrUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(PrUserId);", + "});", + "", + "pm.test(\"Call to action is not null\", function() {", + " pm.expect(jsonData.callToActions.length == 2);", + "})" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -22023,45 +23670,64 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction2-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] }, { - "name": "Category-UpdateCategory-PR", + "name": "Project-CreateProject-CallToActionValueInvalid-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -22071,7 +23737,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"postmantest_Project\",\r\n \"value\": \"https://postmantest-calltoaction1-registered.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", "options": { "raw": { "language": "json" @@ -22079,46 +23745,54 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-PR", + "name": "Project-CreateProject-CallToActionLimitExceeded-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", + "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", "", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -22126,77 +23800,57 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Registered\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Registered\",\r\n \"uri\": \"postmantest_Project-CreateProject-Registered\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Registered\",\r\n \"role\": \"postmantest_Project-CreateProject-Registered\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Provide feedback\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Apply now\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"More information\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Get in touch\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": true\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Project", - "item": [ - { - "name": "Project-CreateProject-PR", + "name": "Project-CreateProject-CallToActionSameAction-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var PrUserId = pm.environment.get(\"PrUserId\");", "var projectName = pm.environment.get(\"projectName\");", - "var fileId = pm.environment.get(\"generalFileId\");", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId\", jsonData.id);", - "", - "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"User Id is set correctly and matches: \" + PrUserId, function () {", - " pm.expect(jsonData.user.id).to.eql(PrUserId);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", "});", "", - "pm.test(\"Image should be stored\", function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(fileId);", - " pm.expect(jsonData.images.length).to.eql(1);", - "})" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -22207,13 +23861,13 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-PR\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-PR\",\r\n \"uri\": \"postmantest_Project-CreateProject-PR\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-PR\",\r\n \"role\": \"postmantest_Project-CreateProject-PR\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"IconId\": {{generalFileId}},\r\n \"imageIds\": [\r\n {{generalFileId}}\r\n ]\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"shortDescription\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"uri\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_Project-CreateProject-Administrator\",\r\n \"role\": \"postmantest_Project-CreateProject-Administrator\"\r\n }\r\n ],\r\n \"callToActions\": [\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n },\r\n {\r\n \"optionValue\": \"Join today\",\r\n \"value\": \"https://postmantest-calltoaction1-Administrator.com/\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"institutePrivate\": false\r\n}", "options": { "raw": { "language": "json" @@ -25834,6 +27488,86 @@ } }, "response": [] + }, + { + "name": "Project-DeleteProject2-PR", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId2}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject3-PR", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId3}}" + ] + } + }, + "response": [] } ] }, diff --git a/Postman/local.postman_environment.json b/Postman/local.postman_environment.json index fb773060..22ac3cb8 100644 --- a/Postman/local.postman_environment.json +++ b/Postman/local.postman_environment.json @@ -1,5 +1,5 @@ { - "id": "6f9e8536-54dd-44ad-b5cd-6f44d7c2ce88", + "id": "27c0ab04-e996-4d7f-9ef2-db0b0067c9ef", "name": "Local", "values": [ { @@ -384,10 +384,10 @@ }, { "key": "categoryId", - "value": "", + "value": "", "enabled": true }, - { + { "key": "wizardPageId", "value": "", "enabled": true @@ -409,10 +409,10 @@ }, { "key": "projectIdToCategorize", - "value": "", + "value": "", "enabled": true }, - { + { "key": "updatedWizardPageName", "value": "Updated name", "enabled": true @@ -425,15 +425,30 @@ { "key": "categoryIdToBeCategorized", "value": "", - "enabled": true + "enabled": true }, - { + { "key": "updatedDataSourceName", "value": "Updated name", "enabled": true + }, + { + "key": "projectId2", + "value": "", + "enabled": true + }, + { + "key": "projectId3", + "value": "", + "enabled": true + }, + { + "key": "administratorUserId", + "value": "", + "enabled": true } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2021-03-04T16:48:25.773Z", - "_postman_exported_using": "Postman/7.36.5" -} + "_postman_exported_at": "2021-06-21T10:20:35.533Z", + "_postman_exported_using": "Postman/8.6.2" +} \ No newline at end of file diff --git a/Repositories/ProjectRepository.cs b/Repositories/ProjectRepository.cs index b797e6bb..1ba0ea53 100644 --- a/Repositories/ProjectRepository.cs +++ b/Repositories/ProjectRepository.cs @@ -174,7 +174,7 @@ public override async Task FindAsync(int id) Project project = await GetDbSet() .Where(s => s.Id == id) .Include(p => p.ProjectIcon) - .Include(p => p.CallToAction) + .Include(p => p.CallToActions) .Include(p => p.Images) .SingleOrDefaultAsync(); @@ -215,14 +215,14 @@ public virtual async Task> GetAllWithUsersCollaboratorsAndInstitut ) { IQueryable queryableProjects = GetDbSet() - .Include(u => u.User) - .Include(p => p.ProjectIcon) - .Include(p => p.CallToAction) - .Include(p => p.Collaborators) - .Include(p => p.Likes) - .Include(p => p.LinkedInstitutions) - .Include(p => p.Categories) - .ThenInclude(c => c.Category); + .Include(u => u.User) + .Include(p => p.ProjectIcon) + .Include(p => p.CallToActions) + .Include(p => p.Collaborators) + .Include(p => p.Likes) + .Include(p => p.LinkedInstitutions) + .Include(p => p.Categories) + .ThenInclude(c => c.Category); queryableProjects = ApplyFilters(queryableProjects, skip, take, orderBy, orderByAsc, highlighted, categories); @@ -235,7 +235,7 @@ public virtual async Task> GetAllWithUsersCollaboratorsAndInstitut Id = p.Id, ProjectIconId = p.ProjectIconId, ProjectIcon = p.ProjectIcon, - CallToAction = p.CallToAction, + CallToActions= p.CallToActions, Collaborators = p.Collaborators, Likes = p.Likes, LinkedInstitutions = p.LinkedInstitutions, @@ -323,7 +323,7 @@ public async Task FindWithUserCollaboratorsAndInstitutionsAsync(int id) Project project = await GetDbSet() .Include(p => p.User) .Include(p => p.ProjectIcon) - .Include(p => p.CallToAction) + .Include(p => p.CallToActions) .Include(p => p.Images) .Where(p => p.Id == id) .FirstOrDefaultAsync(); @@ -647,7 +647,7 @@ private async Task> GetProjectQueryable(string query) .Equals(query) || p.User.Name.Contains(query)); projectsToReturn.Include(p => p.ProjectIcon).Load(); - projectsToReturn.Include(p => p.CallToAction).Load(); + projectsToReturn.Include(p => p.CallToActions).Load(); projectsToReturn.Include(p => p.Likes).Load(); projectsToReturn.Include(p => p.Categories).Load();