From 29cc53a4878a4ed3788a8ef375921d5b7d3237d6 Mon Sep 17 00:00:00 2001 From: "Triest,Tristan T.R. van" Date: Fri, 28 May 2021 14:23:43 +0200 Subject: [PATCH 1/7] Added support for multiple call to actions per project. Also added limits for the amount of CTA's and duplicate CTA's. --- API/Controllers/ProjectController.cs | 107 +- API/Resources/ProjectResource.cs | 2 +- API/Resources/ProjectResourceResult.cs | 2 +- API/Resources/ProjectResultResource.cs | 4 +- Data/06_Data.csproj | 5 + ...20743_AddMultipleCallToActions.Designer.cs | 736 + ...20210528120743_AddMultipleCallToActions.cs | 74 + .../ApplicationDbContextModelSnapshot.cs | 21 +- Models/CallToAction.cs | 7 + Models/Project.cs | 2 +- Postman/dex.postman_collection.json | 18336 +++++++++------- Postman/local.postman_environment.json | 30 +- Repositories/ProjectRepository.cs | 10 +- 13 files changed, 11199 insertions(+), 8137 deletions(-) create mode 100644 Data/Migrations/20210528120743_AddMultipleCallToActions.Designer.cs create mode 100644 Data/Migrations/20210528120743_AddMultipleCallToActions.cs diff --git a/API/Controllers/ProjectController.cs b/API/Controllers/ProjectController.cs index be37a42d..6467db72 100644 --- a/API/Controllers/ProjectController.cs +++ b/API/Controllers/ProjectController.cs @@ -330,22 +330,53 @@ 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 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); } + + //This should be refactored. As for much of the code in the controllers, see issue #411 - Refactor controllers. + int maxAmountOfCallToActions = 4; + + if(projectResource.CallToActions.Count > maxAmountOfCallToActions) + { + ProblemDetails problem = new ProblemDetails + { + Title = $"Maximum amount of {maxAmountOfCallToActions} call to actions exceeded.", + Detail = + $"It is not possible to create a project with more than {maxAmountOfCallToActions} 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); @@ -481,22 +512,54 @@ 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 = "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 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); + } + + //This should be refactored. As for much of the code in the controllers, see issue #411 - Refactor controllers. + int maxAmountOfCallToActions = 4; + + if(projectResource.CallToActions.Count > maxAmountOfCallToActions) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Maximum amount of call to actions exceeded.", + Detail = + $"It is not possible to create a project with more than {maxAmountOfCallToActions} 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 e7eabb91..5d0eca45 100644 --- a/API/Resources/ProjectResource.cs +++ b/API/Resources/ProjectResource.cs @@ -59,7 +59,7 @@ public class ProjectResource /// /// This gets or sets the call to action /// - public CallToActionResource CallToAction { get; set; } + public List CallToActions { get; set; } /// /// This gets or sets the institute private property diff --git a/API/Resources/ProjectResourceResult.cs b/API/Resources/ProjectResourceResult.cs index 3955d8e2..ec7bc090 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/06_Data.csproj b/Data/06_Data.csproj index b87ed4e6..0bd5d869 100644 --- a/Data/06_Data.csproj +++ b/Data/06_Data.csproj @@ -11,6 +11,11 @@ + + + + + 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 10a11782..11fccfe2 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"); }); @@ -260,9 +265,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - b.Property("CallToActionId") - .HasColumnType("int"); - b.Property("Created") .HasColumnType("datetime2"); @@ -295,8 +297,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("CallToActionId"); - b.HasIndex("ProjectIconId"); b.HasIndex("UserId"); @@ -545,6 +545,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) @@ -615,10 +622,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 be4c1dba..9cfde3e0 100644 --- a/Models/Project.cs +++ b/Models/Project.cs @@ -70,7 +70,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 4a7333ba..137d2cdc 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "a73f56b6-95d9-4dc6-a648-7ff12a4457a5", + "_postman_id": "24ed191e-3261-40e3-8d9a-c6ac94c55667", "name": "DEV", "description": "Testing Digital Excellence API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -1914,7 +1914,7 @@ "response": [] }, { - "name": "Project-GetAllProjects-Administrator", + "name": "Project-CreateProject-OneCallToAction-Administrator", "event": [ { "listen": "test", @@ -1922,46 +1922,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", @@ -1969,6 +1962,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": [ @@ -1983,49 +1985,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", @@ -2033,54 +2032,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);", - "});", + "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 == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", - "pm.test(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2090,7 +2099,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}", + "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" @@ -2098,57 +2107,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", @@ -2156,88 +2162,56 @@ "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" } - } - ], - "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", + "listen": "prerequest", "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" @@ -2249,138 +2223,160 @@ "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "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/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-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", - "" + "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": "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", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-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 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", + "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" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", "{{projectId}}" ] } @@ -2388,38 +2384,35 @@ "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-Administrator", + "name": "Project-UpdateProject-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 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);", "});" ], "type": "text/javascript" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } } ], "request": { @@ -2427,13 +2420,13 @@ "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}", "options": { "raw": { "language": "json" @@ -2441,150 +2434,97 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{projectToMakePrivateId}}" + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Administrator", + "name": "Project-GetUpdatedProject-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 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": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "{{projectId}}" ] } }, "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", + "name": "Project-GetProject-NonExisting-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(\"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.test(\"Check if created Username matches: \" + projectId, function () {", - " pm.expect(jsonData.id).to.eql(projectId);", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -2592,7 +2532,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -2600,87 +2540,72 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project", + "98989" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-Administrator", + "name": "Project-LikeProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "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", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ + }, { - "name": "Project-CategorizeProject-Administrator", + "name": "Project-DeleteLikeProject-Administrator", "event": [ { "listen": "test", @@ -2706,32 +2631,31 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Administrator", + "name": "Project-MakeInstitutionPrivate-Administrator", "event": [ { "listen": "test", @@ -2741,15 +2665,25 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\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.ok;\r", + " pm.response.to.be.notFound;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});\r", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -2757,60 +2691,59 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "instituteprivate", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Administrator", + "name": "Project-MakeInstitutionPrivate-Other-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;", - "});", - "" + "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" } @@ -2819,11 +2752,6 @@ "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" @@ -2831,17 +2759,17 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "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}", + "raw": "true\r\n", "options": { "raw": { "language": "json" @@ -2849,75 +2777,51 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "instituteprivate", + "{{projectToMakePrivateId}}" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-Administrator", + "name": "Project-LinkInstitutionToProject-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);", - "});" + "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": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -2926,55 +2830,45 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Administrator", + "name": "Project-UnlinkInstitution-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);", - "});" + "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": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -2983,51 +2877,35 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] - }, + } + ] + }, + { + "name": "FollowProject", + "item": [ { - "name": "Highlight-GetHighlight-ByProject-Administrator", + "name": "Project-FollowProject-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;", - "}", + "var projectId = pm.environment.get(\"projectIdToFollow\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -3036,19 +2914,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.test(\"Project is in list and matching: \" + projectId, function () {", - " foundAt = findProjectId(jsonData, projectId);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Highlight is in list and matching:\" + highlightId, function () {", - " foundAt = findHighlightId(jsonData, highlightId);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Check if created Username matches: \" + projectId, function () {", + " pm.expect(jsonData.id).to.eql(projectId);", "});" ], "type": "text/javascript" @@ -3056,7 +2928,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -3064,65 +2936,49 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Administrator", + "name": "Project-UnFollowProject-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "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" } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" - ], - "type": "text/javascript" - } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -3132,7 +2988,7 @@ ], "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}", + "raw": "", "options": { "raw": { "language": "json" @@ -3140,94 +2996,96 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "CategorizeProject", + "item": [ { - "name": "Highlight-GetUpdatedHighlight-Administrator", + "name": "Project-CategorizeProject-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 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);", - "});" + "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": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" - } + "type": "text", + "value": "{{administratorUserIdentityId}}" + } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-NonExisting-Administrator", + "name": "Project-UncategorizeProject-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;", - "});", + "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" @@ -3235,7 +3093,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -3244,14 +3102,16 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/98989", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "98989" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, @@ -3260,19 +3120,20 @@ ] }, { - "name": "Embed", + "name": "Highlight", "item": [ { - "name": "Embed-CreateEmbed-Administrator", + "name": "Highlight-CreateHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "pm.environment.set(\"highlightId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -3289,6 +3150,20 @@ ], "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": { @@ -3302,7 +3177,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "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" @@ -3310,26 +3185,26 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-Administrator", + "name": "Highlight-GetAllActiveHighlights-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var embedGuid = pm.environment.get(\"embedGuid\");", + "var adminProjectId = pm.environment.get(\"adminProjectId\");", "", "var jsonData = pm.response.json();", "", @@ -3337,13 +3212,25 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].guid == item) {", + " if (jsonData[i].projectId == item) {", " return i;", " }", " }", " return -1;", "}", "", + "function findHighlight(jsonData, idToFind){", + " for(var i = 0; i< jsonData.length; i++)", + " {", + " if(jsonData[i].projectId == idToFind) ", + " { ", + " return i; ", + " }", + " }", + " return -1;", + " ", + "}", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -3356,8 +3243,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Embed is in list and matches: \" + embedGuid, function () {", - " foundAt = findItem(jsonData, embedGuid);", + "pm.test(\"Highlight is in list and matching: \" + adminProjectId, function () {", + " foundAt = findHighlight(jsonData, adminProjectId);", " pm.expect(foundAt).to.not.eql(-1);", "});" ], @@ -3370,34 +3257,38 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Administrator", + "name": "Highlight-GetHighlight-Administrator", "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 () {", @@ -3410,8 +3301,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" @@ -3423,45 +3314,78 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-NonExisting-Administrator", + "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].projectId == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", + "", "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.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" } @@ -3477,47 +3401,64 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/cdaadc49-b4b9-4c11-8937-e602174cba30", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "cdaadc49-b4b9-4c11-8937-e602174cba30" + "Highlight", + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-NonExisting-NoGUID-Administrator", + "name": "Highlight-UpdateHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "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 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(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", + "});" + ], + "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": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -3525,57 +3466,55 @@ "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/Embed/98989", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "98989" + "Highlight", + "{{highlightId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Role", - "item": [ + }, { - "name": "Role-CreateRole-Administrator", + "name": "Highlight-GetUpdatedHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var scopeName = pm.environment.get(\"scopeName\");", - "var roleName = pm.environment.get(\"roleName\");", - "", + "var highlightUpdateTimestamp = pm.environment.get(\"current_timestamp\");", + "var highlightEndDate = pm.environment.get(\"highlightEndDate\");", + "var highlightId = pm.environment.get(\"highlightId\");", "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(\"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 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);", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -3583,86 +3522,113 @@ } ], "request": { - "method": "POST", + "method": "GET", "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" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Highlight", + "{{highlightId}}" ] - }, - "description": "Is deleted in the latest cleanup folder" + } }, "response": [] }, { - "name": "Role-GetAllRoles-Administrator", + "name": "Highlight-GetHighlight-NonExisting-Administrator", "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(\"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;", "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight/98989", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "98989" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Embed", + "item": [ + { + "name": "Embed-CreateEmbed-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", "", - "pm.test(\"Role: \" + roleName + \" is in list\", function () {", - " foundAt = findProject(jsonData, roleName);", - " pm.expect(foundAt).to.not.eql(-1);", + "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(\"Role Name is set correctly with matching: \" + roleName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(roleName);", - "});" + "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": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -3670,36 +3636,44 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-Administrator", + "name": "Embed-GetAllEmbeds-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var projectName = pm.environment.get(\"projectName\");", + "var embedGuid = pm.environment.get(\"embedGuid\");", "", "var jsonData = pm.response.json();", "", "var foundAt;", "", - "function findProject(jsonData, name) {", + "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].name == name) {", + " if (jsonData[i].guid == item) {", " return i;", " }", " }", @@ -3716,6 +3690,11 @@ " 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" @@ -3732,28 +3711,26 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Embed" ] } }, "response": [] }, { - "name": "Role-GetRole-Administrator", + "name": "Embed-GetEmbed-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", - "var roleName = pm.environment.get(\"roleName\");", + "var embeddedProjectId = parseInt(pm.environment.get(\"embeddedProjectId\"))", "", "var jsonData = pm.response.json();", "", @@ -3769,8 +3746,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Role Name is set correctly\", function () {", - " pm.expect(jsonData.name).to.eql(roleName);", + "pm.test(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", "});" ], "type": "text/javascript" @@ -3787,52 +3764,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Role-UpdateRole-Administrator", + "name": "Embed-GetEmbed-NonExisting-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 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.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.notFound;", + " 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": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -3840,55 +3812,41 @@ "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/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/cdaadc49-b4b9-4c11-8937-e602174cba30", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "cdaadc49-b4b9-4c11-8937-e602174cba30" ] } }, "response": [] }, { - "name": "Role-GetUpdatedRole-Administrator", + "name": "Embed-GetEmbed-NonExisting-NoGUID-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 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(\"Role Name is set correctly and matches: \" + updatedRoleName, function () {", - " pm.expect(jsonData.name).to.eql(updatedRoleName);", - "});" + "" ], "type": "text/javascript" } @@ -3904,44 +3862,56 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "98989" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Role", + "item": [ { - "name": "Role-SetRole-Administrator", + "name": "Role-CreateRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", + "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 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 is set correctly and matches: \" + roleId, function () {", - " pm.expect(jsonData.role.id).to.eql(roleId);", + "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" @@ -3949,7 +3919,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -3959,7 +3929,7 @@ ], "body": { "mode": "raw", - "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" @@ -3967,42 +3937,41 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/setRole?userId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/Role", "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" - } + "Role" ] - } + }, + "description": "Is deleted in the latest cleanup folder" }, "response": [] }, { - "name": "User-GetRole-Administrator", + "name": "Role-GetAllRoles-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var roleId = parseInt(pm.environment.get(\"roleId\"));", + "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 () {", @@ -4015,8 +3984,13 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if user has role that matches: \" + roleId, function () {", - " pm.expect(jsonData.role.id).to.eql(roleId);", + "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);", "});" ], "type": "text/javascript" @@ -4033,40 +4007,52 @@ } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Role" ] } }, "response": [] }, { - "name": "Role-GetRole-NonExisting-Administrator", + "name": "Scope-GetAllScopes-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 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.ok;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } @@ -4082,32 +4068,28 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/98989", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", "Role", - "98989" + "Scopes" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-Administrator", + "name": "Role-GetRole-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var roleId = parseInt(pm.environment.get(\"roleId\"));", + "var roleName = pm.environment.get(\"roleName\");", "", "var jsonData = pm.response.json();", "", @@ -4118,13 +4100,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(\"Project Name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[0].name).to.eql(projectName);", + "pm.test(\"Role Name is set correctly\", function () {", + " pm.expect(jsonData.name).to.eql(roleName);", "});" ], "type": "text/javascript" @@ -4141,103 +4123,107 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectId}}" + "Role", + "{{roleId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Wizard", - "item": [] - }, - { - "name": "File", - "item": [ + }, { - "name": "File-CreateFile-Administrator", + "name": "Role-UpdateRole-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 updatedRoleName = pm.environment.get(\"updatedRoleName\");", + "", + "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(updatedRoleName);", + "});" ], "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/testimage.png" + "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/File", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Files-GetAll-Adminstrator", + "name": "Role-GetUpdatedRole-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 updatedRoleName = pm.environment.get(\"updatedRoleName\");", + "", + "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 and matches: \" + updatedRoleName, function () {", + " pm.expect(jsonData.name).to.eql(updatedRoleName);", "});" ], "type": "text/javascript" @@ -4254,31 +4240,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "File-Delete-Administrator", + "name": "Role-SetRole-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 roleId = parseInt(pm.environment.get(\"roleId\"));", + "", + "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 is set correctly and matches: \" + roleId, function () {", + " pm.expect(jsonData.role.id).to.eql(roleId);", "});" ], "type": "text/javascript" @@ -4286,149 +4285,105 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/File/{{adminFileId}}", + "raw": "{{apiUrl}}/api/Role/setRole?userId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{adminFileId}}" - ] - } - }, - "response": [] - }, - { - "name": "File-CreateFile-MaxFileSize", - "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": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" - } - ], - "body": { - "mode": "formdata", - "formdata": [ + "Role", + "setRole" + ], + "query": [ { - "key": "File", - "type": "file", - "src": "Postman/testimage4MB.jpg" + "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" } ] - }, - "url": { - "raw": "{{apiUrl}}/api/File", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "File" - ] } }, "response": [] }, { - "name": "File-CreateFile-AllowedExtensions", + "name": "User-GetRole-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 roleId = parseInt(pm.environment.get(\"roleId\"));", + "", + "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 user has role that matches: \" + roleId, function () {", + " pm.expect(jsonData.role.id).to.eql(roleId);", + "});" ], "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/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "User", + "{{createdUserId}}" ] } }, "response": [] - } - ] - }, - { - "name": "CallToActionOption", - "item": [ + }, { - "name": "CallToActionOption-CreateCallToActionOption-Administrator", + "name": "Role-GetRole-NonExisting-Administrator", "event": [ { "listen": "test", @@ -4436,26 +4391,16 @@ "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 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.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.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -4464,7 +4409,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -4472,50 +4417,36 @@ "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/Role/98989", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Role", + "98989" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "CallToActionOption-GetAllCallToActionOptions-Administrator", + "name": "Search-SearchInternal-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var projectName = pm.environment.get(\"projectName\");", "", "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 () {", @@ -4528,11 +4459,9 @@ " 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(\"Project Name is set correctly and matching: \" + projectName, function () {", + " pm.expect(jsonData.results[0].name).to.eql(projectName);", + "});" ], "type": "text/javascript" } @@ -4548,126 +4477,104 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Search/internal/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Search", + "internal", + "{{projectId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Wizard", + "item": [] + }, + { + "name": "File", + "item": [ { - "name": "CallToActionOption-GetCallToActionOptionById-Administrator", + "name": "File-CreateFile-Administrator", "event": [ { "listen": "test", "script": { "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(\"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());", - "});", + "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" } } ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "body": { - "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Collaborate\"\r\n}", - "options": { - "raw": { - "language": "json" + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" } - } + ] }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "File" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-Administrator", + "name": "Files-GetAll-Adminstrator", "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(\"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 id is \" + callToActionOptionId, function() {", - " foundAt = findOptionType(jsonData, callToActionOptionId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "" + "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" } @@ -4683,52 +4590,79 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "File" ] } }, "response": [] }, { - "name": "CallToActionOption-UpdateCallToActionOption-Administrator", + "name": "File-Delete-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\"))();", - "", - "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(\"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": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File/{{adminFileId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File", + "{{adminFileId}}" + ] + } + }, + "response": [] + }, + { + "name": "File-CreateFile-MaxFileSize", + "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" @@ -4736,32 +4670,89 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "body": { - "mode": "raw", - "raw": "{\r\n\t\"type\": \"{{updatedCallToActionType}}\",\r\n \"value\": \"{{updatedCallToActionValue}}\"\r\n}", - "options": { - "raw": { - "language": "json" + "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": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" } + ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testfile.txt" + } + ] }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "File" ] } }, @@ -4770,10 +4761,10 @@ ] }, { - "name": "WizardPage", + "name": "CallToActionOption", "item": [ { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "CallToActionOption-CreateCallToActionOption-Administrator", "event": [ { "listen": "test", @@ -4781,7 +4772,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", + "pm.environment.set(\"callToActionOptionId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -4795,6 +4786,13 @@ " 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" @@ -4812,7 +4810,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\r\n \"type\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\",\r\n \"value\": \"postman_CallToActionOption-CreateCallToActionOption-Administrator\"\r\n}", "options": { "raw": { "language": "json" @@ -4820,26 +4818,26 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-Administrator", + "name": "CallToActionOption-GetAllCallToActionOptions-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", "", "var jsonData = pm.response.json();", "", @@ -4866,8 +4864,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", + "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", + " foundAt = findOption(jsonData, optionId);", " pm.expect(foundAt).to.not.eql(-1);", "});", "" @@ -4886,20 +4884,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Administrator", + "name": "CallToActionOption-GetCallToActionOptionById-Administrator", "event": [ { "listen": "test", @@ -4907,7 +4905,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", + "pm.environment.set(\"callToActionOptionType\", jsonData.type);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -4921,8 +4919,12 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", + "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());", "});", "" ], @@ -4930,6 +4932,9 @@ } } ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, "request": { "method": "GET", "header": [ @@ -4939,31 +4944,49 @@ "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Collaborate\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Administrator", + "name": "CallToActionOption-GetCallToActionOptionByType-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var wizardPageName = pm.environment.get(\"updatedWizardPageName\");", + "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 () {", @@ -4976,16 +4999,18 @@ " 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(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -4993,38 +5018,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/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] }, { - "name": "WizardPage-GetUpdatedWizardPage-Administrator", + "name": "CallToActionOption-UpdateCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var wizardPageId = parseInt(pm.environment.get(\"wizardPageId\"));", - "var updatedWizardPageName = pm.environment.get(\"updatedWizardPageName\");", + "var updatedCallToActionType = pm.environment.get(\"updatedCallToActionType\");", + "var updatedCallToActionValue = pm.environment.get(\"updatedCallToActionValue\");", + "pm.environment.set(\"callToActionOptionType\", updatedCallToActionType);", "", "var jsonData = pm.response.json();", "", @@ -5035,25 +5053,26 @@ "});", "", "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 updated Wizard Page Id matches: \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", + "pm.test(\"Check if updated Call to action Type matches: \" + updatedCallToActionType, function () {", + " pm.expect(jsonData.type).to.eql(updatedCallToActionType);", "});", "", - "pm.test(\"Check if updated Wizard Page Name matches: \" + updatedWizardPageName, function () {", - " pm.expect(jsonData.name).to.eql(updatedWizardPageName);", - "});" + "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", @@ -5061,22 +5080,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/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" - ], - "query": [ - { - "key": "", - "value": "", - "disabled": true - } + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, @@ -5085,17 +5106,90 @@ ] }, { - "name": "DataSource", + "name": "WizardPage", "item": [ { - "name": "DataSource-GetAllDataSources-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 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": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-GetAllWizardPages-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 () {", @@ -5108,9 +5202,9 @@ " 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);", + "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", + " foundAt = findOption(jsonData, pageId);", + " pm.expect(foundAt).to.not.eql(-1);", "});", "" ], @@ -5128,13 +5222,13 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "WizardPage" ] } }, @@ -5149,7 +5243,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "var wizardPageId = pm.environment.get(\"wizardPageId\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -5163,8 +5257,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", + " pm.expect(jsonData.id).to.eql(wizardPageId);", "});", "" ], @@ -5182,14 +5276,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, @@ -5202,7 +5296,7 @@ "listen": "test", "script": { "exec": [ - "var wizardPageName = pm.environment.get(\"updatedDataSourceName\");", + "var wizardPageName = pm.environment.get(\"updatedWizardPageName\");", "", "var jsonData = pm.response.json();", "", @@ -5219,7 +5313,7 @@ "});", "", "pm.test(\"Check if updated Wizard Page Name matches: \" + wizardPageName, function () {", - " pm.expect(jsonData.title).to.eql(wizardPageName);", + " pm.expect(jsonData.name).to.eql(wizardPageName);", "});" ], "type": "text/javascript" @@ -5237,7 +5331,7 @@ ], "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\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\r\n}", "options": { "raw": { "language": "json" @@ -5245,14 +5339,14 @@ } }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, @@ -5265,7 +5359,8 @@ "listen": "test", "script": { "exec": [ - "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "var wizardPageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "var updatedWizardPageName = pm.environment.get(\"updatedWizardPageName\");", "", "var jsonData = pm.response.json();", "", @@ -5281,9 +5376,12 @@ " 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 Data Source Id matches: \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "pm.test(\"Check if updated Wizard Page Name matches: \" + updatedWizardPageName, function () {", + " pm.expect(jsonData.name).to.eql(updatedWizardPageName);", "});" ], "type": "text/javascript" @@ -5300,14 +5398,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "WizardPage", + "{{wizardPageId}}" ], "query": [ { @@ -5323,28 +5421,41 @@ ] }, { - "name": "Cleanup", + "name": "DataSource", "item": [ { - "name": "Embed-DeleteEmbed-Administrator", + "name": "DataSource-GetAllDataSources-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);", "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "DELETE", + "", + "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": { + "method": "GET", "header": [ { "key": "IdentityId", @@ -5353,38 +5464,52 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "DataSource" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Administrator", + "name": "WizardPage-GetWizardPageById-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" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5393,34 +5518,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-Administrator", + "name": "WizardPage-UpdateWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "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 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.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" @@ -5428,7 +5563,7 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -5436,40 +5571,63 @@ "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/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "WizardPage-GetUpdatedWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ + "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "", + "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 Data Source Id matches: \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -5478,21 +5636,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "DataSource", + "{{dataSourceId}}" + ], + "query": [ + { + "key": "", + "value": "", + "disabled": true + } ] } }, "response": [] - }, + } + ] + }, + { + "name": "Cleanup", + "item": [ { - "name": "Role-DeleteRole-WithUsers-Administrator", + "name": "Embed-DeleteEmbed-Administrator", "event": [ { "listen": "test", @@ -5500,9 +5670,10 @@ "exec": [ "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});" + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "" ], "type": "text/javascript" } @@ -5518,21 +5689,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Institution-DeleteInstitution-Administrator", + "name": "Highlight-DeleteHighlight-Administrator", "event": [ { "listen": "test", @@ -5558,32 +5729,35 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "User-DeleteUser-Administrator", + "name": "Category-DeleteCategory-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" } @@ -5599,21 +5773,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "Project-DeleteProject-Administrator", "event": [ { "listen": "test", @@ -5623,7 +5797,8 @@ "", "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", - "});" + "});", + "" ], "type": "text/javascript" } @@ -5639,21 +5814,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "Project-DeleteProject2-Administrator", "event": [ { "listen": "test", @@ -5680,53 +5855,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Project", + "{{projectId2}}" ] } }, "response": [] - } - ] - }, - { - "name": "Checkup-on-Cleanup", - "item": [ + }, { - "name": "Category-Get-Deleted-Category-Administrator", + "name": "Project-DeleteProject3-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", - "", - "pm.test(\"Status code is 404\", function () {", - " pm.response.to.have.status(404);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "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(\"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" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5735,21 +5896,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "Project", + "{{projectId3}}" ] } }, "response": [] }, { - "name": "Project-Get-Deleted-Project-Administrator", + "name": "Role-DeleteRole-WithUsers-Administrator", "event": [ { "listen": "test", @@ -5757,14 +5918,8 @@ "exec": [ "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;", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});" ], "type": "text/javascript" @@ -5772,7 +5927,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5781,21 +5936,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "User-Get-Deleted-User-Administrator", + "name": "Institution-DeleteInstitution-Administrator", "event": [ { "listen": "test", @@ -5803,14 +5958,8 @@ "exec": [ "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;", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -5818,7 +5967,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5827,21 +5976,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Institution", + "{{createdInstitutionId}}" ] } }, "response": [] }, { - "name": "Embed-Get-Deleted-Embed-Administrator", + "name": "User-DeleteUser-Administrator", "event": [ { "listen": "test", @@ -5849,22 +5998,17 @@ "exec": [ "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;", - "});" + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5873,21 +6017,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Highlight-Get-Deleted-Highlight-Administrator", + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", "event": [ { "listen": "test", @@ -5895,14 +6039,8 @@ "exec": [ "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;", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -5910,7 +6048,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5919,45 +6057,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Institution-Get-Deleted-Institution-Administrator", + "name": "WizardPage-DeleteWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "", "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;", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -5966,66 +6098,45 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] } ] - } - ] - }, - { - "name": "Guest", - "item": [ + }, { - "name": "Preparation", + "name": "Checkup-on-Cleanup", "item": [ { - "name": "Project-CreateProject", + "name": "Category-Get-Deleted-Category-Administrator", "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);", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", "", - "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;", - "});", - "", - "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.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "pm.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", "});" ], "type": "text/javascript" @@ -6033,7 +6144,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -6041,58 +6152,37 @@ "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/Project", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "Category-CreateCategory", + "name": "Project-Get-Deleted-Project-Administrator", "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 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.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);", + " pm.response.to.be.notFound;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -6100,7 +6190,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -6108,71 +6198,45 @@ "value": "{{administratorUserIdentityId}}" } ], - "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": "Highlight-CreateHighlight", + "name": "User-Get-Deleted-User-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", @@ -6180,48 +6244,37 @@ "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/Highlight", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed", + "name": "Embed-Get-Deleted-Embed-Administrator", "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 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" @@ -6229,7 +6282,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -6237,65 +6290,92 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "Highlight-Get-Deleted-Highlight-Administrator", "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 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" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "{{highlightId}}" + ] + } + }, + "response": [] + }, + { + "name": "Institution-Get-Deleted-Institution-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ "", "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(\"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": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -6303,89 +6383,85 @@ "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Institution", + "{{createdInstitutionId}}" ] } }, "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": "Guest", + "item": [ { - "name": "User", + "name": "Preparation", "item": [ { - "name": "User-CreateUser-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": "POST", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], "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_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" @@ -6393,37 +6469,48 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-GetUser-Guest", + "name": "Category-CreateCategory", "event": [ { "listen": "test", "script": { "exec": [ + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", + "var categoryName = pm.environment.get(\"categoryName\");", + "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"categoryId\", 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;", + "});", + "", + "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" @@ -6431,59 +6518,89 @@ } ], "request": { - "auth": { - "type": "noauth" + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } }, - "method": "GET", - "header": [], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Category" ] } }, "response": [] }, { - "name": "User-UpdateUser-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" + } } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", - "header": [], + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", + "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" @@ -6491,21 +6608,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Highlight" ] } }, "response": [] }, { - "name": "User-DeleteUser-Guest", + "name": "Embed-CreateEmbed", "event": [ { "listen": "test", @@ -6513,14 +6629,15 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"embedGuid\", 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;", "});" @@ -6530,86 +6647,17 @@ } ], "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "{{apiUrl}}/api/User/1", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "User", - "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", - "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);", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -6617,31 +6665,46 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Embed" ] } }, "response": [] }, { - "name": "User-UnFollowUser-Guest", + "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 401\", function () {", - " pm.response.to.have.status(401);", + "pm.test(\"Call to action option value is lowercase\", function () {", + " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", "});", "" ], @@ -6650,21 +6713,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "", - "disabled": true + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", "options": { "raw": { "language": "json" @@ -6672,27 +6731,46 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "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": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } ] }, { - "name": "Category", + "name": "User", "item": [ { - "name": "Category-CreateCategory-Guest", + "name": "User-CreateUser-Guest", "event": [ { "listen": "test", @@ -6707,11 +6785,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" @@ -6726,7 +6803,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"postman_User-CreateUser-Guest\",\n \"email\": \"postman_User-CreateUser-Guest@example.com\"\n}", "options": { "raw": { "language": "json" @@ -6734,20 +6811,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "User" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-Guest", + "name": "User-GetUser-Guest", "event": [ { "listen": "test", @@ -6762,12 +6839,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" } @@ -6780,20 +6855,21 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "User", + "1" ] } }, "response": [] }, { - "name": "Category-GetCategory-Guest", + "name": "User-UpdateUser-Guest", "event": [ { "listen": "test", @@ -6808,54 +6884,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;", - "});", - "", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [], - "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Category", - "{{categoryId}}" - ] - } - }, - "response": [] - }, - { - "name": "Category-UpdateCategory-Guest", - "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;", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -6870,7 +6901,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", "options": { "raw": { "language": "json" @@ -6878,21 +6909,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-Guest", + "name": "User-DeleteUser-Guest", "event": [ { "listen": "test", @@ -6920,14 +6951,14 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryId}}" + "User", + "1" ] } }, @@ -6959,10 +6990,10 @@ ] }, { - "name": "Project", + "name": "FollowUser", "item": [ { - "name": "Project-CreateProject-Guest", + "name": "User-FollowUser-Guest", "event": [ { "listen": "test", @@ -6975,13 +7006,6 @@ "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" @@ -6993,10 +7017,17 @@ "type": "noauth" }, "method": "POST", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], "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": "", "options": { "raw": { "language": "json" @@ -7004,60 +7035,33 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] }, { - "name": "Project-GetAllProjects-Guest", + "name": "User-UnFollowUser-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(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", - "", - "pm.test(\"Project name is set correctly and matching: \" + projectName, function () {", - " pm.expect(jsonData.results[foundAt].name).to.eql(projectName);", - "});" + "" ], "type": "text/javascript" } @@ -7067,47 +7071,66 @@ "auth": { "type": "noauth" }, - "method": "GET", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Category", + "item": [ { - "name": "Project-GetProject-Guest", + "name": "Category-CreateCategory-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 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.unauthorized;", " 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" } @@ -7117,29 +7140,39 @@ "auth": { "type": "noauth" }, - "method": "GET", + "method": "POST", "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Category" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Guest", + "name": "Category-GetAllCategories-Guest", "event": [ { "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 401\", function () {", @@ -7150,7 +7183,9 @@ " pm.response.to.be.unauthorized;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "" ], "type": "text/javascript" } @@ -7160,33 +7195,23 @@ "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/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "1" + "Category" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Guest", + "name": "Category-GetCategory-Guest", "event": [ { "listen": "test", @@ -7201,53 +7226,55 @@ "});", "", "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": { - "method": "DELETE", + "auth": { + "type": "noauth" + }, + "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/1", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "1" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "Project-LikeProject-Guest", + "name": "Category-UpdateCategory-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", - "" + "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" } @@ -7257,114 +7284,122 @@ "auth": { "type": "noauth" }, - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text", - "disabled": true + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } } - ], + }, "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Category", + "{{categoryId}}" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-Guest", + "name": "Category-DeleteCategory-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": "DELETE", - "header": [ - { - "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text", - "disabled": true - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Category", + "{{categoryId}}" ] } }, "response": [] - }, - { - "name": "Project-MakeInstitutionPrivate-Guest", + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Project", + "item": [ + { + "name": "Project-CreateProject-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" @@ -7372,18 +7407,14 @@ } ], "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [], "body": { "mode": "raw", - "raw": "true\r\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" @@ -7391,39 +7422,59 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Guest", + "name": "Project-GetAllProjects-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 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" @@ -7431,122 +7482,93 @@ } ], "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Project" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-Guest", + "name": "Project-GetProject-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 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);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "value": "", - "type": "text", - "disabled": true - } - ], + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "{{projectId}}" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "FollowProject", - "item": [ - { - "name": "Project-FollowProject-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 () {", " 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" } @@ -7556,18 +7578,11 @@ "auth": { "type": "noauth" }, - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "", - "disabled": true - } - ], + "method": "PUT", + "header": [], "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" @@ -7575,82 +7590,63 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project", + "1" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-Guest", + "name": "Project-DeleteProject-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": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "", - "disabled": true - } - ], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, + "header": [], "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project", + "1" ] } }, "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ + }, { - "name": "Project-CategorizeProject-Guest", + "name": "Project-LikeProject-Guest", "event": [ { "listen": "test", @@ -7662,7 +7658,14 @@ "\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" } @@ -7676,29 +7679,28 @@ "header": [ { "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", "type": "text", - "value": "", "disabled": true } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Guest", + "name": "Project-DeleteLikeProject-Guest", "event": [ { "listen": "test", @@ -7710,7 +7712,14 @@ "\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" } @@ -7721,48 +7730,50 @@ "type": "noauth" }, "method": "DELETE", - "header": [], + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "like", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Guest", + "name": "Project-MakeInstitutionPrivate-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", + "});\r", + "\r", "" ], "type": "text/javascript" @@ -7779,11 +7790,18 @@ } ], "request": { - "method": "POST", - "header": [], + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "", + "type": "text", + "disabled": true + } + ], "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": "true\r\n", "options": { "raw": { "language": "json" @@ -7791,37 +7809,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-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 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 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" @@ -7829,74 +7849,109 @@ } ], "request": { - "method": "GET", - "header": [], + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "", + "type": "text", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Guest", + "name": "Project-UnlinkInstitution-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(\"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);", - "});" + "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" } } ], "request": { - "method": "GET", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "", + "type": "text", + "disabled": true + } + ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" - ] + "Project", + "linkedinstitution", + "{{projectId}}", + "1" + ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Highlight-GetHighlight-ByProject-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FollowProject", + "item": [ + { + "name": "Project-FollowProject-Guest", "event": [ { "listen": "test", @@ -7909,12 +7964,6 @@ "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" @@ -7922,52 +7971,54 @@ } ], "request": { - "method": "GET", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Guest", + "name": "Project-UnFollowProject-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" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ "" ], "type": "text/javascript" @@ -7975,11 +8026,21 @@ } ], "request": { - "method": "PUT", - "header": [], + "auth": { + "type": "noauth" + }, + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], "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": "", "options": { "raw": { "language": "json" @@ -7987,38 +8048,86 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "project", + "follow", + "{{projectIdToFollow}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "CategorizeProject", + "item": [ + { + "name": "Project-CategorizeProject-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": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "", + "disabled": true + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Guest", + "name": "Project-UncategorizeProject-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" @@ -8026,52 +8135,34 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } ] }, { - "name": "Embed", + "name": "Highlight", "item": [ { - "name": "Embed-CreateEmbed-Guest", + "name": "Highlight-CreateHighlight-Guest", "event": [ { "listen": "test", @@ -8086,10 +8177,20 @@ "});", "", "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" } @@ -8100,7 +8201,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\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" @@ -8108,20 +8209,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-Guest", + "name": "Highlight-GetAllActiveHighlights-Guest", "event": [ { "listen": "test", @@ -8131,14 +8232,14 @@ "", "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;", "});" ], "type": "text/javascript" @@ -8149,27 +8250,32 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Highlight" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Guest", + "name": "Highlight-GetHighlight-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 () {", @@ -8177,9 +8283,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(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -8190,21 +8300,126 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-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 () {", + " 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": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "Project", + "{{projectId}}" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-UpdateHighlight-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" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "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/Highlight/{{highlightId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight", + "{{highlightId}}" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-DeleteHighlight-Guest", "event": [ { "listen": "test", @@ -8232,14 +8447,14 @@ "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Highlight", + "{{highlightId}}" ] } }, @@ -8271,10 +8486,10 @@ ] }, { - "name": "Role", + "name": "Embed", "item": [ { - "name": "Role-CreateRole-Guest", + "name": "Embed-CreateEmbed-Guest", "event": [ { "listen": "test", @@ -8289,11 +8504,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" } @@ -8304,7 +8518,7 @@ "header": [], "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 \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -8312,20 +8526,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed" ] } }, "response": [] }, { - "name": "Role-GetAllRoles-Guest", + "name": "Embed-GetAllEmbeds-Guest", "event": [ { "listen": "test", @@ -8340,11 +8554,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" } @@ -8354,20 +8567,20 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-Guest", + "name": "Embed-GetEmbed-Guest", "event": [ { "listen": "test", @@ -8377,16 +8590,15 @@ "", "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;", + "});" ], "type": "text/javascript" } @@ -8396,21 +8608,21 @@ "method": "GET", "header": [], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Role-GetRole-Guest", + "name": "Embed-DeleteEmbed-Guest", "event": [ { "listen": "test", @@ -8425,35 +8637,62 @@ "});", "", "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": { - "method": "GET", + "method": "DELETE", "header": [], "url": { - "raw": "{{apiUrl}}/api/Role/1", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "1" + "Embed", + "{{embedGuid}}" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Role-UpdateRole-Guest", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Role", + "item": [ + { + "name": "Role-CreateRole-Guest", "event": [ { "listen": "test", @@ -8479,11 +8718,11 @@ } ], "request": { - "method": "PUT", + "method": "POST", "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\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -8491,13 +8730,192 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/1", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", + "Role" + ] + } + }, + "response": [] + }, + { + "name": "Role-GetAllRoles-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": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Role", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role" + ] + } + }, + "response": [] + }, + { + "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" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Role/Scopes", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role", + "Scopes" + ] + } + }, + "response": [] + }, + { + "name": "Role-GetRole-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": "GET", + "header": [], + "url": { + "raw": "{{apiUrl}}/api/Role/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Role-UpdateRole-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": "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/Role/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Role", "1" ] } @@ -11337,54 +11755,52 @@ "response": [] }, { - "name": "Project-GetAllProjects-Registered", + "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();", - "", - "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(\"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(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", "});", "", - "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", @@ -11392,6 +11808,15 @@ "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-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/Project", "host": [ @@ -11406,38 +11831,51 @@ "response": [] }, { - "name": "Project-GetProject-Self-Registered", + "name": "Project-CreateProject-MultipleCallToActions-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(\"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(\"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" } - } - ], - "request": { - "method": "GET", + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", "header": [ { "key": "IdentityId", @@ -11445,45 +11883,65 @@ "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-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/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-GetProject-Other-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();", + "", + "", "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" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -11491,53 +11949,65 @@ "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\": \"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/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Self-Registered", + "name": "Project-CreateProject-CallToActionLimitExceeded-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", + "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 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 == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", "", - "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", - "});" + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -11547,7 +12017,7 @@ ], "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}", + "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" @@ -11555,44 +12025,54 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Other-Registered", + "name": "Project-CreateProject-CallToActionSameAction-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 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.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", @@ -11602,7 +12082,7 @@ ], "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": "{\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" @@ -11610,97 +12090,120 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-LikeProject-Registered", + "name": "Project-GetAllProjects-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", - "" + "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": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-Registered", + "name": "Project-GetProject-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", - "});\r", - "" + "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);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -11709,14 +12212,13 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "like", "{{projectId}}" ] } @@ -11724,19 +12226,22 @@ "response": [] }, { - "name": "Project-DeleteProject-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" @@ -11744,7 +12249,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -11753,40 +12258,45 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{projectToBeDeletedByUnauthorizedRoles}}" + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-Registered", + "name": "Project-UpdateProject-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 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", - "" + "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);", + "});" ], "type": "text/javascript" } @@ -11797,13 +12307,13 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "true\r\n", + "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" @@ -11811,57 +12321,37 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{adminProjectId}}" + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Registered", + "name": "Project-UpdateProject-Other-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", - "\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": [ - "" + "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" } @@ -11872,13 +12362,13 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "true\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" @@ -11886,22 +12376,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "instituteprivate", - "{{projectId}}" + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Registered", + "name": "Project-LikeProject-Registered", "event": [ { "listen": "test", @@ -11911,15 +12400,16 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 403\", function () {\r", - " pm.response.to.have.status(403);\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.forbidden;\r", + " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});" + "});\r", + "" ], "type": "text/javascript" } @@ -11935,36 +12425,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-Registered", + "name": "Project-DeleteLikeProject-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 403\", function () {\r", - " pm.response.to.have.status(403);\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.forbidden\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", "" ], @@ -11977,44 +12470,39 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "like", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "UserProjects", - "item": [ + }, { - "name": "UserProject-CreateProject-Registered", + "name": "Project-DeleteProject-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"userProjectProjectId1\", 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);", + "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" @@ -12022,7 +12510,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -12030,59 +12518,58 @@ "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/Project/{{projectToBeDeletedByUnauthorizedRoles}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "{{projectToBeDeletedByUnauthorizedRoles}}" ] } }, "response": [] }, { - "name": "UserProject-CreateProject-Registered", + "name": "Project-MakeInstitutionPrivate-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"userProjectProjectId2\", jsonData.id)", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});" + "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": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "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": "true\r\n", "options": { "raw": { "language": "json" @@ -12090,81 +12577,114 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "instituteprivate", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "UserProject-GetProject-Self-Registered", + "name": "Project-MakeInstitutionPrivate-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 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 count matches: 4\", function () {", - " pm.expect(jsonData.length).to.eql(4);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/user/projects", - "host": [ + "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": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "true\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "host": [ "{{apiUrl}}" ], "path": [ "api", - "user", - "projects" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] }, { - "name": "UserProject-DeleteProject-Other-Registered", + "name": "Project-LinkInstitutionToProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "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" @@ -12172,38 +12692,47 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId1}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{userProjectProjectId1}}" + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "UserProject-DeleteProject-Other-Registered", + "name": "Project-UnlinkInstitution-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});" + "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" } @@ -12214,19 +12743,21 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId2}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "{{userProjectProjectId2}}" + "linkedinstitution", + "{{projectId}}", + "1" ] } }, @@ -12235,33 +12766,21 @@ ] }, { - "name": "FollowProject", + "name": "UserProjects", "item": [ { - "name": "Project-FollowProject-Registered", + "name": "UserProject-CreateProject-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(\"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.environment.set(\"userProjectProjectId1\", jsonData.id)", "", - "pm.test(\"Check if created Username matches: \" + projectId, function () {", - " pm.expect(jsonData.id).to.eql(projectId);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", "});" ], "type": "text/javascript" @@ -12274,12 +12793,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "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" @@ -12287,50 +12806,49 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-Registered", + "name": "UserProject-CreateProject-Registered", "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(\"userProjectProjectId2\", jsonData.id)", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "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" @@ -12338,64 +12856,43 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "CategorizeProject", - "item": [ - { - "name": "Project-CategorizeProject-Self-Registered", + "name": "UserProject-GetProject-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", + "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 count matches: 4\", function () {", + " pm.expect(jsonData.length).to.eql(4);", "});" ], "type": "text/javascript" @@ -12403,7 +12900,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -12412,34 +12909,28 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/user/projects", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "user", + "projects" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-Registered", + "name": "UserProject-DeleteProject-Other-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", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -12447,7 +12938,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -12456,84 +12947,28 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId1}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "{{userProjectProjectId1}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-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": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" - ] - } - }, - "response": [] - }, - { - "name": "Project-UncategorizeProject-Other-Registered", + "name": "UserProject-DeleteProject-Other-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", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -12550,16 +12985,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{userProjectProjectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "{{userProjectProjectId2}}" ] } }, @@ -12568,24 +13001,23 @@ ] }, { - "name": "Embed", + "name": "FollowProject", "item": [ { - "name": "Embed-CreateEmbed-Self-Registered", + "name": "Project-FollowProject-Registered", "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);", + "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 () {", @@ -12593,7 +13025,10 @@ " 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" } @@ -12605,12 +13040,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -12618,55 +13053,50 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-Other-Registered", + "name": "Project-UnFollowProject-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" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -12674,37 +13104,64 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Embed-GetAllEmbeds-Registered", + "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();", - "", - "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" @@ -12712,7 +13169,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -12721,43 +13178,34 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Registered", + "name": "Project-CategorizeProject-Other-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(\"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);", + "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" @@ -12765,7 +13213,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -12774,33 +13222,40 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Self-Registered", + "name": "Project-UncategorizeProject-Self-Registered", "event": [ { "listen": "test", "script": { "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;", + "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" @@ -12817,34 +13272,35 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-Registered", + "name": "Project-UncategorizeProject-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(\"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" } @@ -12860,14 +13316,16 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{adminEmbedGuid}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, @@ -12876,10 +13334,10 @@ ] }, { - "name": "Highlight", + "name": "Embed", "item": [ { - "name": "Highlight-CreateHighlight-Registered", + "name": "Embed-CreateEmbed-Self-Registered", "event": [ { "listen": "test", @@ -12887,30 +13345,20 @@ "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 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" - } - }, - { - "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" @@ -12928,7 +13376,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 \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -12936,55 +13384,37 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Embed" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-Registered", + "name": "Embed-CreateEmbed-Other-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 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.test(\"Highlight is in list and matching: \" + projectId, function () {", - " foundAt = findItem(jsonData, projectId);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -12992,7 +13422,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -13000,48 +13430,47 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Embed" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Registered", + "name": "Embed-GetAllEmbeds-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 () {", - " 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" @@ -13058,40 +13487,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Embed" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-ByProject-Registered", + "name": "Embed-GetEmbed-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 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(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", + "});" ], "type": "text/javascript" } @@ -13107,39 +13540,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Registered", + "name": "Embed-DeleteEmbed-Self-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(\"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.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -13147,51 +13574,42 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "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/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Other-Registered", + "name": "Embed-DeleteEmbed-Other-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "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);", "});", "", "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.unauthorized;", "});" ], "type": "text/javascript" @@ -13208,14 +13626,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Embed", + "{{adminEmbedGuid}}" ] } }, @@ -13224,10 +13642,10 @@ ] }, { - "name": "Role", + "name": "Highlight", "item": [ { - "name": "Role-CreateRole-Registered", + "name": "Highlight-CreateHighlight-Registered", "event": [ { "listen": "test", @@ -13249,6 +13667,20 @@ ], "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": { @@ -13262,7 +13694,7 @@ ], "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 \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -13270,37 +13702,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Highlight" ] } }, "response": [] }, { - "name": "Role-GetAllRoles-Registered", + "name": "Highlight-GetAllActiveHighlights-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].projectId == 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" @@ -13317,37 +13767,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Highlight" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-Registered", + "name": "Highlight-GetHighlight-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();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", "", - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", + "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.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 Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -13364,21 +13824,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Role-GetRole-Registered", + "name": "Highlight-GetHighlight-ByProject-Registered", "event": [ { "listen": "test", @@ -13393,10 +13853,11 @@ "});", "", "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" } @@ -13412,21 +13873,22 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Highlight", + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Role-UpdateRole-Registered", + "name": "Highlight-UpdateHighlight-Registered", "event": [ { "listen": "test", @@ -13455,13 +13917,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "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 \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{highlightEndDate}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -13469,38 +13931,33 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Role-SetRole-Registered", + "name": "Highlight-DeleteHighlight-Other-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);", "});", "", + "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" @@ -13508,7 +13965,7 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -13516,55 +13973,44 @@ "value": "{{registeredUserIdentityId}}" } ], - "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/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "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" - } + "Highlight", + "{{highlightId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Role", + "item": [ { - "name": "Role-DeleteRole-Registered", + "name": "Role-CreateRole-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);", "});", "", - "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" @@ -13572,7 +14018,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -13580,40 +14026,45 @@ "value": "{{registeredUserIdentityId}}" } ], + "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/{{roleId}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Role" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-Registered", + "name": "Role-GetAllRoles-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.ok;", + " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", "});" @@ -13628,35 +14079,24 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectName}}" + "Role" ] } }, "response": [] - } - ] - }, - { - "name": "Wizard", - "item": [] - }, - { - "name": "Institution", - "item": [ + }, { - "name": "Institution-CreateInstitution-Registered", + "name": "Scope-GetAllScopes-Registered", "event": [ { "listen": "test", @@ -13666,57 +14106,45 @@ "", "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": "POST", + "method": "GET", "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}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-Registered", + "name": "Role-GetRole-Registered", "event": [ { "listen": "test", @@ -13726,12 +14154,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;", "});" @@ -13741,33 +14169,30 @@ } ], "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/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Institution-UpdateInstitution-Registered", + "name": "Role-UpdateRole-Registered", "event": [ { "listen": "test", @@ -13777,12 +14202,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;", "});" @@ -13792,20 +14217,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "PUT", "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}", + "raw": "{\r\n \"name\": \"{{updatedRoleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -13813,21 +14235,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "Instituiton-DeleteInstitution-Registered", + "name": "Role-SetRole-Registered", "event": [ { "listen": "test", @@ -13837,12 +14259,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;", "});" @@ -13852,81 +14274,63 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], - "url": { - "raw": "{{apiUrl}}/api/User/1", + "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/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "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": [] - } - ], - "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": "Role-DeleteRole-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", + "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" @@ -13934,58 +14338,50 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "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/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "Role", + "{{roleId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "ProjectIcon-CreateProject-Registered", + "name": "Search-SearchInternal-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 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;", "});" ], "type": "text/javascript" @@ -13993,114 +14389,117 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], - "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 \"fileId\": {{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/Search/internal/{{projectName}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Search", + "internal", + "{{projectName}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Wizard", + "item": [] + }, + { + "name": "Institution", + "item": [ { - "name": "ProjectIcon-GetProject-Registered", + "name": "Institution-CreateInstitution-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 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.test(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + " pm.response.to.be.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", - "", - "pm.test(\"ProjectIconId is set correctly and matches: \" + ProjectIconRegisteredFileId, function () {", - " pm.expect(jsonData.projectIcon.id).to.eql(ProjectIconRegisteredFileId)", - "});" + "" ], "type": "text/javascript" } } ], "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/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "User" ] } }, "response": [] }, { - "name": "ProjectIcon-GetIcon-Registered", + "name": "Institution-GetInstitution-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 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" @@ -14108,53 +14507,50 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{ProjectIconRegisteredFileId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "ProjectIcon-UpdateProject-Same-ProjectIcon", + "name": "Institution-UpdateInstitution-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 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.unauthorized;", " 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" @@ -14162,17 +14558,20 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "PUT", "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 \"fileId\": {{ProjectIconRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", "options": { "raw": { "language": "json" @@ -14180,38 +14579,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "ProjectIcon-GetIcon-Registered-After-Edit", + "name": "Instituiton-DeleteInstitution-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 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" @@ -14219,30 +14618,58 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{ProjectIconRegisteredFileId}}" + "User", + "1" ] } }, "response": [] + } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "ProjectIcon-Post-New-File-Registered", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "ProjectIcon", + "item": [ + { + "name": "ProjectIcon-Post-File-Registered", "event": [ { "listen": "test", @@ -14260,7 +14687,7 @@ " pm.expect(jsonData.id).to.exist;\r", "})\r", "\r", - "pm.environment.set(\"newRegisteredFileId\", jsonData.id);\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", @@ -14277,8 +14704,8 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "body": { @@ -14287,7 +14714,7 @@ { "key": "File", "type": "file", - "src": "Postman/testimage2.png" + "src": "Postman/testimage.png" } ] }, @@ -14305,26 +14732,22 @@ "response": [] }, { - "name": "ProjectIcon-UpdateProject-Registered", + "name": "ProjectIcon-CreateProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectNameUpdated\");", + "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 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 Name is set correctly and matches: \" + projectName, function () {", @@ -14336,7 +14759,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -14346,7 +14769,7 @@ ], "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 \"fileId\": {{newRegisteredFileId}},\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\"\r\n}", + "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 \"fileId\": {{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" @@ -14354,28 +14777,27 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "Project" ] } }, "response": [] }, { - "name": "ProjectIcon-GetUpdatedProject-Registered", + "name": "ProjectIcon-GetProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ "var projectName = pm.environment.get(\"projectName\");", - "var newRegisteredFileId = pm.environment.get(\"newRegisteredFileId\");", + "var ProjectIconRegisteredFileId = pm.environment.get(\"ProjectIconRegisteredFileId\");", "", "var jsonData = pm.response.json();", "", @@ -14395,8 +14817,8 @@ " 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)", + "pm.test(\"ProjectIconId is set correctly and matches: \" + ProjectIconRegisteredFileId, function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(ProjectIconRegisteredFileId)", "});" ], "type": "text/javascript" @@ -14427,7 +14849,7 @@ "response": [] }, { - "name": "ProjectIcon-GetDeletedIcon-Registered", + "name": "ProjectIcon-GetIcon-Registered", "event": [ { "listen": "test", @@ -14437,12 +14859,12 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\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.notFound;\r", + " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", "});" @@ -14475,24 +14897,30 @@ "response": [] }, { - "name": "ProjectIcon-GetNewIcon-Registered", + "name": "ProjectIcon-UpdateProject-Same-ProjectIcon", "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 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);", "});" ], "type": "text/javascript" @@ -14500,7 +14928,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -14508,40 +14936,56 @@ "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 \"fileId\": {{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/file/{{newRegisteredFileId}}", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{newRegisteredFileId}}" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "ProjectIcon-DeleteProject-Registered", + "name": "ProjectIcon-GetIcon-Registered-After-Edit", "event": [ { "listen": "test", "script": { "exec": [ - "eval(pm.environment.get(\"commonTests\"))();", - "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "});", - "" + "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": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -14550,21 +14994,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", + "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{ProjectIconProjectId}}" + "file", + "{{ProjectIconRegisteredFileId}}" ] } }, "response": [] }, { - "name": "ProjectIcon-GetNewIcon-Registered Copy", + "name": "ProjectIcon-Post-New-File-Registered", "event": [ { "listen": "test", @@ -14574,14 +15018,20 @@ "\r", "eval(pm.environment.get(\"commonTests\"))();\r", "\r", - "pm.test(\"Status code is 404\", function () {\r", - " pm.response.to.have.status(404);\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.notFound;\r", - " pm.response.to.be.withBody;\r", - " pm.response.to.be.json;\r", + " pm.response.to.be.success;\r", + " pm.response.to.be.withBody;\r", + " pm.response.to.be.json;\r", "});" ], "type": "text/javascript" @@ -14589,7 +15039,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -14597,84 +15047,72 @@ "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage2.png" + } + ] + }, "url": { - "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "file", - "{{ProjectIconRegisteredFileId}}" + "File" ] } }, "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", - "item": [ - { - "name": "CallToActionOption-CreateCallToActionOption-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 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": "PUT", "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\": \"{{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 \"fileId\": {{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" @@ -14682,40 +15120,31 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-Registered", + "name": "ProjectIcon-GetUpdatedProject-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var newRegisteredFileId = pm.environment.get(\"newRegisteredFileId\");", "", "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 () {", @@ -14723,16 +15152,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(\"Call to action option with id: \" + optionId + \" is in list\", function () {", - " foundAt = findOption(jsonData, optionId);", - " 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(\"ProjectIconId is set correctly and matches: \" + newRegisteredFileId, function () {", + " pm.expect(jsonData.projectIcon.id).to.eql(newRegisteredFileId)", + "});" ], "type": "text/javascript" } @@ -14748,49 +15179,39 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-Registered", + "name": "ProjectIcon-GetDeletedIcon-Registered", "event": [ { "listen": "test", "script": { "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(\"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());", - "});", - "" + "var jsonData = pm.response.json();\r", + "\r", + "eval(pm.environment.get(\"commonTests\"))();\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\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" } @@ -14801,61 +15222,44 @@ "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "file", + "{{ProjectIconRegisteredFileId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-Registered", + "name": "ProjectIcon-GetNewIcon-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(\"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 id is \" + callToActionOptionId, function() {", - " foundAt = findOptionType(jsonData, callToActionOptionId);", - " 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", + "});" ], "type": "text/javascript" } @@ -14871,96 +15275,79 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/file/{{newRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "file", + "{{newRegisteredFileId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-UpdateCallToActionOption-Registered", + "name": "ProjectIcon-DeleteProject-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(\"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;", - "});" + "" ], "type": "text/javascript" } } ], "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}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Project/{{ProjectIconProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Project", + "{{ProjectIconProjectId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-Registered", + "name": "ProjectIcon-GetNewIcon-Registered Copy", "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 404\", function () {\r", + " pm.response.to.have.status(404);\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" @@ -14968,29 +15355,30 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/file/{{ProjectIconRegisteredFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "file", + "{{ProjectIconRegisteredFileId}}" ] } }, "response": [] } ], + "description": "Testing if the icons are accessible, and get deleted when they are supposed to ", "event": [ { "listen": "prerequest", @@ -15013,72 +15401,29 @@ ] }, { - "name": "File", + "name": "CallToActionOption", "item": [ { - "name": "Get-Files-Registered", - "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", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/File", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "File" - ] - } - }, - "response": [] - }, - { - "name": "Post-File-Registered", + "name": "CallToActionOption-CreateCallToActionOption-Registered", "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 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" } @@ -15094,79 +15439,95 @@ } ], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" + "mode": "raw", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "options": { + "raw": { + "language": "json" } - ] + } }, "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "CallToActionOption" ] } }, "response": [] }, { - "name": "Delete-File-Registered", + "name": "CallToActionOption-GetAllCallToActionOptions-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", - "});" + "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": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File/{{registeredFileId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{registeredFileId}}" + "CallToActionOption" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-Registered", + "name": "CallToActionOption-GetCallToActionOptionById-Registered", "event": [ { "listen": "test", @@ -15174,6 +15535,10 @@ "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);", "});", @@ -15183,6 +15548,14 @@ " 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" @@ -15194,33 +15567,43 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-Registered", + "name": "CallToActionOption-GetCallToActionOptionByType-Registered", "event": [ { "listen": "test", "script": { "exec": [ + "var callToActionOptionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "", "var jsonData = pm.response.json();", "", - "var dataSourceId = pm.environment.get(\"dataSourceId\");", + "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\"))();", "", @@ -15234,8 +15617,9 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", + "pm.test(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", "});", "" ], @@ -15253,21 +15637,22 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-Registered", + "name": "CallToActionOption-UpdateCallToActionOption-Registered", "event": [ { "listen": "test", @@ -15285,8 +15670,7 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } @@ -15297,14 +15681,13 @@ "header": [ { "key": "IdentityId", - "type": "text", "value": "{{registeredUserIdentityId}}", - "disabled": true + "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}", + "raw": "{\r\n\t\"type\": \"Updated type\",\r\n \"value\": \"Updated value\"\r\n}", "options": { "raw": { "language": "json" @@ -15312,26 +15695,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] - } - ] - }, - { - "name": "WizardPage", - "item": [ + }, { - "name": "WizardPage-CreateWizardPage-Registered", + "name": "CallToActionOption-DeleteCallToActionOption-Registered", "event": [ { "listen": "test", @@ -15349,68 +15727,219 @@ " 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": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "type": "text" } ], - "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/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] - }, - { - "name": "WizardPage-GetAllWizardPages-Registered", + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "File", + "item": [ + { + "name": "Get-Files-Registered", + "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", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File" + ] + } + }, + "response": [] + }, + { + "name": "Post-File-Registered", + "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", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "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": "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 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);", "});", @@ -15420,11 +15949,6 @@ " 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" @@ -15441,13 +15965,13 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "DataSource" ] } }, @@ -15462,7 +15986,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", + "var dataSourceId = pm.environment.get(\"dataSourceId\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -15476,8 +16000,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", + "pm.test(\"Check previously created data source with id \" + dataSourceId, function () {", + " pm.expect(jsonData.guid).to.eql(dataSourceId);", "});", "" ], @@ -15495,14 +16019,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "DataSource", + "{{dataSourceId}}" ] } }, @@ -15540,12 +16064,13 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{registeredUserIdentityId}}", + "disabled": true } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{updatedWizardPageName}}\",\r\n \"description\": \"postmantest_Institution-UpdateInstitution-Administrator\"\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" @@ -15553,14 +16078,14 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "DataSource", + "{{dataSourceId}}" ] } }, @@ -15569,27 +16094,36 @@ ] }, { - "name": "Cleanup Registered", + "name": "WizardPage", "item": [ { - "name": "Project-DeleteProject-Registered", + "name": "WizardPage-CreateWizardPage-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" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -15599,7 +16133,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", "options": { "raw": { "language": "json" @@ -15607,159 +16141,213 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "WizardPage" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup Administrator", - "item": [ + }, { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "WizardPage-GetAllWizardPages-Registered", "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" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "WizardPage-GetWizardPageById-Registered", "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": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{registeredUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "User-DeleteUser-Administrator", + "name": "WizardPage-UpdateWizardPage-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" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "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/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Cleanup Registered", + "item": [ { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "Project-DeleteProject-Registered", "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(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", - " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", "});" ], "type": "text/javascript" @@ -15772,79 +16360,43 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Project", + "{{projectId}}" ] } }, "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": "Project-DeleteProject2-Registered", "event": [ { "listen": "test", "script": { "exec": [ - "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);", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -15852,17 +16404,17 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_DataOfficer-Institution-CreateInstitution\"\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -15870,45 +16422,30 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Institution", + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution" + "Project", + "{{projectId2}}" ] } }, "response": [] }, { - "name": "User-CreateUserWithoutInstitution", + "name": "Project-DeleteProject3-Registered", "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.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);", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -15916,17 +16453,17 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithoutInstitution@example.com\"\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -15934,44 +16471,35 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project", + "{{projectId3}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Cleanup Administrator", + "item": [ { - "name": "User-CreateUserWithInstitution", + "name": "CallToActionOption-DeleteCallToActionOption-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var userName = pm.environment.get(\"userName\");", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"createdUserWithInstitutionId\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "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);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -15979,7 +16507,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -15987,65 +16515,31 @@ "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/User", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "Project-CreateProject-DifferentInstitution", + "name": "Project-DeleteProject-Administrator", "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(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -16053,136 +16547,91 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], - "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/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Project-CreateProject-SameInstitution", + "name": "User-DeleteUser-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"projectIdWithInstitution\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "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" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "9996" + "value": "{{administratorUserIdentityId}}" } ], - "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/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "WizardPage-DeleteWizardPage-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"highlightId\", jsonData.id);", + "var responseTimeThreshold = parseInt(pm.environment.get(\"responseTimeThreshold\"));", "", - "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.test(\"Response time is less than \" + responseTimeThreshold + \"ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(responseTimeThreshold);", "});" ], "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", @@ -16190,40 +16639,62 @@ "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/Highlight", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Embed-CreateEmbed-DifferentInstitution", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ] + }, + { + "name": "Data Officer", + "item": [ + { + "name": "Preparation", + "item": [ + { + "name": "Institution-CreateInstitution", "event": [ { "listen": "test", "script": { "exec": [ + "var institutionName = pm.environment.get(\"institutionName\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "pm.environment.set(\"createdInstitutionId\", jsonData.id);", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", @@ -16233,6 +16704,11 @@ " 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" @@ -16250,7 +16726,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "{\n \"name\": \"{{institutionName}}\",\n \"description\": \"postmantest_DataOfficer-Institution-CreateInstitution\"\n}", "options": { "raw": { "language": "json" @@ -16258,28 +16734,31 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Institution", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Institution" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-SameInstitution", + "name": "User-CreateUserWithoutInstitution", "event": [ { "listen": "test", "script": { "exec": [ + "var userName = pm.environment.get(\"userName\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"embedGuidWithInstitution\", jsonData.guid);", + "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);", @@ -16289,6 +16768,11 @@ " 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" @@ -16301,12 +16785,12 @@ { "key": "IdentityId", "type": "text", - "value": "9996" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectIdWithInstitution}}\r\n}", + "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithoutInstitution@example.com\"\n}", "options": { "raw": { "language": "json" @@ -16314,28 +16798,30 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "User" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "User-CreateUserWithInstitution", "event": [ { "listen": "test", "script": { "exec": [ + "var userName = pm.environment.get(\"userName\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "pm.environment.set(\"createdUserWithInstitutionId\", jsonData.id);", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", @@ -16348,14 +16834,9 @@ "});", "", "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 created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});" ], "type": "text/javascript" } @@ -16372,7 +16853,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_DataOfficer-User-CreateUserWithInstitution@example.com\",\n \"institutionId\": {{institutionIdFromUser}}\n}", "options": { "raw": { "language": "json" @@ -16380,30 +16861,33 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "User" ] } }, "response": [] }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "Project-CreateProject-DifferentInstitution", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var administratorUserId = parseInt(pm.environment.get(\"administratorUserId\"));", + "var projectName = pm.environment.get(\"projectName\");", + "var adminUserName = pm.environment.get(\"adminUserName\");", "", - "pm.environment.set(\"wizardPageId\", jsonData.id);", + "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 201\", function () {", " pm.response.to.have.status(201);", @@ -16415,7 +16899,18 @@ " 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" } @@ -16432,7 +16927,7 @@ ], "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-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" @@ -16440,46 +16935,20 @@ } }, "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-DataOfficer", + "name": "Project-CreateProject-SameInstitution", "event": [ { "listen": "test", @@ -16487,14 +16956,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;", "});", @@ -16510,12 +16979,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "9996" } ], "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_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" @@ -16523,65 +16992,71 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project" ] } }, "response": [] }, { - "name": "User-UpdateUser-SelfWithSameInstitution-DataOfficer", + "name": "Highlight-CreateHighlight", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", + "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 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 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" } + }, + { + "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": "PUT", + "method": "POST", "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 \"institutionId\": 1\r\n}", + "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" @@ -16589,21 +17064,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{dataOfficerUserId}}" + "Highlight" ] } }, "response": [] }, { - "name": "User-UpdateUser-SelfWithWrongInstitution-DataOfficer", + "name": "Embed-CreateEmbed-DifferentInstitution", "event": [ { "listen": "test", @@ -16611,39 +17085,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;", - "});", - "", - "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": "PUT", + "method": "POST", "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 \"institutionId\": {{createdInstitutionId}}\r\n}", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -16651,61 +17122,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{dataOfficerUserId}}" + "Embed" ] } }, "response": [] }, { - "name": "User-UpdateUser-OtherWithSameInstitution-SameInstitutionId-DataOfficer", + "name": "Embed-CreateEmbed-SameInstitution", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", - "var institutionId = pm.environment.get(\"institutionIdFromUser\");", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"embedGuidWithInstitution\", jsonData.guid);", "", - "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(\"Institution Id is \" + institutionId, function() {", - " pm.expect(jsonData.institution.id).to.equal(parseInt(institutionId));", - "})" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "9996" } ], "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 \"projectId\": {{projectIdWithInstitution}}\r\n}", "options": { "raw": { "language": "json" @@ -16713,21 +17178,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "Embed" ] } }, "response": [] }, { - "name": "User-GetUser-Other-SameInstitution-DataOfficer", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", @@ -16735,17 +17199,26 @@ "exec": [ "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"callToActionOptionId\", 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;", "});", + "", + "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" @@ -16753,30 +17226,38 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "CallToActionOption" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-DataOfficer", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", @@ -16784,34 +17265,38 @@ "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" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": \"99966\"\r\n}", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", "options": { "raw": { "language": "json" @@ -16819,26 +17304,51 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "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": "User-GetUser-Other-DifferentInstitution-DataOfficer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ + "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\"))();", @@ -16859,7 +17369,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -16867,31 +17377,38 @@ "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/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "User" ] } }, "response": [] }, { - "name": "User-GetUser-Self-DataOfficer", + "name": "User-UpdateUser-SelfWithSameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var aliceIdentityId = parseInt(pm.environment.get(\"dataOfficerUserIdentityId\"));", + "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"dataOfficerUserId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -16905,8 +17422,12 @@ " 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(\"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" @@ -16914,7 +17435,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -16922,47 +17443,31 @@ "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", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "User", + "{{dataOfficerUserId}}" ] } }, "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": "User-UpdateUser-SelfWithWrongInstitution-DataOfficer", "event": [ { "listen": "test", @@ -16972,16 +17477,19 @@ "", "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;", "});", "", + "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" @@ -16989,7 +17497,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -16999,7 +17507,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "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" @@ -17007,39 +17515,28 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "User", + "{{dataOfficerUserId}}" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-DataOfficer", + "name": "User-UpdateUser-OtherWithSameInstitution-SameInstitutionId-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;", - "}", + "var institutionId = pm.environment.get(\"institutionIdFromUser\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -17048,26 +17545,21 @@ "});", "", "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.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Category name is set correctly and matching: \" + categoryName, function () {", - " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", - "});" + "pm.test(\"Institution Id is \" + institutionId, function() {", + " pm.expect(jsonData.institution.id).to.equal(parseInt(institutionId));", + "})" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -17075,28 +17567,36 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "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}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "User", + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "Category-GetCategory-DataOfficer", + "name": "User-GetUser-Other-SameInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", - "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", @@ -17106,14 +17606,11 @@ "});", "", "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);", - "});" + "" ], "type": "text/javascript" } @@ -17129,36 +17626,38 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "User", + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "Category-UpdateCategory-DataOfficer", + "name": "User-UpdateUser-Other-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 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;", "});" ], "type": "text/javascript" @@ -17176,7 +17675,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": \"99966\"\r\n}", "options": { "raw": { "language": "json" @@ -17184,21 +17683,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-DataOfficer", + "name": "User-GetUser-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", @@ -17216,14 +17715,15 @@ " 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", @@ -17232,75 +17732,126 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "User", + "{{createdUserId}}" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Project", - "item": [ - { - "name": "Project-CreateProject-DataOfficer", + "name": "User-GetUser-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var registeredUserId = pm.environment.get(\"dataOfficerUserId\");", - "var projectName = pm.environment.get(\"projectName\");", + "var aliceIdentityId = parseInt(pm.environment.get(\"dataOfficerUserIdentityId\"));", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId\", jsonData.id);", + "pm.environment.set(\"dataOfficerUserId\", 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(\"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(\"Identity Id is set correctly and matches: \" + registeredUserId, function () {", - " pm.expect(jsonData.user.id).to.eql(registeredUserId);", + "pm.test(\"Identity ID is correct and matching: \" + aliceIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(aliceIdentityId);", "});" ], "type": "text/javascript" } } ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/User", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "User" + ] + } + }, + "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", + "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;", + "});", + "", + "" + ], + "type": "text/javascript" + } + } + ], "request": { "method": "POST", "header": [ @@ -17312,7 +17863,7 @@ ], "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}", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", "options": { "raw": { "language": "json" @@ -17320,34 +17871,34 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Category" ] } }, "response": [] }, { - "name": "Project-GetAllProjects-DataOfficer", + "name": "Category-GetAllCategories-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var categoryName = pm.environment.get(\"categoryName\");", "", "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) {", + "function findCategory(jsonData, name) {", + " for (var i = 0; i < jsonData.length; i++) {", + " if (jsonData[i].name == name) {", " return i;", " }", " }", @@ -17366,13 +17917,13 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", + "pm.test(\"Category met: \" + categoryName + \" is in list\", function () {", + " foundAt = findCategory(jsonData, categoryName);", " 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.test(\"Category name is set correctly and matching: \" + categoryName, function () {", + " pm.expect(jsonData[foundAt].name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -17389,26 +17940,26 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Category" ] } }, "response": [] }, { - "name": "Project-GetProject-Self-DataOfficer", + "name": "Category-GetCategory-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var categoryName = pm.environment.get(\"categoryNameInitial\");", "", "var jsonData = pm.response.json();", "", @@ -17424,8 +17975,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(\"Tag name is set correctly and matches: \" + categoryName, function () {", + " pm.expect(jsonData.name).to.eql(categoryName);", "});" ], "type": "text/javascript" @@ -17442,21 +17993,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-GetProject-Other-DataOfficer", + "name": "Category-UpdateCategory-DataOfficer", "event": [ { "listen": "test", @@ -17464,12 +18015,12 @@ "exec": [ "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;", "});" @@ -17479,7 +18030,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -17487,45 +18038,48 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Self-DataOfficer", + "name": "Category-DeleteCategory-DataOfficer", "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" @@ -17533,7 +18087,7 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -17541,46 +18095,70 @@ "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/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-UpdateProject-Other-DataOfficer", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Project", + "item": [ + { + "name": "Project-CreateProject-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ + "var registeredUserId = pm.environment.get(\"dataOfficerUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId\", 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.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);", "});" ], "type": "text/javascript" @@ -17588,7 +18166,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17598,7 +18176,7 @@ ], "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": "{\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}", "options": { "raw": { "language": "json" @@ -17606,42 +18184,60 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-LikeProject-DataOfficer", + "name": "Project-CreateProject-OneCallToAction-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", - "});\r", - "" - ], - "type": "text/javascript" + "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 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: \" + dataOfficerUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(dataOfficerUserId);", + "});", + "", + "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" } } ], @@ -17654,41 +18250,66 @@ "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\": \"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/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-DeleteLikeProject-DataOfficer", + "name": "Project-CreateProject-MultipleCallToActions-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", - "});\r", + "var dataOfficerUserId = pm.environment.get(\"dataOfficerUserId\");", + "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 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: \" + 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" @@ -17696,7 +18317,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17704,43 +18325,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\": \"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/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Other-OtherInstitution-DataOfficer", + "name": "Project-CreateProject-CallToActionValueInvalid-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", "", "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.unauthorized;", - "});" + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -17748,48 +18390,48 @@ "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/Project/{{projectToBeDeletedByUnauthorizedRoles}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectToBeDeletedByUnauthorizedRoles}}" + "Project" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-DataOfficer", + "name": "Project-CreateProject-CallToActionLimitExceeded-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", - "});\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", - "})" + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", + "});", + "", + "" ], "type": "text/javascript" } @@ -17805,17 +18447,17 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "true\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" @@ -17823,48 +18465,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-Other-SameInstitution-DataOfficer", + "name": "Project-CreateProject-CallToActionSameAction-Data Officer", "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", - "\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", - "})" + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", + "});", + "", + "" ], "type": "text/javascript" } @@ -17880,17 +18512,17 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "false\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" @@ -17898,141 +18530,158 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectToMakePrivateId}}" + "Project" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-Registered", + "name": "Project-GetAllProjects-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 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": "POST", - "header": [ + "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", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Project" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-Registered", + "name": "Project-GetProject-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 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);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "CategorizeProject", - "item": [ + }, { - "name": "Project-CategorizeProject-Self-DataOfficer", + "name": "Project-GetProject-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", + "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" @@ -18040,7 +18689,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -18049,40 +18698,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-SameInstitution-DataOfficer", + "name": "Project-UpdateProject-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", + "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);", "});" ], "type": "text/javascript" @@ -18090,7 +18743,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -18098,35 +18751,46 @@ "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/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdWithInstitution}}", - "{{categoryIdToBeCategorized}}" + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-DifferentInstitution-DataOfficer", + "name": "Project-UpdateProject-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 401\", function () {\r", - " pm.response.to.have.status(401);\r", + "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" @@ -18134,7 +18798,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -18142,24 +18806,31 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "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/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectToBeDeletedByUnauthorizedRoles}}", - "{{categoryIdToBeCategorized}}" + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Self-DataOfficer", + "name": "Project-LikeProject-DataOfficer", "event": [ { "listen": "test", @@ -18177,14 +18848,15 @@ " 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", @@ -18193,23 +18865,22 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Other-SameInstitution-DataOfficer", + "name": "Project-DeleteLikeProject-DataOfficer", "event": [ { "listen": "test", @@ -18227,7 +18898,8 @@ " pm.response.to.be.ok;\r", " pm.response.to.be.withBody;\r", " pm.response.to.be.json;\r", - "});" + "});\r", + "" ], "type": "text/javascript" } @@ -18243,36 +18915,36 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectIdWithInstitution}}", - "{{categoryIdToBeCategorized}}" + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Other-DifferentInstitution-DataOfficer", + "name": "Project-DeleteProject-Other-OtherInstitution-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 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" } } @@ -18287,49 +18959,55 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project/{{projectToBeDeletedByUnauthorizedRoles}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "Project", - "category", - "{{projectToBeDeletedByUnauthorizedRoles}}", - "{{categoryIdToBeCategorized}}" + "{{projectToBeDeletedByUnauthorizedRoles}}" ] } }, "response": [] - } - ] - }, - { - "name": "Embed", - "item": [ + }, { - "name": "Embed-CreateEmbed-Self-DataOfficer", + "name": "Project-MakeInstitutionPrivate-DataOfficer", "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(\"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;", - "});", + "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" @@ -18337,17 +19015,17 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "raw": "true\r\n", "options": { "raw": { "language": "json" @@ -18355,55 +19033,74 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-Other-DataOfficer", + "name": "Project-MakeInstitutionPrivate-Other-SameInstitution-DataOfficer", "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", + "});\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": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "raw": "false\r\n", "options": { "raw": { "language": "json" @@ -18411,37 +19108,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectToMakePrivateId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "instituteprivate", + "{{projectToMakePrivateId}}" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-DataOfficer", + "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" @@ -18449,95 +19148,101 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-DataOfficer", + "name": "Project-UnlinkInstitution-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(\"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);", - "});" + "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": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] - }, + } + ] + }, + { + "name": "CategorizeProject", + "item": [ { - "name": "Embed-DeleteEmbed-Self-DataOfficer", + "name": "Project-CategorizeProject-Self-DataOfficer", "event": [ { "listen": "test", "script": { "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;", + "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" @@ -18545,7 +19250,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -18554,33 +19259,40 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-DifferentInstitution-DataOfficer", + "name": "Project-CategorizeProject-Other-SameInstitution-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 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" @@ -18588,7 +19300,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -18597,33 +19309,34 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{adminEmbedGuid}}" + "Project", + "category", + "{{projectIdWithInstitution}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-SameInstitution-DataOfficer", + "name": "Project-CategorizeProject-Other-DifferentInstitution-DataOfficer", "event": [ { "listen": "test", "script": { "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;", + "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" @@ -18631,7 +19344,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -18640,65 +19353,48 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuidWithInstitution}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuidWithInstitution}}" + "Project", + "category", + "{{projectToBeDeletedByUnauthorizedRoles}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-DataOfficer", + "name": "Project-UncategorizeProject-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;", - "});" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());\r", + "var jsonData = pm.response.json();\r", "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\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", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -18706,65 +19402,41 @@ "value": "{{dataOfficerUserIdentityId}}" } ], - "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}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-DataOfficer", + "name": "Project-UncategorizeProject-Other-SameInstitution-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(\"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);", + "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" @@ -18772,7 +19444,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -18781,47 +19453,34 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdWithInstitution}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "category", + "{{projectIdWithInstitution}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-DataOfficer", + "name": "Project-UncategorizeProject-Other-DifferentInstitution-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(\"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);", + "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" @@ -18829,7 +19488,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -18838,21 +19497,28 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectToBeDeletedByUnauthorizedRoles}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "category", + "{{projectToBeDeletedByUnauthorizedRoles}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Embed", + "item": [ { - "name": "Highlight-GetHighlight-ByProject-DataOfficer", + "name": "Embed-CreateEmbed-Self-DataOfficer", "event": [ { "listen": "test", @@ -18860,16 +19526,19 @@ "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 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.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "" ], @@ -18878,7 +19547,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -18886,23 +19555,30 @@ "value": "{{dataOfficerUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{projectId}}" + "Embed" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-DataOfficer", + "name": "Embed-CreateEmbed-Other-DataOfficer", "event": [ { "listen": "test", @@ -18912,12 +19588,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;", "});" @@ -18927,17 +19603,17 @@ } ], "request": { - "method": "PUT", + "method": "POST", "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 \"projectId\": {{adminProjectId}}\r\n}", "options": { "raw": { "language": "json" @@ -18945,33 +19621,37 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Embed" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Other-DataOfficer", + "name": "Embed-GetAllEmbeds-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" @@ -18979,7 +19659,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -18988,43 +19668,43 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Embed" ] } }, "response": [] - } - ] - }, - { - "name": "Role", - "item": [ + }, { - "name": "Role-CreateRole-DataOfficer", + "name": "Embed-GetEmbed-DataOfficer", "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 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(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", "});" ], "type": "text/javascript" @@ -19032,7 +19712,7 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", @@ -19040,47 +19720,34 @@ "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/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Role-GetAllRoles-DataOfficer", + "name": "Embed-DeleteEmbed-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(\"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.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -19088,7 +19755,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -19097,37 +19764,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-DataOfficer", + "name": "Embed-DeleteEmbed-Other-DifferentInstitution-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 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.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -19135,7 +19798,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -19144,38 +19807,33 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Embed/{{adminEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Embed", + "{{adminEmbedGuid}}" ] } }, "response": [] }, { - "name": "Role-GetRole-DataOfficer", + "name": "Embed-DeleteEmbed-Other-SameInstitution-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);", "});", "", + "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.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -19183,7 +19841,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -19192,21 +19850,26 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuidWithInstitution}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "{{embedGuidWithInstitution}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Highlight", + "item": [ { - "name": "Role-UpdateRole-DataOfficer", + "name": "Highlight-CreateHighlight-DataOfficer", "event": [ { "listen": "test", @@ -19228,10 +19891,24 @@ ], "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": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -19241,7 +19918,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 \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"Lorem Ipsum\"\r\n}", "options": { "raw": { "language": "json" @@ -19249,38 +19926,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Highlight" ] } }, "response": [] }, { - "name": "Role-SetRole-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].projectId == 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" @@ -19288,7 +19982,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -19296,63 +19990,56 @@ "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/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/Highlight", "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" - } + "Highlight" ] } }, "response": [] }, { - "name": "Role-DeleteRole-DataOfficer", + "name": "Highlight-GetHighlight-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 403\", function () {", - " pm.response.to.have.status(403);", - "});", + "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(\"Response must be valid and have a json body\", function () {", - " pm.response.to.be.forbidden;", - "});" - ], + "", + "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": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -19361,42 +20048,40 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Highlight", + "{{highlightId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-DataOfficer", + "name": "Highlight-GetHighlight-ByProject-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.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;", + "});", + "" ], "type": "text/javascript" } @@ -19412,31 +20097,22 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectName}}" + "Highlight", + "Project", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Wizard", - "item": [] - }, - { - "name": "Institution", - "item": [ + }, { - "name": "Institution-CreateInstitution-DataOfficer", + "name": "Highlight-UpdateHighlight-DataOfficer", "event": [ { "listen": "test", @@ -19446,30 +20122,32 @@ "", "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": "POST", - "header": [], + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" + } + ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\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" @@ -19477,37 +20155,33 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-DataOfficer", + "name": "Highlight-DeleteHighlight-Other-DataOfficer", "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 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.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.forbidden;", "});" ], "type": "text/javascript" @@ -19515,27 +20189,35 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "GET", - "header": [], + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Highlight", + "{{highlightId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Role", + "item": [ { - "name": "Institution-UpdateInstitution-DataOfficer", + "name": "Role-CreateRole-DataOfficer", "event": [ { "listen": "test", @@ -19545,12 +20227,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;", "});" @@ -19560,14 +20242,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, - "method": "PUT", - "header": [], + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\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" @@ -19575,21 +20260,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Role" ] } }, "response": [] }, { - "name": "Instituiton-DeleteInstitution-DataOfficer", + "name": "Role-GetAllRoles-DataOfficer", "event": [ { "listen": "test", @@ -19599,12 +20283,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;", "});" @@ -19614,52 +20298,29 @@ } ], "request": { - "method": "DELETE", - "header": [], + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" + } + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Role" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "CallToActionOption", - "item": [ - { - "name": "CallToActionOption-CreateCallToActionOption-DataOfficer", + "name": "Scope-GetAllScopes-DataOfficer", "event": [ { "listen": "test", @@ -19677,83 +20338,55 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-DataOfficer", + "name": "Role-GetRole-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", - "", "var jsonData = pm.response.json();", "", - "var foundAt;", + "eval(pm.environment.get(\"commonTests\"))();", "", - "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(\"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 with id: \" + optionId + \" is in list\", function () {", - " foundAt = findOption(jsonData, optionId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "" + "});" ], "type": "text/javascript" } @@ -19769,20 +20402,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-DataOfficer", + "name": "Role-UpdateRole-DataOfficer", "event": [ { "listen": "test", @@ -19790,100 +20424,81 @@ "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" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], + "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/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-DataOfficer", + "name": "Role-SetRole-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 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" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -19891,40 +20506,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/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "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": "CallToActionOption-UpdateCallToActionOption-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" @@ -19932,54 +20562,48 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "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/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Role", + "{{roleId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "Search", + "item": [ { - "name": "CallToActionOption-DeleteCallToActionOption-DataOffficer", + "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;", "});" @@ -19989,127 +20613,111 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Search", + "internal", + "{{projectName}}" ] } }, "response": [] } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } ] }, { - "name": "File", + "name": "Wizard", + "item": [] + }, + { + "name": "Institution", "item": [ { - "name": "Post-File-DataOfficer", + "name": "Institution-CreateInstitution-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", - "});" + "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": "{{dataOfficerUserIdentityId}}", - "type": "text" - } - ], + "header": [], "body": { - "mode": "formdata", - "formdata": [ - { - "key": "File", - "type": "file", - "src": "Postman/testimage.png" - } - ] + "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/File", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "User" ] } }, "response": [] }, { - "name": "Get-Files-DataOfficer", + "name": "Institution-GetInstitution-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();", + "", + "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" @@ -20117,42 +20725,98 @@ } ], "request": { + "auth": { + "type": "noauth" + }, "method": "GET", - "header": [ - { - "key": "IdentityId", - "value": "{{dataOfficerUserIdentityId}}", - "type": "text" + "header": [], + "url": { + "raw": "{{apiUrl}}/api/User/1", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "User", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Institution-UpdateInstitution-DataOfficer", + "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": "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/File", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "User", + "1" ] } }, "response": [] }, { - "name": "Delete-File-DataOfficer", + "name": "Instituiton-DeleteInstitution-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();", + "", + "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" @@ -20161,34 +20825,51 @@ ], "request": { "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/File/{{dataOfficerFileId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{dataOfficerFileId}}" + "User", + "1" ] } }, "response": [] } + ], + "auth": { + "type": "noauth" + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } ] }, { - "name": "WizardPage", + "name": "CallToActionOption", "item": [ { - "name": "WizardPage-CreateWizardPage-DataOfficer", + "name": "CallToActionOption-CreateCallToActionOption-DataOfficer", "event": [ { "listen": "test", @@ -20218,13 +20899,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", "options": { "raw": { "language": "json" @@ -20232,26 +20913,26 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-DataOfficer", + "name": "CallToActionOption-GetAllCallToActionOptions-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var pageId = parseInt(pm.environment.get(\"wizardPageId\"));", + "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", "", "var jsonData = pm.response.json();", "", @@ -20278,8 +20959,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", + "pm.test(\"Call to action option with id: \" + optionId + \" is in list\", function () {", + " foundAt = findOption(jsonData, optionId);", " pm.expect(foundAt).to.not.eql(-1);", "});", "" @@ -20298,20 +20979,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "CallToActionOption" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-DataOfficer", + "name": "CallToActionOption-GetCallToActionOptionById-DataOfficer", "event": [ { "listen": "test", @@ -20319,7 +21000,7 @@ "exec": [ "var jsonData = pm.response.json();", "", - "var wizardPageId = pm.environment.get(\"wizardPageId\");", + "pm.environment.set(\"callToActionOptionType\", jsonData.type);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -20333,8 +21014,12 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", + "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());", "});", "" ], @@ -20347,44 +21032,60 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-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 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(\"Call to action option id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", "" ], "type": "text/javascript" @@ -20392,7 +21093,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -20400,36 +21101,23 @@ "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/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "CallToActionOption", + "type", + "{{callToActionOptionType}}" ] } }, "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ + }, { - "name": "DataSource-GetAllDataSources-DataOfficer", + "name": "CallToActionOption-UpdateCallToActionOption-DataOfficer", "event": [ { "listen": "test", @@ -20437,46 +21125,56 @@ "exec": [ "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 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": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "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/DataSource", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-DataOfficer", + "name": "CallToActionOption-DeleteCallToActionOption-DataOffficer", "event": [ { "listen": "test", @@ -20484,131 +21182,144 @@ "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(\"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(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "WizardPage-UpdateWizardPage-DataOfficer", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "File", + "item": [ + { + "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" } } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", "value": "{{dataOfficerUserIdentityId}}", - "disabled": true + "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" + "mode": "formdata", + "formdata": [ + { + "key": "File", + "type": "file", + "src": "Postman/testimage.png" } - } + ] }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "File" ] } }, "response": [] - } - ] - }, - { - "name": "Cleanup Data Officer", - "item": [ + }, { - "name": "Project-DeleteProject-Self-DataOfficer", + "name": "Get-Files-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;", + "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" @@ -20616,43 +21327,42 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{dataOfficerUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/File", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "File" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Other-SameInstitution-DataOfficer", + "name": "Delete-File-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;", + "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" @@ -20669,56 +21379,52 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectIdWithInstitution}}", + "raw": "{{apiUrl}}/api/File/{{dataOfficerFileId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectIdWithInstitution}}" + "File", + "{{dataOfficerFileId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "WizardPage", + "item": [ { - "name": "User-UpdateUser-SelfWithNoInstitution-DataOfficer", + "name": "WizardPage-CreateWizardPage-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(\"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(\"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": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -20728,7 +21434,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\"\r\n}", + "raw": "{\r\n \"name\": \"postman_WizardPage-CreateWizardPage-Administrator\",\r\n \"description\": \"postman_WizardPage-CreateWizardPage-Administrator-Description\"\r\n}", "options": { "raw": { "language": "json" @@ -20736,56 +21442,56 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{dataOfficerUserId}}" + "WizardPage" ] } }, "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-GetAllWizardPages-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 () {", " 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" @@ -20793,116 +21499,153 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "WizardPage" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "WizardPage-GetWizardPageById-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": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] }, { - "name": "Institution-DeleteInstitution-Administrator", + "name": "WizardPage-UpdateWizardPage-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": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "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/Institution/{{createdInstitutionId}}", + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Institution", - "{{createdInstitutionId}}" + "WizardPage", + "{{wizardPageId}}" ] } }, "response": [] - }, + } + ] + }, + { + "name": "DataSource", + "item": [ { - "name": "User-DeleteUser-Other-SameInstitution-Administrator", + "name": "DataSource-GetAllDataSources-DataOfficer", "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);", @@ -20910,42 +21653,49 @@ "", "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" } } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserWithInstitutionId}}", + "raw": "{{apiUrl}}/api/DataSource", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserWithInstitutionId}}" + "DataSource" ] } }, "response": [] }, { - "name": "User-DeleteUser-Other-DifferentInstitution-Administrator", + "name": "WizardPage-GetWizardPageById-DataOfficer", "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 () {", @@ -20954,191 +21704,161 @@ "", "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", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "WizardPage-UpdateWizardPage-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 403\", function () {", + " pm.response.to.have.status(403);", "});", "", - "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.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}", + "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/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "DataSource", + "{{dataSourceId}}" ] } }, "response": [] } ] - } - ] - }, - { - "name": "PR", - "item": [ + }, { - "name": "Preparation", + "name": "Cleanup Data Officer", "item": [ { - "name": "User-CreateUser", + "name": "Project-DeleteProject-Self-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.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.ok;", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], - "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/User", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Project-CreateProject", + "name": "Project-DeleteProject2-Self-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);", - "", - "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(\"Identity ID is correct and matching: \" + administratorUserId, function () {", - " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -21146,17 +21866,17 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{dataOfficerUserIdentityId}}" } ], "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": "", "options": { "raw": { "language": "json" @@ -21164,71 +21884,48 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "Project", + "{{projectId2}}" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "Project-DeleteProject3-Self-DataOfficer", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", - "var jsonData = pm.response.json();", - "", - "pm.environment.set(\"highlightId\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});", + "eval(pm.environment.get(\"commonTests\"))();", "", - "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" } - }, - { - "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": "{{dataOfficerUserIdentityId}}" } ], "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}", + "raw": "", "options": { "raw": { "language": "json" @@ -21236,38 +21933,34 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "{{projectId3}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed", + "name": "Project-DeleteProject-Other-SameInstitution-DataOfficer", "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 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;", "});" ], "type": "text/javascript" @@ -21275,143 +21968,75 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "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/Project/{{projectIdWithInstitution}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "{{projectIdWithInstitution}}" ] } }, "response": [] }, { - "name": "CallToActionOption-CreateCallToActionOption", + "name": "User-UpdateUser-SelfWithNoInstitution-DataOfficer", "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());", - "});", + "var updatedAliceEmail = pm.environment.get(\"updatedAliceEmail\");", "", - "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" - } - } - }, - "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "CallToActionOption" - ] - } - }, - "response": [] - }, - { - "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 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(\"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": "POST", + "method": "PUT", "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}", + "raw": "{\r\n \"name\": \"postman_DataOfficer-alicez\",\r\n \"email\": \"{{updatedAliceEmail}}\",\r\n \"identityId\": \"{{dataOfficerUserIdentityId}}\"\r\n}", "options": { "raw": { "language": "json" @@ -21419,20 +22044,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/User/{{dataOfficerUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "User", + "{{dataOfficerUserId}}" ] } }, "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", @@ -21455,27 +22080,19 @@ ] }, { - "name": "User", + "name": "Cleanup Administrator", "item": [ { - "name": "User-CreateUser-PR", + "name": "CallToActionOption-DeleteCallToActionOption-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);", "});", "" ], @@ -21484,111 +22101,79 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "CallToActionOption", + "{{callToActionOptionId}}" ] } }, "response": [] }, { - "name": "User-GetUser-Other-PR", + "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": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{createdUserId}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "User-GetUser-Self-PR", + "name": "Institution-DeleteInstitution-Administrator", "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(\"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(\"Identity ID is correct and matching: \" + prUserIdentityId, function () {", - " pm.expect(parseInt(jsonData.identityId)).to.eql(prUserIdentityId);", "});" ], "type": "text/javascript" @@ -21596,38 +22181,35 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Institution/{{createdInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Institution", + "{{createdInstitutionId}}" ] } }, "response": [] }, { - "name": "User-UpdateUser-Self-PR", + "name": "User-DeleteUser-Other-SameInstitution-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedPrUserEmail = pm.environment.get(\"updatedPrUserEmail\");", - "", - "var jsonData = pm.response.json();", - "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -21636,12 +22218,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: \" + updatedPrUserEmail, function () {", - " pm.expect(jsonData.email).to.eql(updatedPrUserEmail);", "});" ], "type": "text/javascript" @@ -21649,56 +22225,43 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{administratorUserIdentityId}}" } ], - "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/User/{{createdUserWithInstitutionId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{PrUserId}}" + "{{createdUserWithInstitutionId}}" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-PR", + "name": "User-DeleteUser-Other-DifferentInstitution-Administrator", "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;", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -21706,23 +22269,14 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], - "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}}", "host": [ @@ -21736,47 +22290,77 @@ } }, "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": "WizardPage-DeleteWizardPage-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "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" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage", + "{{wizardPageId}}" + ] + } + }, + "response": [] } ] - }, + } + ] + }, + { + "name": "PR", + "item": [ { - "name": "FollowUser", + "name": "Preparation", "item": [ { - "name": "User-FollowUser-PR", + "name": "User-CreateUser", "event": [ { "listen": "test", "script": { "exec": [ + "var userName = pm.environment.get(\"userName\");", + "", "var jsonData = pm.response.json();", - "var userId = pm.environment.get(\"userIdToFollow\");", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"createdUserId\", jsonData.id);", + "pm.environment.set(\"identityId\", 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 () {", @@ -21785,9 +22369,11 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if created Username matches: \" + userId, function () {", - " pm.expect(jsonData.id).to.eql(userId);", - "});" + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userName, function () {", + " pm.expect(jsonData.name).to.eql(userName);", + "});", + "" ], "type": "text/javascript" } @@ -21799,12 +22385,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\n\t\"identityId\": \"99966\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_PR-User-CreateUser@example.com\"\n}", "options": { "raw": { "language": "json" @@ -21812,50 +22398,73 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "User" ] } }, "response": [] }, { - "name": "User-UnFollowUser-PR", + "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" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "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" @@ -21863,66 +22472,53 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "follow", - "{{userIdToFollow}}" + "Project" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "Category", - "item": [ - { - "name": "Category-CreateCategory-PR", + "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 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.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" @@ -21935,12 +22531,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "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" @@ -21948,59 +22544,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Highlight" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-PR", + "name": "Embed-CreateEmbed", "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.environment.set(\"embedGuid\", 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.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);", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -22008,116 +22583,83 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Embed" ] } }, "response": [] }, { - "name": "Category-GetCategory-PR", + "name": "CallToActionOption-CreateCallToActionOption", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", - "", "var jsonData = pm.response.json();", "", - "eval(pm.environment.get(\"commonTests\"))();", + "pm.environment.set(\"callToActionOptionId\", 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.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.success;", + " 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" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Category", - "{{categoryIdToBeCategorized}}" - ] - } - }, - "response": [] - }, - { - "name": "Category-UpdateCategory-PR", - "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(\"Call to action option type is lowercase\", function () {", + " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", "});", "", - "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(\"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", "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{administratorUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", "options": { "raw": { "language": "json" @@ -22125,21 +22667,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "CallToActionOption" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-PR", + "name": "WizardPage-CreateWizardPage-Administrator", "event": [ { "listen": "test", @@ -22147,46 +22688,59 @@ "exec": [ "var jsonData = pm.response.json();", "", + "pm.environment.set(\"wizardPageId\", 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.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "", + "" ], "type": "text/javascript" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}" + "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/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/WizardPage", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "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", @@ -22209,34 +22763,29 @@ ] }, { - "name": "Project", + "name": "User", "item": [ { - "name": "Project-CreateProject-PR", + "name": "User-CreateUser-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var PrUserId = pm.environment.get(\"PrUserId\");", - "var projectName = pm.environment.get(\"projectName\");", - "", "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(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", - "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.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", - "", - "pm.test(\"User Id is set correctly and matches: \" + PrUserId, function () {", - " pm.expect(jsonData.user.id).to.eql(PrUserId);", - "});" + "" ], "type": "text/javascript" } @@ -22247,13 +22796,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}", + "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", "options": { "raw": { "language": "json" @@ -22261,60 +22810,39 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User" ] } }, "response": [] }, { - "name": "Project-GetAllProjects-PR", + "name": "User-GetUser-Other-PR", "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 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(\"Project: \" + projectName + \" is in list\", function () {", - " foundAt = findProject(jsonData, projectName);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.forbidden;", + " 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[foundAt].name).to.eql(projectName);", - "});" + "" ], "type": "text/javascript" } @@ -22330,28 +22858,30 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Project-GetProject-Self-PR", + "name": "User-GetUser-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var projectName = pm.environment.get(\"projectName\");", + "var prUserIdentityId = parseInt(pm.environment.get(\"prUserIdentityId\"));", "", "var jsonData = pm.response.json();", + "pm.environment.set(\"PrUserId\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -22360,13 +22890,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(\"Project Name is set correctly and matches: \" + projectName, function () {", - " pm.expect(jsonData.name).to.eql(projectName);", + "pm.test(\"Identity ID is correct and matching: \" + prUserIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(prUserIdentityId);", "});" ], "type": "text/javascript" @@ -22383,26 +22913,29 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "User" ] } }, "response": [] }, { - "name": "Project-GetProject-Other-PR", + "name": "User-UpdateUser-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var updatedPrUserEmail = pm.environment.get(\"updatedPrUserEmail\");", + "", + "var jsonData = pm.response.json();", + "", "eval(pm.environment.get(\"commonTests\"))();", "", "pm.test(\"Status code is 200\", function () {", @@ -22410,9 +22943,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(\"Check if email update matches: \" + updatedPrUserEmail, function () {", + " pm.expect(jsonData.email).to.eql(updatedPrUserEmail);", "});" ], "type": "text/javascript" @@ -22420,53 +22957,56 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], + "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/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/User/{{PrUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "User", + "{{PrUserId}}" ] } }, "response": [] }, { - "name": "Project-UpdateProject-Self-PR", + "name": "User-UpdateUser-Other-PR", "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 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.unauthorized;", " 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" @@ -22484,7 +23024,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\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}", + "raw": "{\r\n \"name\": \"bobz\",\r\n \"email\": \"BobSmith@email.com\",\r\n \"identityId\": {{administratorUserIdentityId}}\r\n}", "options": { "raw": { "language": "json" @@ -22492,36 +23032,69 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "User", + "{{createdUserId}}" ] } }, "response": [] + } + ], + "description": "Requests executed as the Alice user with the registered role.", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-UpdateProject-Other-PR", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "FollowUser", + "item": [ + { + "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 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" @@ -22529,7 +23102,7 @@ } ], "request": { - "method": "PUT", + "method": "POST", "header": [ { "key": "IdentityId", @@ -22539,7 +23112,7 @@ ], "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" @@ -22547,39 +23120,32 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] }, { - "name": "Project-LikeProject-PR", + "name": "User-UnFollowUser-PR", "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" @@ -22587,7 +23153,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -22595,49 +23161,84 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Project-DeleteLikeProject-PR", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Category", + "item": [ + { + "name": "Category-CreateCategory-PR", "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", + "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": "POST", "header": [ { "key": "IdentityId", @@ -22645,35 +23246,69 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "like", - "{{projectId}}" + "Category" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Other-PR", + "name": "Category-GetAllCategories-PR", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 401\", function () {", - " pm.response.to.have.status(401);", - "});", + "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.unauthorized;", + " 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" @@ -22681,7 +23316,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -22690,113 +23325,89 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "Category" ] } }, "response": [] }, { - "name": "Project-MakeInstitutionPrivate-PR", + "name": "Category-GetCategory-PR", "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", - "\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": [ - "" + "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);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "true\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "instituteprivate", - "{{projectId}}" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-LinkInstitutionToProject-PR", + "name": "Category-UpdateCategory-PR", "event": [ { "listen": "test", "script": { "exec": [ - "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", + "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" @@ -22804,47 +23415,57 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Project-UnlinkInstitution-PR", + "name": "Category-DeleteCategory-PR", "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();", + "", + "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" } @@ -22855,55 +23476,74 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", + "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "linkedinstitution", - "{{projectId}}", - "1" + "Category", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] } - ] - }, - { - "name": "FollowProject", - "item": [ + ], + "event": [ { - "name": "Project-FollowProject-PR", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();", - "var projectId = pm.environment.get(\"projectIdToFollow\");", - "", - "eval(pm.environment.get(\"commonTests\"))();", + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Project", + "item": [ + { + "name": "Project-CreateProject-PR", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var PrUserId = pm.environment.get(\"PrUserId\");", + "var projectName = pm.environment.get(\"projectName\");", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "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(\"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(\"Check if created project id matches: \" + projectId, function () {", - " pm.expect(jsonData.id).to.eql(projectId);", + "pm.test(\"User Id is set correctly and matches: \" + PrUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(PrUserId);", "});" ], "type": "text/javascript" @@ -22915,13 +23555,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], "body": { "mode": "raw", - "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}", "options": { "raw": { "language": "json" @@ -22929,32 +23569,57 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UnFollowProject-PR", + "name": "Project-CreateProject-OneCallToAction-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var PrUserId = pm.environment.get(\"PrUserId\");", + "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(\"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: \" + PrUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(PrUserId);", "});", + "", + "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" @@ -22962,7 +23627,7 @@ } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -22972,7 +23637,7 @@ ], "body": { "mode": "raw", - "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" @@ -22980,65 +23645,57 @@ } }, "url": { - "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "project", - "follow", - "{{projectIdToFollow}}" + "Project" ] } }, "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "CategorizeProject", - "item": [ - { - "name": "Project-CategorizeProject-Self-PR", + "name": "Project-CreateProject-MultipleCallToActions-PR", "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 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 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: \" + 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" } @@ -23053,36 +23710,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-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/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] }, { - "name": "Project-CategorizeProject-Other-PR", + "name": "Project-CreateProject-CallToActionValueInvalid-PR", "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 projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "", + "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\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -23097,93 +23775,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\": \"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/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] }, { - "name": "Project-UncategorizeProject-Self-PR", + "name": "Project-CreateProject-CallToActionLimitExceeded-PR", "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 projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", + "});", + "", + "" ], "type": "text/javascript" } - } - ], - "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "category", - "{{projectId}}", - "{{categoryIdToBeCategorized}}" - ] - } - }, - "response": [] - }, - { - "name": "Project-UncategorizeProject-Other-PR", - "event": [ + }, { - "listen": "test", + "listen": "prerequest", "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": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -23191,50 +23840,56 @@ "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/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "category", - "{{projectIdToCategorize}}", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] - } - ] - }, - { - "name": "Embed", - "item": [ + }, { - "name": "Embed-CreateEmbed-Self-PR", + "name": "Project-CreateProject-CallToActionSameAction-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "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 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.success;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", - "});", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ "" ], "type": "text/javascript" @@ -23246,13 +23901,13 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}}\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" @@ -23260,85 +23915,96 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed-Other-PR", + "name": "Project-GetAllProjects-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"otherEmbedGuid\", jsonData.guid);", - "pm.environment.set(\"otherEmbeddedProjectId\", jsonData.project.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\"))();", "", - "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(\"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": "POST", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project" ] } }, "response": [] }, { - "name": "Embed-GetAllEmbeds-PR", + "name": "Project-GetProject-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var projectName = pm.environment.get(\"projectName\");", + "", "var jsonData = pm.response.json();", "", "eval(pm.environment.get(\"commonTests\"))();", @@ -23348,9 +24014,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(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -23362,34 +24032,31 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/Embed", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Self-PR", + "name": "Project-GetProject-Other-PR", "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 () {", @@ -23400,10 +24067,6 @@ " 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" @@ -23420,27 +24083,27 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Embed-GetEmbed-Other-PR", + "name": "Project-UpdateProject-Self-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var otherEmbeddedProjectId = parseInt(pm.environment.get(\"otherEmbeddedProjectId\"))", + "var projectName = pm.environment.get(\"projectNameUpdated\");", "", "var jsonData = pm.response.json();", "", @@ -23451,13 +24114,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 matches: \" + otherEmbeddedProjectId, function () {", - " pm.expect(jsonData.id).to.eql(otherEmbeddedProjectId);", + "pm.test(\"Project Name is set correctly and matches: \" + projectName, function () {", + " pm.expect(jsonData.name).to.eql(projectName);", "});" ], "type": "text/javascript" @@ -23465,7 +24128,7 @@ } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -23473,34 +24136,46 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{projectNameUpdated}}\",\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}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Embed/{{otherEmbedGuid}}", + "raw": "{{apiUrl}}/api/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{otherEmbedGuid}}" + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Self-PR", + "name": "Project-UpdateProject-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "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);", "});", "", - "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.unauthorized;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -23508,7 +24183,7 @@ } ], "request": { - "method": "DELETE", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -23516,42 +24191,57 @@ "value": "{{prUserIdentityId}}" } ], + "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/Embed/{{embedGuid}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{embedGuid}}" + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Embed-DeleteEmbed-Other-PR", + "name": "Project-LikeProject-PR", "event": [ { "listen": "test", "script": { "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;", - "});" + "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", @@ -23560,59 +24250,40 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Embed/{{otherEmbedGuid}}", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Embed", - "{{otherEmbedGuid}}" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] - } - ] - }, - { - "name": "Highlight", - "item": [ + }, { - "name": "Highlight-CreateHighlight-Self-PR", + "name": "Project-DeleteLikeProject-PR", "event": [ { "listen": "test", "script": { "exec": [ - "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", + "var jsonData = pm.response.json();\r", "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\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" @@ -23620,7 +24291,7 @@ } ], "request": { - "method": "POST", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -23628,139 +24299,35 @@ "value": "{{prUserIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Self-PR\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/like/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "like", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Self-PR", + "name": "Project-DeleteProject-Other-PR", "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(\"Status code is 401\", function () {", + " pm.response.to.have.status(401);", "});", "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Highlight", - "{{highlightId}}" - ] - } - }, - "response": [] - }, - { - "name": "Highlight-GetHighlight-ByProject-Self-PR", - "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);", + " pm.response.to.be.unauthorized;", "});" ], "type": "text/javascript" @@ -23768,7 +24335,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -23777,40 +24344,47 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", "Project", - "{{projectId}}" + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Self-PR", + "name": "Project-MakeInstitutionPrivate-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(\"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(true);\r", + "})\r", + "\r", + "pm.test(\"institute is added\", function(){\r", + " pm.expect(jsonData.linkedInstitutions).not.empty.null;\r", + "})" ], "type": "text/javascript" } @@ -23819,8 +24393,7 @@ "listen": "prerequest", "script": { "exec": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" + "" ], "type": "text/javascript" } @@ -23837,7 +24410,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Self-PR\"\r\n}", + "raw": "true\r\n", "options": { "raw": { "language": "json" @@ -23845,54 +24418,40 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/instituteprivate/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "instituteprivate", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight-Other-PR", + "name": "Project-LinkInstitutionToProject-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "pm.environment.set(\"adminHighlightId\", 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", + "var jsonData = pm.response.json();\r", "\r", - "var future_timestamp = new Date(Date.now() +(2 * 86400000));\r", - "postman.setEnvironmentVariable(\"future_timestamp\", future_timestamp.toISOString());\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" } @@ -23903,122 +24462,87 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Other-PR\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Other-PR", + "name": "Project-UnlinkInstitution-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var adminHighlightId = parseInt(pm.environment.get(\"adminHighlightId\"));", - "", - "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: \" + adminHighlightId, function () {", - " pm.expect(jsonData.id).to.eql(adminHighlightId);", - "});" + "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": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", + "raw": "{{apiUrl}}/api/Project/linkedinstitution/{{projectId}}/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{adminHighlightId}}" + "Project", + "linkedinstitution", + "{{projectId}}", + "1" ] } }, "response": [] - }, + } + ] + }, + { + "name": "FollowProject", + "item": [ { - "name": "Highlight-GetHighlight-ByProject-Other-PR", + "name": "Project-FollowProject-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var adminProjectId = parseInt(pm.environment.get(\"adminProjectId\"));", - "var adminHighlightId = parseInt(pm.environment.get(\"adminHighlightId\"));", - "", "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;", - "}", + "var projectId = pm.environment.get(\"projectIdToFollow\");", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -24027,19 +24551,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.test(\"Project is in list and matching: \" + adminProjectId, function () {", - " foundAt = findProjectId(jsonData, adminProjectId);", - " pm.expect(foundAt).to.not.eql(-1);", + " pm.response.to.be.success;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Highlight is in list and matching:\" + adminHighlightId, function () {", - " foundAt = findHighlightId(jsonData, adminHighlightId);", - " pm.expect(foundAt).to.not.eql(-1);", + "pm.test(\"Check if created project id matches: \" + projectId, function () {", + " pm.expect(jsonData.id).to.eql(projectId);", "});" ], "type": "text/javascript" @@ -24047,7 +24565,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -24055,58 +24573,50 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Highlight/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "Project", - "{{adminProjectId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] }, { - "name": "Highlight-UpdateHighlight-Other-PR", + "name": "Project-UnFollowProject-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(\"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": [ - "var current_timestamp = new Date();\r", - "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" + "" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -24116,7 +24626,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Other-PR\"\r\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -24124,56 +24634,64 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", + "raw": "{{apiUrl}}/api/project/follow/{{projectIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{adminHighlightId}}" + "project", + "follow", + "{{projectIdToFollow}}" ] } }, "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } }, { - "name": "Highlight-GetAllActiveHighlights-PR", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "CategorizeProject", + "item": [ + { + "name": "Project-CategorizeProject-Self-PR", "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(\"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);", + "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" @@ -24181,7 +24699,7 @@ } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -24190,27 +24708,84 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Self-PR", + "name": "Project-CategorizeProject-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "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": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-UncategorizeProject-Self-PR", + "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" @@ -24227,28 +24802,34 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectId}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Project", + "category", + "{{projectId}}", + "{{categoryIdToBeCategorized}}" ] } }, "response": [] }, { - "name": "Highlight-DeleteHighlight-Other-PR", + "name": "Project-UncategorizeProject-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "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" @@ -24265,14 +24846,16 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", + "raw": "{{apiUrl}}/api/Project/category/{{projectIdToCategorize}}/{{categoryIdToBeCategorized}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{adminHighlightId}}" + "Project", + "category", + "{{projectIdToCategorize}}", + "{{categoryIdToBeCategorized}}" ] } }, @@ -24281,10 +24864,10 @@ ] }, { - "name": "Role", + "name": "Embed", "item": [ { - "name": "Role-CreateRole-PR", + "name": "Embed-CreateEmbed-Self-PR", "event": [ { "listen": "test", @@ -24292,17 +24875,21 @@ "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 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" } @@ -24313,13 +24900,13 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "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}", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", "options": { "raw": { "language": "json" @@ -24327,20 +24914,20 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed" ] } }, "response": [] }, { - "name": "Role-GetAllRoles-PR", + "name": "Embed-CreateEmbed-Other-PR", "event": [ { "listen": "test", @@ -24348,46 +24935,59 @@ "exec": [ "var jsonData = pm.response.json();", "", + "pm.environment.set(\"otherEmbedGuid\", jsonData.guid);", + "pm.environment.set(\"otherEmbeddedProjectId\", jsonData.project.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.success;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});" + "});", + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{adminProjectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Role", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role" + "Embed" ] } }, "response": [] }, { - "name": "Scope-GetAllScopes-PR", + "name": "Embed-GetAllEmbeds-PR", "event": [ { "listen": "test", @@ -24397,12 +24997,12 @@ "", "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;", "});" @@ -24416,43 +25016,48 @@ "header": [ { "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" + "value": "{{prUserIdentityId}}", + "type": "text" } ], "url": { - "raw": "{{apiUrl}}/api/Role/Scopes", + "raw": "{{apiUrl}}/api/Embed", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "Scopes" + "Embed" ] } }, "response": [] }, { - "name": "Role-GetRole-PR", + "name": "Embed-GetEmbed-Self-PR", "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 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(\"Embed matches: \" + embeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(embeddedProjectId);", "});" ], "type": "text/javascript" @@ -24469,38 +25074,44 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Role/{{roleId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "{{embedGuid}}" ] } }, "response": [] }, { - "name": "Role-UpdateRole-PR", + "name": "Embed-GetEmbed-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var otherEmbeddedProjectId = parseInt(pm.environment.get(\"otherEmbeddedProjectId\"))", + "", "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(\"Embed matches: \" + otherEmbeddedProjectId, function () {", + " pm.expect(jsonData.id).to.eql(otherEmbeddedProjectId);", "});" ], "type": "text/javascript" @@ -24508,7 +25119,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -24516,48 +25127,34 @@ "value": "{{prUserIdentityId}}" } ], - "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/Embed/{{otherEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Role", - "{{roleId}}" + "Embed", + "{{otherEmbedGuid}}" ] } }, "response": [] }, { - "name": "Role-SetRole-PR", + "name": "Embed-DeleteEmbed-Self-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(\"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.forbidden;", - " pm.response.to.be.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.ok;", "});" ], "type": "text/javascript" @@ -24565,7 +25162,7 @@ } ], "request": { - "method": "PUT", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -24573,63 +25170,34 @@ "value": "{{prUserIdentityId}}" } ], - "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/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", + "raw": "{{apiUrl}}/api/Embed/{{embedGuid}}", "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" - } + "Embed", + "{{embedGuid}}" ] } }, "response": [] - } - ] - }, - { - "name": "Search", - "item": [ + }, { - "name": "Search-SearchInternal-PR", + "name": "Embed-DeleteEmbed-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "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;", "});" ], "type": "text/javascript" @@ -24637,7 +25205,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -24646,15 +25214,14 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", + "raw": "{{apiUrl}}/api/Embed/{{otherEmbedGuid}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Search", - "internal", - "{{projectName}}" + "Embed", + "{{otherEmbedGuid}}" ] } }, @@ -24663,14 +25230,10 @@ ] }, { - "name": "Wizard", - "item": [] - }, - { - "name": "Institution", + "name": "Highlight", "item": [ { - "name": "Institution-CreateInstitution-PR", + "name": "Highlight-CreateHighlight-Self-PR", "event": [ { "listen": "test", @@ -24678,17 +25241,32 @@ "exec": [ "var jsonData = pm.response.json();", "", + "pm.environment.set(\"highlightId\", 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" + } + }, + { + "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" @@ -24696,14 +25274,17 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "POST", - "header": [], + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"98764342123\",\n \"name\": \"mycooltestusername\",\n \"email\": \"postmantest_email@example.com\"\n}", + "raw": "{\r\n \"projectId\": {{projectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Self-PR\"\r\n}", "options": { "raw": { "language": "json" @@ -24711,37 +25292,47 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "Highlight" ] } }, "response": [] }, { - "name": "Institution-GetInstitution-PR", + "name": "Highlight-GetHighlight-Self-PR", "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 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(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -24749,44 +25340,81 @@ } ], "request": { - "auth": { - "type": "noauth" - }, "method": "GET", - "header": [], + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Institution-UpdateInstitution-PR", + "name": "Highlight-GetHighlight-ByProject-Self-PR", "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].projectId == item) {", + " 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.withBody;", - " pm.response.to.be.json;", + " 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" @@ -24794,36 +25422,31 @@ } ], "request": { - "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" - } + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" } - }, + ], "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Highlight/Project/{{projectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Highlight", + "Project", + "{{projectId}}" ] } }, "response": [] }, { - "name": "Instituiton-DeleteInstitution-PR", + "name": "Highlight-UpdateHighlight-Self-PR", "event": [ { "listen": "test", @@ -24833,85 +25456,96 @@ "", "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;", "});" ], "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": "DELETE", - "header": [], + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Self-PR\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/User/1", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "1" + "Highlight", + "{{highlightId}}" ] } }, "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } }, { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "CallToActionOption", - "item": [ - { - "name": "CallToActionOption-CreateCallToActionOption-PR", + "name": "Highlight-CreateHighlight-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", + "pm.environment.set(\"adminHighlightId\", 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.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" @@ -24923,13 +25557,13 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "raw": "{\r\n \"projectId\": {{adminProjectId}},\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Other-PR\"\r\n}", "options": { "raw": { "language": "json" @@ -24937,39 +25571,32 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Highlight" ] } }, "response": [] }, { - "name": "CallToActionOption-GetAllCallToActionOptions-PR", + "name": "Highlight-GetHighlight-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ - "var optionId = parseInt(pm.environment.get(\"callToActionOptionId\"));", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var adminHighlightId = parseInt(pm.environment.get(\"adminHighlightId\"));", "", "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;", - "}", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -24978,16 +25605,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.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);", - "});", - "" + "pm.test(\"Highlight Id matches: \" + adminHighlightId, function () {", + " pm.expect(jsonData.id).to.eql(adminHighlightId);", + "});" ], "type": "text/javascript" } @@ -25003,28 +25628,51 @@ } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "Highlight", + "{{adminHighlightId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionById-PR", + "name": "Highlight-GetHighlight-ByProject-Other-PR", "event": [ { "listen": "test", "script": { "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var adminProjectId = parseInt(pm.environment.get(\"adminProjectId\"));", + "var adminHighlightId = parseInt(pm.environment.get(\"adminHighlightId\"));", + "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"callToActionOptionType\", jsonData.type);", + "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].projectId == item) {", + " return i;", + " }", + " }", + " return -1;", + "}", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -25033,19 +25681,20 @@ "});", "", "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 type is lowercase\", function () {", - " pm.expect(jsonData.type).to.eql(jsonData.type.toLowerCase());", + "pm.test(\"Project is in list and matching: \" + adminProjectId, function () {", + " foundAt = findProjectId(jsonData, adminProjectId);", + " pm.expect(foundAt).to.not.eql(-1);", "});", "", - "pm.test(\"Call to action option value is lowercase\", function () {", - " pm.expect(jsonData.value).to.eql(jsonData.value.toLowerCase());", - "});", - "" + "pm.test(\"Highlight is in list and matching:\" + adminHighlightId, function () {", + " foundAt = findHighlightId(jsonData, adminHighlightId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});" ], "type": "text/javascript" } @@ -25056,44 +25705,34 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/Highlight/Project/{{adminProjectId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Highlight", + "Project", + "{{adminProjectId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-GetCallToActionOptionByType-PR", + "name": "Highlight-UpdateHighlight-Other-PR", "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 () {", @@ -25104,20 +25743,24 @@ " 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" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var current_timestamp = new Date();\r", + "postman.setEnvironmentVariable(\"current_timestamp\", current_timestamp.toISOString());" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -25125,40 +25768,66 @@ "value": "{{prUserIdentityId}}" } ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": \"{{projectId}}\",\r\n \"startDate\": \"{{current_timestamp}}\",\r\n \"endDate\": \"{{future_timestamp}}\",\r\n \"description\" : \"postman_Highlight-CreateHighlight-Other-PR\"\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "type", - "{{callToActionOptionType}}" + "Highlight", + "{{adminHighlightId}}" ] } }, "response": [] }, { - "name": "CallToActionOption-UpdateCallToActionOption-PR", + "name": "Highlight-GetAllActiveHighlights-PR", "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].projectId == 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" @@ -25166,56 +25835,36 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], - "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/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "Highlight" ] } }, "response": [] }, { - "name": "CallToActionOption-DeleteCallToActionOption-PR", + "name": "Highlight-DeleteHighlight-Self-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);", "});" ], "type": "text/javascript" @@ -25227,167 +25876,33 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "CallToActionOption", - "{{callToActionOptionId}}" - ] - } - }, - "response": [] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "File", - "item": [ - { - "name": "Post-File-PR", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "\r", - "pm.environment.set(\"prFileId\", 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", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "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-PR", - "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", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Delete-File-PR", + "name": "Highlight-DeleteHighlight-Other-PR", "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", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" @@ -25399,19 +25914,19 @@ "header": [ { "key": "IdentityId", - "value": "{{prUserIdentityId}}", - "type": "text" + "type": "text", + "value": "{{prUserIdentityId}}" } ], "url": { - "raw": "{{apiUrl}}/api/File/{{prFileId}}", + "raw": "{{apiUrl}}/api/Highlight/{{adminHighlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "File", - "{{prFileId}}" + "Highlight", + "{{adminHighlightId}}" ] } }, @@ -25420,10 +25935,10 @@ ] }, { - "name": "WizardPage", + "name": "Role", "item": [ { - "name": "WizardPage-CreateWizardPage-PR", + "name": "Role-CreateRole-PR", "event": [ { "listen": "test", @@ -25441,8 +25956,7 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } @@ -25459,7 +25973,7 @@ ], "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\": \"{{roleName}}\",\r\n \"scopes\": [\r\n {\r\n \"scope\": \"EmbedWrite\"\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -25467,57 +25981,38 @@ } }, "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Role" ] } }, "response": [] }, { - "name": "WizardPage-GetAllWizardPages-PR", + "name": "Role-GetAllRoles-PR", "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(\"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(\"Wizard page with id: \" + pageId + \" is in list\", function () {", - " foundAt = findOption(jsonData, pageId);", - " pm.expect(foundAt).to.not.eql(-1);", - "});", - "" + "});" ], "type": "text/javascript" } @@ -25533,20 +26028,20 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage", + "raw": "{{apiUrl}}/api/Role", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage" + "Role" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-PR", + "name": "Scope-GetAllScopes-PR", "event": [ { "listen": "test", @@ -25554,24 +26049,17 @@ "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(\"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(\"Check previously created wizard page with id \" + wizardPageId, function () {", - " pm.expect(jsonData.id).to.eql(wizardPageId);", - "});", - "" + "});" ], "type": "text/javascript" } @@ -25587,21 +26075,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/Role/Scopes", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "Role", + "Scopes" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-PR", + "name": "Role-GetRole-PR", "event": [ { "listen": "test", @@ -25619,78 +26107,14 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" - } - ], - "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}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "WizardPage", - "{{wizardPageId}}" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "DataSource", - "item": [ - { - "name": "DataSource-GetAllDataSources-PR", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "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" - } - } - ], - "request": { - "method": "GET", + "method": "GET", "header": [ { "key": "IdentityId", @@ -25699,20 +26123,21 @@ } ], "url": { - "raw": "{{apiUrl}}/api/DataSource", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "WizardPage-GetWizardPageById-PR", + "name": "Role-UpdateRole-PR", "event": [ { "listen": "test", @@ -25720,31 +26145,24 @@ "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(\"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(\"Check previously created data source with id \" + dataSourceId, function () {", - " pm.expect(jsonData.guid).to.eql(dataSourceId);", - "});", - "" + "});" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -25752,22 +26170,31 @@ "value": "{{prUserIdentityId}}" } ], + "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/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Role/{{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "Role", + "{{roleId}}" ] } }, "response": [] }, { - "name": "WizardPage-UpdateWizardPage-PR", + "name": "Role-SetRole-PR", "event": [ { "listen": "test", @@ -25785,8 +26212,7 @@ " pm.response.to.be.forbidden;", " pm.response.to.be.withBody;", " pm.response.to.be.json;", - "});", - "" + "});" ], "type": "text/javascript" } @@ -25798,13 +26224,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{prUserIdentityId}}", - "disabled": true + "value": "{{prUserIdentityId}}" } ], "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 \"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" @@ -25812,14 +26237,26 @@ } }, "url": { - "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "raw": "{{apiUrl}}/api/Role/setRole?createdUserId={{createdUserId}}&roleId={{roleId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "DataSource", - "{{dataSourceId}}" + "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" + } ] } }, @@ -25828,10 +26265,10 @@ ] }, { - "name": "Cleanup PR", + "name": "Search", "item": [ { - "name": "Project-DeleteProject-PR", + "name": "Search-SearchInternal-PR", "event": [ { "listen": "test", @@ -25841,6 +26278,12 @@ "", "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" @@ -25848,7 +26291,7 @@ } ], "request": { - "method": "DELETE", + "method": "GET", "header": [ { "key": "IdentityId", @@ -25857,14 +26300,15 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId}}", + "raw": "{{apiUrl}}/api/Search/internal/{{projectName}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{projectId}}" + "Search", + "internal", + "{{projectName}}" ] } }, @@ -25873,19 +26317,31 @@ ] }, { - "name": "Cleanup Administrator", + "name": "Wizard", + "item": [] + }, + { + "name": "Institution", "item": [ { - "name": "CallToActionOption-DeleteCallToActionOption-Administrator", + "name": "Institution-CreateInstitution-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 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;", "});", "" ], @@ -25894,39 +26350,52 @@ } ], "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" + "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/CallToActionOption/{{callToActionOptionId}}", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption", - "{{callToActionOptionId}}" + "User" ] } }, "response": [] }, { - "name": "Project-DeleteProject-Administrator", + "name": "Institution-GetInstitution-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 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" @@ -25934,39 +26403,44 @@ } ], "request": { - "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "auth": { + "type": "noauth" + }, + "method": "GET", + "header": [], "url": { - "raw": "{{apiUrl}}/api/Project/{{adminProjectId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project", - "{{adminProjectId}}" + "User", + "1" ] } }, "response": [] }, { - "name": "User-DeleteUser-Administrator", + "name": "Institution-UpdateInstitution-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 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" @@ -25974,43 +26448,53 @@ } ], "request": { - "method": "DELETE", - "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/User/{{createdUserId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", "User", - "{{createdUserId}}" + "1" ] } }, "response": [] }, { - "name": "WizardPage-DeleteWizardPage-Administrator", + "name": "Instituiton-DeleteInstitution-PR", "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;", "});" ], "type": "text/javascript" @@ -26019,250 +26503,1764 @@ ], "request": { "method": "DELETE", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{administratorUserIdentityId}}" - } - ], + "header": [], "url": { - "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "raw": "{{apiUrl}}/api/User/1", "host": [ "{{apiUrl}}" ], "path": [ "api", - "WizardPage", - "{{wizardPageId}}" + "User", + "1" ] } }, "response": [] } - ] - } - ] - }, - { - "name": "ConvertRegisteredToAlumni", - "item": [ - { - "name": "Project-CreateProject-Preperation-Alumni", + ], + "auth": { + "type": "noauth" + }, "event": [ { - "listen": "test", + "listen": "prerequest", "script": { + "type": "text/javascript", "exec": [ - "var alumniUserId = pm.environment.get(\"alumniUserId\");", - "var projectName = pm.environment.get(\"projectName\");", - "", - "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId\", jsonData.id);", - "", - "pm.test(\"Status code is 201\", function () {", - " pm.response.to.have.status(201);", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" - } - ], - "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}", - "options": { - "raw": { - "language": "json" - } + "" + ] } }, - "url": { - "raw": "{{apiUrl}}/api/Project", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, - { - "name": "ChangeExpectedGraduationDate-Registered", - "event": [ { "listen": "test", "script": { + "type": "text/javascript", "exec": [ - "var tomorrowDate = pm.environment.get(\"tomorrowDate\");", - "", - "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" + "" + ] } + } + ] + }, + { + "name": "CallToActionOption", + "item": [ + { + "name": "CallToActionOption-CreateCallToActionOption-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;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"type\": \"Title\",\n \"value\": \"Provide feedback\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption" + ] + } + }, + "response": [] }, { - "listen": "prerequest", - "script": { - "exec": [ - "var tomorrow = (Date.now() + 86400000) // today + 1 day\r", - "pm.environment.set(\"tomorrowDate\", new Date(tomorrow).toISOString())\r", - "console.log(pm.environment.get(\"tomorrowDate\"));" + "name": "CallToActionOption-GetAllCallToActionOptions-PR", + "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);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{registeredUserIdentityId}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{userNameUpdated}}\",\r\n \"email\": \"User-CreateUser-Alumni\",\r\n \"identityId\": \"{{registeredUserIdentityId}}\",\r\n \"expectedGraduationDateTime\": \"{{tomorrowDate}}\"\r\n\r\n}", - "options": { - "raw": { - "language": "json" + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption" + ] + } + }, + "response": [] + }, + { + "name": "CallToActionOption-GetCallToActionOptionById-PR", + "event": [ + { + "listen": "test", + "script": { + "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(\"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": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption", + "{{callToActionOptionId}}" + ] + } + }, + "response": [] + }, + { + "name": "CallToActionOption-GetCallToActionOptionByType-PR", + "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(\"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 id is \" + callToActionOptionId, function() {", + " foundAt = findOptionType(jsonData, callToActionOptionId);", + " pm.expect(foundAt).to.not.eql(-1);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption/type/{{callToActionOptionType}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption", + "type", + "{{callToActionOptionType}}" + ] + } + }, + "response": [] + }, + { + "name": "CallToActionOption-UpdateCallToActionOption-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;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "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/CallToActionOption/{{callToActionOptionId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption", + "{{callToActionOptionId}}" + ] + } + }, + "response": [] + }, + { + "name": "CallToActionOption-DeleteCallToActionOption-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;", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/CallToActionOption/{{callToActionOptionId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption", + "{{callToActionOptionId}}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "File", + "item": [ + { + "name": "Post-File-PR", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "\r", + "pm.environment.set(\"prFileId\", 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", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "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-PR", + "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", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{prUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File" + ] + } + }, + "response": [] + }, + { + "name": "Delete-File-PR", + "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": "{{prUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/File/{{prFileId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "File", + "{{prFileId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "WizardPage", + "item": [ + { + "name": "WizardPage-CreateWizardPage-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;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-GetAllWizardPages-PR", + "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" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/WizardPage", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-GetWizardPageById-PR", + "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", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage", + "{{wizardPageId}}" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-UpdateWizardPage-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;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "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}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage", + "{{wizardPageId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "DataSource", + "item": [ + { + "name": "DataSource-GetAllDataSources-PR", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "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" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/DataSource", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "DataSource" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-GetWizardPageById-PR", + "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" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/DataSource/{{dataSourceId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "DataSource", + "{{dataSourceId}}" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-UpdateWizardPage-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;", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}", + "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/DataSource/{{dataSourceId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "DataSource", + "{{dataSourceId}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Cleanup PR", + "item": [ + { + "name": "Project-DeleteProject-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/{{projectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId}}" + ] + } + }, + "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": [] + } + ] + }, + { + "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": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "CallToActionOption", + "{{callToActionOptionId}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject-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/Project/{{adminProjectId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{adminProjectId}}" + ] + } + }, + "response": [] + }, + { + "name": "User-DeleteUser-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/User/{{createdUserId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "User", + "{{createdUserId}}" + ] + } + }, + "response": [] + }, + { + "name": "WizardPage-DeleteWizardPage-Administrator", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "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" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/WizardPage/{{wizardPageId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "WizardPage", + "{{wizardPageId}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "ConvertRegisteredToAlumni", + "item": [ + { + "name": "Project-CreateProject-Preperation-Alumni", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var alumniUserId = pm.environment.get(\"alumniUserId\");", + "var projectName = pm.environment.get(\"projectName\");", + "", + "var jsonData = pm.response.json();", + "pm.environment.set(\"projectId\", jsonData.id);", + "", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "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}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, + { + "name": "ChangeExpectedGraduationDate-Registered", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var tomorrowDate = pm.environment.get(\"tomorrowDate\");", + "", + "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" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var tomorrow = (Date.now() + 86400000) // today + 1 day\r", + "pm.environment.set(\"tomorrowDate\", new Date(tomorrow).toISOString())\r", + "console.log(pm.environment.get(\"tomorrowDate\"));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{registeredUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"name\": \"{{userNameUpdated}}\",\r\n \"email\": \"User-CreateUser-Alumni\",\r\n \"identityId\": \"{{registeredUserIdentityId}}\",\r\n \"expectedGraduationDateTime\": \"{{tomorrowDate}}\"\r\n\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/User/{{registeredUserId}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "User", + "{{registeredUserId}}" + ] + } + }, + "response": [] + }, + { + "name": "CreateGraduationUserTasks", + "request": { + "method": "GET", + "header": [ + { + "key": "IdentityId", + "value": "{{administratorUserIdentityId}}", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/UserTask/CreateUserTasks/6", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "UserTask", + "CreateUserTasks", + "6" + ] + } + }, + "response": [] + }, + { + "name": "Convert-RegisteredAccountToAlumniRole", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();\r", + "pm.environment.set(\"alumniIdentityId\", jsonData.identityId)" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "IdentityId", + "value": "{{registeredUserIdentityId}}", + "type": "text" + }, + { + "key": "email", + "value": "alumniTest@postman.com", + "type": "text" + }, + { + "key": "password", + "value": "test", + "type": "text" + } + ], + "url": { + "raw": "{{apiUrl}}/api/UserTask/", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "UserTask", + "" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Alumni", + "item": [ + { + "name": "Preparation", + "item": [ + { + "name": "User-CreateUser", + "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.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": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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/User", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "User" + ] + } + }, + "response": [] + }, + { + "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(\"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(\"Identity ID is correct and matching: \" + administratorUserId, function () {", + " pm.expect(parseInt(jsonData.user.id)).to.eql(administratorUserId);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "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}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Project", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, + { + "name": "Highlight-CreateHighlight", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "", + "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": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{adminProjectId}},\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Highlight" + ] + } + }, + "response": [] + }, + { + "name": "Embed-CreateEmbed", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", + "", + "pm.environment.set(\"embedGuid\", jsonData.guid);", + "pm.environment.set(\"adminEmbedGuid\", 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" + } } - } - }, - "url": { - "raw": "{{apiUrl}}/api/User/{{registeredUserId}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "User", - "{{registeredUserId}}" - ] - } - }, - "response": [] - }, - { - "name": "CreateGraduationUserTasks", - "request": { - "method": "GET", - "header": [ - { - "key": "IdentityId", - "value": "{{administratorUserIdentityId}}", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/UserTask/CreateUserTasks/6", - "host": [ - "{{apiUrl}}" ], - "path": [ - "api", - "UserTask", - "CreateUserTasks", - "6" - ] - } - }, - "response": [] - }, - { - "name": "Convert-RegisteredAccountToAlumniRole", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json();\r", - "pm.environment.set(\"alumniIdentityId\", jsonData.identityId)" + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{administratorUserIdentityId}}" + } ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PUT", - "header": [ - { - "key": "IdentityId", - "value": "{{registeredUserIdentityId}}", - "type": "text" - }, - { - "key": "email", - "value": "alumniTest@postman.com", - "type": "text" + "body": { + "mode": "raw", + "raw": "{\r\n \"projectId\": {{projectId}}\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{apiUrl}}/api/Embed", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Embed" + ] + } }, - { - "key": "password", - "value": "test", - "type": "text" - } - ], - "url": { - "raw": "{{apiUrl}}/api/UserTask/", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "UserTask", - "" - ] - } - }, - "response": [] - } - ] - }, - { - "name": "Alumni", - "item": [ - { - "name": "Preparation", - "item": [ + "response": [] + }, { - "name": "User-CreateUser", + "name": "CallToActionOption-CreateCallToActionOption", "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(\"callToActionOptionId\", jsonData.id);", "", "pm.test(\"Status code is 201\", function () {", " pm.response.to.have.status(201);", @@ -26275,9 +28273,14 @@ "});", "", "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Check if created Username matches: \" + userName, function () {", - " pm.expect(jsonData.name).to.eql(userName);", - "});" + "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" } @@ -26294,7 +28297,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"9996\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_Registered_User-CreateUser@example.com\"\n}", + "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", "options": { "raw": { "language": "json" @@ -26302,32 +28305,30 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/CallToActionOption", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "CallToActionOption" ] } }, "response": [] }, { - "name": "Project-CreateProject", + "name": "WizardPage-CreateWizardPage-Administrator", "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(\"adminProjectId\", 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);", @@ -26339,17 +28340,86 @@ " 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);", - "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "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": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "User", + "item": [ + { + "name": "User-CreateUser-Alumni", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json();", "", - "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" @@ -26362,12 +28432,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{alumniIdentityId}}" } ], "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": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", "options": { "raw": { "language": "json" @@ -26375,111 +28445,89 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Project", + "raw": "{{apiUrl}}/api/User", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Project" + "User" ] } }, "response": [] }, { - "name": "Highlight-CreateHighlight", + "name": "User-GetUser-Other-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "", "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(\"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": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{alumniIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"projectId\": {{adminProjectId}},\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/User/{{createdUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "User", + "{{createdUserId}}" ] } }, "response": [] }, { - "name": "Embed-CreateEmbed", + "name": "User-GetUser-Self-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var alumniIdentityId = parseInt(pm.environment.get(\"alumniIdentityId\"));", "", - "pm.environment.set(\"embedGuid\", jsonData.guid);", - "pm.environment.set(\"adminEmbedGuid\", jsonData.guid);", - "pm.environment.set(\"embeddedProjectId\", jsonData.project.id);", + "var jsonData = pm.response.json();", + "pm.environment.set(\"alumniUserId\", jsonData.id);", "", - "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(\"Identity ID is correct and matching: \" + alumniIdentityId, function () {", + " pm.expect(parseInt(jsonData.identityId)).to.eql(alumniIdentityId);", "});" ], "type": "text/javascript" @@ -26487,83 +28535,69 @@ } ], "request": { - "method": "POST", + "method": "GET", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{alumniIdentityId}}" } ], - "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-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var updatedAlumniMail = pm.environment.get(\"updatedAlumniMail\");", "", - "pm.environment.set(\"callToActionOptionId\", jsonData.id);", + "var jsonData = pm.response.json();", "", - "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);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "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: \" + updatedAlumniMail, function () {", + " pm.expect(jsonData.email).to.eql(updatedAlumniMail);", + "});" ], "type": "text/javascript" } } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", "type": "text", - "value": "{{administratorUserIdentityId}}" + "value": "{{alumniIdentityId}}" } ], "body": { "mode": "raw", - "raw": "{\r\n \"type\": \"Title\",\r\n \"value\": \"Feedback\"\r\n}", + "raw": "{\r\n \"name\": \"alicez\",\r\n \"email\": \"{{updatedAlumniMail}}\",\r\n \"identityId\": \"{{alumniIdentityId}}\"\r\n}", "options": { "raw": { "language": "json" @@ -26571,20 +28605,21 @@ } }, "url": { - "raw": "{{apiUrl}}/api/CallToActionOption", + "raw": "{{apiUrl}}/api/User/{{alumniUserId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "CallToActionOption" + "User", + "{{alumniUserId}}" ] } }, "response": [] }, { - "name": "WizardPage-CreateWizardPage-Administrator", + "name": "User-UpdateUser-Other-Alumni", "event": [ { "listen": "test", @@ -26592,38 +28627,33 @@ "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);", "});", "", + "eval(pm.environment.get(\"commonTests\"))();", "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": "{{alumniIdentityId}}" } ], "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" @@ -26631,20 +28661,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", @@ -26667,25 +28698,31 @@ ] }, { - "name": "User", + "name": "FollowUser", "item": [ { - "name": "User-CreateUser-Alumni", + "name": "User-FollowUser-Alumni", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json();", + "var userId = pm.environment.get(\"userIdToFollow\");", "", - "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;", + "});", + "", + "eval(pm.environment.get(\"commonTests\"))();", + "pm.test(\"Check if created Username matches: \" + userId, function () {", + " pm.expect(jsonData.id).to.eql(userId);", "});" ], "type": "text/javascript" @@ -26703,7 +28740,7 @@ ], "body": { "mode": "raw", - "raw": "{\n\t\"identityId\": \"{{createdUserId}}\",\n \"name\": \"{{userName}}\",\n \"email\": \"postmantest_email@example.com\"\n}", + "raw": "", "options": { "raw": { "language": "json" @@ -26711,35 +28748,29 @@ } }, "url": { - "raw": "{{apiUrl}}/api/User", + "raw": "{{apiUrl}}/api/User/follow/{{userIdToFollow}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User" + "User", + "follow", + "{{userIdToFollow}}" ] } }, "response": [] }, { - "name": "User-GetUser-Other-Alumni", + "name": "User-UnFollowUser-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", - "", - "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" @@ -26747,7 +28778,7 @@ } ], "request": { - "method": "GET", + "method": "DELETE", "header": [ { "key": "IdentityId", @@ -26755,53 +28786,84 @@ "value": "{{alumniIdentityId}}" } ], + "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-Alumni", + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "Category", + "item": [ + { + "name": "Category-CreateCategory-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var alumniIdentityId = parseInt(pm.environment.get(\"alumniIdentityId\"));", - "", "var jsonData = pm.response.json();", - "pm.environment.set(\"alumniUserId\", jsonData.id);", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "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.withBody;", - " pm.response.to.be.json;", + " pm.response.to.be.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "eval(pm.environment.get(\"commonTests\"))();", - "pm.test(\"Identity ID is correct and matching: \" + alumniIdentityId, function () {", - " pm.expect(parseInt(jsonData.identityId)).to.eql(alumniIdentityId);", - "});" + "" ], "type": "text/javascript" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -26809,43 +28871,69 @@ "value": "{{alumniIdentityId}}" } ], + "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-Alumni", + "name": "Category-GetAllCategories-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var updatedAlumniMail = pm.environment.get(\"updatedAlumniMail\");", + "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);", "});", "", - "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.response.to.be.ok;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});", "", - "pm.test(\"Check if email update matches: \" + updatedAlumniMail, function () {", - " pm.expect(jsonData.email).to.eql(updatedAlumniMail);", + "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" @@ -26853,7 +28941,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -26861,47 +28949,44 @@ "value": "{{alumniIdentityId}}" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"alicez\",\r\n \"email\": \"{{updatedAlumniMail}}\",\r\n \"identityId\": \"{{alumniIdentityId}}\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{apiUrl}}/api/User/{{alumniUserId}}", + "raw": "{{apiUrl}}/api/Category", "host": [ "{{apiUrl}}" ], "path": [ "api", - "User", - "{{alumniUserId}}" + "Category" ] } }, "response": [] }, { - "name": "User-UpdateUser-Other-Alumni", + "name": "Category-GetCategory-Alumni", "event": [ { "listen": "test", "script": { "exec": [ + "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "", "var jsonData = pm.response.json();", "", - "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.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" @@ -26909,7 +28994,7 @@ } ], "request": { - "method": "PUT", + "method": "GET", "header": [ { "key": "IdentityId", @@ -26917,78 +29002,37 @@ "value": "{{alumniIdentityId}}" } ], - "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-Alumni", + "name": "Category-UpdateCategory-Alumni", "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;", - "});", - "", - "eval(pm.environment.get(\"commonTests\"))();", - "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" @@ -26996,7 +29040,7 @@ } ], "request": { - "method": "POST", + "method": "PUT", "header": [ { "key": "IdentityId", @@ -27006,7 +29050,7 @@ ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"{{categoryNameUpdated}}\"\r\n}", "options": { "raw": { "language": "json" @@ -27014,29 +29058,38 @@ } }, "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-Alumni", + "name": "Category-DeleteCategory-Alumni", "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.forbidden;", + " pm.response.to.be.withBody;", + " pm.response.to.be.json;", "});" ], "type": "text/javascript" @@ -27052,25 +29105,15 @@ "value": "{{alumniIdentityId}}" } ], - "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}}" ] } }, @@ -27099,30 +29142,23 @@ ] }, { - "name": "Category", + "name": "Project", "item": [ { - "name": "Category-CreateCategory-Alumni", + "name": "Project-CreateProject-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var jsonData = pm.response.json();", + "var alumniUserId = pm.environment.get(\"alumniUserId\");", + "var projectName = pm.environment.get(\"projectName\");", "", - "eval(pm.environment.get(\"commonTests\"))();", + "var jsonData = pm.response.json();", "", "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" } @@ -27139,7 +29175,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{categoryName}}\"\r\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" @@ -27147,120 +29183,140 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project" ] } }, "response": [] }, { - "name": "Category-GetAllCategories-Alumni", + "name": "Project-CreateProject-OneCallToAction-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryName\");", - "", - "var jsonData = pm.response.json();", + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "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: \" + registeredUserId, function () {", + " pm.expect(jsonData.user.id).to.eql(registeredUserId);", "});", "", - "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", "type": "text", "value": "{{alumniIdentityId}}" } - ], + ], + "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}", + "options": { + "raw": { + "language": "json" + } + } + }, "url": { - "raw": "{{apiUrl}}/api/Category", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category" + "Project" ] } }, "response": [] }, { - "name": "Category-GetCategory-Alumni", + "name": "Project-CreateProject-MultipleCallToActions-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var categoryName = pm.environment.get(\"categoryNameInitial\");", + "var registeredUserId = pm.environment.get(\"registeredUserId\");", + "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: \" + 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" } } ], "request": { - "method": "GET", + "method": "POST", "header": [ { "key": "IdentityId", @@ -27268,45 +29324,65 @@ "value": "{{alumniIdentityId}}" } ], + "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}", + "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-Alumni", + "name": "Project-CreateProject-CallToActionValueInvalid-Alumni", "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 == \"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", @@ -27316,7 +29392,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}", "options": { "raw": { "language": "json" @@ -27324,46 +29400,55 @@ } }, "url": { - "raw": "{{apiUrl}}/api/Category/{{categoryIdToBeCategorized}}", + "raw": "{{apiUrl}}/api/Project", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Category", - "{{categoryIdToBeCategorized}}" + "Project" ] } }, "response": [] }, { - "name": "Category-DeleteCategory-Alumni", + "name": "Project-CreateProject-CallToActionLimitExceeded-Alumni", "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" } } ], "request": { - "method": "DELETE", + "method": "POST", "header": [ { "key": "IdentityId", @@ -27371,60 +29456,57 @@ "value": "{{alumniIdentityId}}" } ], + "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}", + "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-Alumni", + "name": "Project-CreateProject-CallToActionSameAction-Alumni", "event": [ { "listen": "test", "script": { "exec": [ - "var alumniUserId = pm.environment.get(\"alumniUserId\");", "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 == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" ], "type": "text/javascript" } @@ -27436,12 +29518,12 @@ { "key": "IdentityId", "type": "text", - "value": "{{alumniIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "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 \"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" @@ -28586,7 +30668,7 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].project.id == item) {", + " if (jsonData[i].projectId == item) {", " return i;", " }", " }", @@ -30509,6 +32591,88 @@ }, "response": [] }, + { + "name": "Project-DeleteProject2-Self-Alumni", + "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": "{{alumniIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId2}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId2}}" + ] + } + }, + "response": [] + }, + { + "name": "Project-DeleteProject3-Self-Alumni", + "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": "{{alumniIdentityId}}" + } + ], + "url": { + "raw": "{{apiUrl}}/api/Project/{{projectId3}}", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project", + "{{projectId3}}" + ] + } + }, + "response": [] + }, { "name": "Project-DeleteProject-Other-Alumni", "event": [ diff --git a/Postman/local.postman_environment.json b/Postman/local.postman_environment.json index fb773060..f6b472b6 100644 --- a/Postman/local.postman_environment.json +++ b/Postman/local.postman_environment.json @@ -1,5 +1,5 @@ { - "id": "6f9e8536-54dd-44ad-b5cd-6f44d7c2ce88", + "id": "1ca24dd4-db0f-4583-b3e3-08526ad2b464", "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,25 @@ { "key": "categoryIdToBeCategorized", "value": "", - "enabled": true + "enabled": true }, - { + { "key": "updatedDataSourceName", "value": "Updated name", "enabled": true + }, + { + "key": "projectId2", + "value": "", + "enabled": true + }, + { + "key": "projectId3", + "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-05-28T12:22:07.880Z", + "_postman_exported_using": "Postman/8.5.1-210526-1350" +} \ No newline at end of file diff --git a/Repositories/ProjectRepository.cs b/Repositories/ProjectRepository.cs index 6735ffc4..b1e3a6eb 100644 --- a/Repositories/ProjectRepository.cs +++ b/Repositories/ProjectRepository.cs @@ -158,7 +158,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) .SingleOrDefaultAsync(); if(project != null) @@ -198,7 +198,7 @@ public virtual async Task> GetAllWithUsersCollaboratorsAndInstitut IQueryable queryableProjects = GetDbSet() .Include(u => u.User) .Include(p => p.ProjectIcon) - .Include(p => p.CallToAction) + .Include(p => p.CallToActions) .Include(p => p.Collaborators) .Include(p => p.Likes) .Include(p => p.LinkedInstitutions) @@ -212,7 +212,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, @@ -299,7 +299,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) .Where(p => p.Id == id) .FirstOrDefaultAsync(); if(project != null) @@ -610,7 +610,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(); From 36dfb36aef8c3af77a7b678f0183d1af269bf58e Mon Sep 17 00:00:00 2001 From: "Triest,Tristan T.R. van" Date: Fri, 28 May 2021 14:46:09 +0200 Subject: [PATCH 2/7] Fixed postman tests for alumni-user. --- Postman/dex.postman_collection.json | 134 +++---------------------- Postman/local.postman_environment.json | 2 +- 2 files changed, 14 insertions(+), 122 deletions(-) diff --git a/Postman/dex.postman_collection.json b/Postman/dex.postman_collection.json index 137d2cdc..3a380096 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -29211,21 +29211,11 @@ "", "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(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", - "pm.test(\"Call to action is not null\", function() {", - " pm.expect(jsonData.callToActions.length == 1);", - "})" + "" ], "type": "text/javascript" } @@ -29286,21 +29276,9 @@ "", "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(\"Call to action is not null\", function() {", - " pm.expect(jsonData.callToActions.length == 2);", - "})" + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", + "});" ], "type": "text/javascript" } @@ -29361,9 +29339,8 @@ "", "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(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "" @@ -29427,11 +29404,9 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", - "", "" ], "type": "text/javascript" @@ -29492,9 +29467,8 @@ "", "eval(pm.environment.get(\"commonTests\"))();", "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", + "pm.test(\"Status code is 403\", function () {", + " pm.response.to.have.status(403);", "});", "", "" @@ -29518,7 +29492,7 @@ { "key": "IdentityId", "type": "text", - "value": "{{registeredUserIdentityId}}" + "value": "{{alumniIdentityId}}" } ], "body": { @@ -32591,88 +32565,6 @@ }, "response": [] }, - { - "name": "Project-DeleteProject2-Self-Alumni", - "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": "{{alumniIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId2}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "{{projectId2}}" - ] - } - }, - "response": [] - }, - { - "name": "Project-DeleteProject3-Self-Alumni", - "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": "{{alumniIdentityId}}" - } - ], - "url": { - "raw": "{{apiUrl}}/api/Project/{{projectId3}}", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project", - "{{projectId3}}" - ] - } - }, - "response": [] - }, { "name": "Project-DeleteProject-Other-Alumni", "event": [ diff --git a/Postman/local.postman_environment.json b/Postman/local.postman_environment.json index f6b472b6..da47e8e9 100644 --- a/Postman/local.postman_environment.json +++ b/Postman/local.postman_environment.json @@ -444,6 +444,6 @@ } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2021-05-28T12:22:07.880Z", + "_postman_exported_at": "2021-05-28T12:45:12.881Z", "_postman_exported_using": "Postman/8.5.1-210526-1350" } \ No newline at end of file From 1f635d08474f4670ab77f5ab0e06d174384c37a6 Mon Sep 17 00:00:00 2001 From: Arilith Date: Fri, 4 Jun 2021 12:39:17 +0200 Subject: [PATCH 3/7] Added check for multiple of the same call to action values. Added postman tests for this. --- API/Controllers/ProjectController.cs | 104 ++++---- API/Resources/ProjectResource.cs | 5 + Postman/dex.postman_collection.json | 324 +++++++++++++++++++++++++ Postman/local.postman_environment.json | 4 +- 4 files changed, 389 insertions(+), 48 deletions(-) diff --git a/API/Controllers/ProjectController.cs b/API/Controllers/ProjectController.cs index 6467db72..0e91172a 100644 --- a/API/Controllers/ProjectController.cs +++ b/API/Controllers/ProjectController.cs @@ -332,31 +332,36 @@ public async Task CreateProjectAsync([FromBody] ProjectResource p if(projectResource.CallToActions != null) { - if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue) - .Any(cta => cta.Count() > 1)) + if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue).Any(cta => cta.Count() > 1)) { ProblemDetails problem = new ProblemDetails - { - Title = "Duplicate call to action value.", - Detail = - "It is not possible to create a project with multiple of the same call to actions.", - Instance = "D2C8416A-9C55-408B-9468-F0E5C635F9B7" - }; + { + 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); } - //This should be refactored. As for much of the code in the controllers, see issue #411 - Refactor controllers. - int maxAmountOfCallToActions = 4; + if(projectResource.CallToActions.GroupBy(cta => cta.Value).Any(cta => cta.Count() > 1)) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Duplicate call to action value.", + Detail = "It is not possible to create a project with multiple call to actions with the same values.", + Instance = "965D9C50-064F-4AFD-8CEB-28E556E47906" + }; + return BadRequest(problem); + } - if(projectResource.CallToActions.Count > maxAmountOfCallToActions) + if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) { ProblemDetails problem = new ProblemDetails - { - Title = $"Maximum amount of {maxAmountOfCallToActions} call to actions exceeded.", - Detail = - $"It is not possible to create a project with more than {maxAmountOfCallToActions} call to actions.", - Instance = "E780005D-BBEB-423E-BA01-58145D3DBDF5" - }; + { + 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) @@ -367,12 +372,11 @@ await callToActionOptionService.GetCallToActionOptionFromValueAsync( 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" - }; + { + 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); } } @@ -514,31 +518,38 @@ public async Task UpdateProject(int projectId, [FromBody] Project if(projectResource.CallToActions != null) { - if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue) - .Any(cta => cta.Count() > 1)) + if(projectResource.CallToActions.GroupBy(cta => cta.OptionValue).Any(cta => cta.Count() > 1)) { ProblemDetails problem = new ProblemDetails - { - Title = "Duplicate call to action value.", - Detail = - "It is not possible to create a project with multiple of the same call to actions.", - Instance = "D2C8416A-9C55-408B-9468-F0E5C635F9B7" - }; + { + 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); } - //This should be refactored. As for much of the code in the controllers, see issue #411 - Refactor controllers. - int maxAmountOfCallToActions = 4; + if(projectResource.CallToActions.GroupBy(cta => cta.Value).Any(cta => cta.Count() > 1)) + { + ProblemDetails problem = new ProblemDetails + { + Title = "Duplicate call to action value.", + Detail = "It is not possible to create a project with multiple call to actions with the same values.", + Instance = "965D9C50-064F-4AFD-8CEB-28E556E47906" + }; + return BadRequest(problem); + } - if(projectResource.CallToActions.Count > maxAmountOfCallToActions) + if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) { ProblemDetails problem = new ProblemDetails - { - Title = "Maximum amount of call to actions exceeded.", - Detail = - $"It is not possible to create a project with more than {maxAmountOfCallToActions} call to actions.", - Instance = "E780005D-BBEB-423E-BA01-58145D3DBDF5" - }; + { + 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); } @@ -547,15 +558,16 @@ public async Task UpdateProject(int projectId, [FromBody] Project 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" - }; + { + 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); } } diff --git a/API/Resources/ProjectResource.cs b/API/Resources/ProjectResource.cs index 5d0eca45..f6d6e7a3 100644 --- a/API/Resources/ProjectResource.cs +++ b/API/Resources/ProjectResource.cs @@ -61,6 +61,11 @@ public class ProjectResource /// 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/Postman/dex.postman_collection.json b/Postman/dex.postman_collection.json index 3a380096..ce788554 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -2249,6 +2249,71 @@ }, "response": [] }, + { + "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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\": \"Apply now\",\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, { "name": "Project-GetAllProjects-Administrator", "event": [ @@ -12102,6 +12167,71 @@ }, "response": [] }, + { + "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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\": \"Apply Now\",\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, { "name": "Project-GetAllProjects-Registered", "event": [ @@ -18542,6 +18672,71 @@ }, "response": [] }, + { + "name": "Project-CreateProject-CallToActionSameActionValue-Data Office", + "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 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "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\": \"Apply now\",\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, { "name": "Project-GetAllProjects-DataOfficer", "event": [ @@ -23927,6 +24122,71 @@ }, "response": [] }, + { + "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", + " pm.response.to.have.status(400);", + " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{prUserIdentityId}}" + } + ], + "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\": \"Apply now\",\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, { "name": "Project-GetAllProjects-PR", "event": [ @@ -29517,6 +29777,70 @@ }, "response": [] }, + { + "name": "Project-CreateProject-CallToActionSameActionValue-Alumni", + "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);", + "});", + "", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "IdentityId", + "type": "text", + "value": "{{alumniIdentityId}}" + } + ], + "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\": \"Apply now\",\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", + "host": [ + "{{apiUrl}}" + ], + "path": [ + "api", + "Project" + ] + } + }, + "response": [] + }, { "name": "Project-GetAllProjects-Alumni", "event": [ diff --git a/Postman/local.postman_environment.json b/Postman/local.postman_environment.json index da47e8e9..f74362f9 100644 --- a/Postman/local.postman_environment.json +++ b/Postman/local.postman_environment.json @@ -444,6 +444,6 @@ } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2021-05-28T12:45:12.881Z", - "_postman_exported_using": "Postman/8.5.1-210526-1350" + "_postman_exported_at": "2021-06-04T10:38:39.818Z", + "_postman_exported_using": "Postman/8.5.1" } \ No newline at end of file From aeb336393c558394e664bedde19f1e15707ee5b0 Mon Sep 17 00:00:00 2001 From: Niray Mak <44868678+niraymak@users.noreply.github.com> Date: Wed, 9 Jun 2021 10:58:47 +0200 Subject: [PATCH 4/7] updated Postman collection after merge --- Postman/dex.postman_collection.json | 437 ++++------------------------ 1 file changed, 56 insertions(+), 381 deletions(-) diff --git a/Postman/dex.postman_collection.json b/Postman/dex.postman_collection.json index 88226871..90d7cbc8 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "24ed191e-3261-40e3-8d9a-c6ac94c55667", + "_postman_id": "6c937908-e95d-4a26-9338-e0d29d333c82", "name": "DEV", "description": "Testing Digital Excellence API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -681,7 +681,7 @@ ], "body": { "mode": "raw", - "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_ProjectToTag\",\r\n \"shortDescription\": \"postmantest_ProjectToTag\",\r\n \"uri\": \"postmantest_ProjectToTag\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectToTag\",\r\n \"role\": \"postmantest_ProjectToTag\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"categories\": [\r\n {\r\n \"Id\": {{categoryIdToBeCategorized}}\r\n }\r\n ]\r\n}", + "raw": "{\r\n \"name\": \"{{projectName}}\",\r\n \"description\": \"postmantest_ProjectToTag\",\r\n \"shortDescription\": \"postmantest_ProjectToTag\",\r\n \"uri\": \"postmantest_ProjectToTag\",\r\n \"collaborators\": [\r\n {\r\n \"fullName\": \"postmantest_ProjectToTag\",\r\n \"role\": \"postmantest_ProjectToTag\"\r\n }\r\n ],\r\n \"created\": \"2020-04-20T08:24:26.693Z\",\r\n \"updated\": \"2020-04-20T08:24:26.693Z\",\r\n \"categories\": [\r\n {\r\n \"id\": {{categoryIdToBeCategorized}}\r\n }\r\n ]\r\n}", "options": { "raw": { "language": "json" @@ -2249,71 +2249,6 @@ }, "response": [] }, - { - "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "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\": \"Apply now\",\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", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, { "name": "Project-GetAllProjects-Administrator", "event": [ @@ -3263,38 +3198,19 @@ "response": [] }, { - "name": "Highlight-GetAllActiveHighlights-Administrator", + "name": "Highlight-GetHighlight-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var adminProjectId = pm.environment.get(\"adminProjectId\");", + "var identityId = parseInt(pm.environment.get(\"identityId\"));", + "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", "", "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].projectId == idToFind) ", - " { ", - " return i; ", - " }", - " }", - " return -1;", - " ", - "}", + "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", + "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -3308,9 +3224,8 @@ " 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);", + "pm.test(\"Highlight Id matches: \" + highlightId, function () {", + " pm.expect(jsonData.id).to.eql(highlightId);", "});" ], "type": "text/javascript" @@ -3327,32 +3242,52 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight", + "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight" + "Highlight", + "{{highlightId}}" ] } }, "response": [] }, { - "name": "Highlight-GetHighlight-Administrator", + "name": "Highlight-GetAllActiveHighlights-Administrator", "event": [ { "listen": "test", "script": { "exec": [ - "var identityId = parseInt(pm.environment.get(\"identityId\"));", - "var highlightId = parseInt(pm.environment.get(\"highlightId\"));", + "var adminProjectId = pm.environment.get(\"adminProjectId\");", "", "var jsonData = pm.response.json();", "", - "pm.environment.set(\"highlightStartDate\", jsonData.startDate);", - "pm.environment.set(\"highlightEndDate\", jsonData.endDate);", + "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\"))();", "", @@ -3366,8 +3301,9 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Highlight Id matches: \" + highlightId, function () {", - " pm.expect(jsonData.id).to.eql(highlightId);", + "pm.test(\"Highlight is in list and matching: \" + adminProjectId, function () {", + " foundAt = findHighlight(jsonData, adminProjectId);", + " pm.expect(foundAt).to.not.eql(-1);", "});" ], "type": "text/javascript" @@ -3384,14 +3320,13 @@ } ], "url": { - "raw": "{{apiUrl}}/api/Highlight/{{highlightId}}", + "raw": "{{apiUrl}}/api/Highlight", "host": [ "{{apiUrl}}" ], "path": [ "api", - "Highlight", - "{{highlightId}}" + "Highlight" ] } }, @@ -3423,7 +3358,7 @@ "", "function findProjectId(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -12167,71 +12102,6 @@ }, "response": [] }, - { - "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "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\": \"Apply Now\",\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", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, { "name": "Project-GetAllProjects-Registered", "event": [ @@ -13021,8 +12891,8 @@ " pm.response.to.be.json;", "});", "", - "pm.test(\"Project count matches: 4\", function () {", - " pm.expect(jsonData.length).to.eql(4);", + "pm.test(\"Project count matches: 6\", function () {", + " pm.expect(jsonData.length).to.eql(6);", "});" ], "type": "text/javascript" @@ -13859,7 +13729,7 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -18672,71 +18542,6 @@ }, "response": [] }, - { - "name": "Project-CreateProject-CallToActionSameActionValue-Data Office", - "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 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "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\": \"Apply now\",\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", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, { "name": "Project-GetAllProjects-DataOfficer", "event": [ @@ -20148,7 +19953,7 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -24122,71 +23927,6 @@ }, "response": [] }, - { - "name": "Project-CreateProject-CallToActionSameActionValue-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 400\", function () {", - " pm.response.to.have.status(400);", - " pm.response.instance == \"965D9C50-064F-4AFD-8CEB-28E556E47906\";", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{prUserIdentityId}}" - } - ], - "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\": \"Apply now\",\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", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, { "name": "Project-GetAllProjects-PR", "event": [ @@ -25648,7 +25388,7 @@ "", "function findProjectId(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -25927,7 +25667,7 @@ "", "function findProjectId(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -26066,7 +25806,7 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", @@ -29465,17 +29205,13 @@ "var registeredUserId = pm.environment.get(\"registeredUserId\");", "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 403\", function () {", " pm.response.to.have.status(403);", - "});", - "", - "" + "});" ], "type": "text/javascript" } @@ -29532,7 +29268,6 @@ "var projectName = pm.environment.get(\"projectName\");", "", "var jsonData = pm.response.json();", - "pm.environment.set(\"projectId3\", jsonData.id);", "", "eval(pm.environment.get(\"commonTests\"))();", "", @@ -29601,6 +29336,7 @@ "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", + " pm.response.instance == \"40EE82EB-930F-40C8-AE94-0041F7573FE9\";", "});", "", "" @@ -29666,7 +29402,9 @@ "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", + " pm.response.instance == \"E780005D-BBEB-423E-BA01-58145D3DBDF5\";", "});", + "", "" ], "type": "text/javascript" @@ -29729,6 +29467,7 @@ "", "pm.test(\"Status code is 403\", function () {", " pm.response.to.have.status(403);", + " pm.response.instance == \"D2C8416A-9C55-408B-9468-F0E5C635F9B7\";", "});", "", "" @@ -29752,7 +29491,7 @@ { "key": "IdentityId", "type": "text", - "value": "{{alumniIdentityId}}" + "value": "{{registeredUserIdentityId}}" } ], "body": { @@ -29777,70 +29516,6 @@ }, "response": [] }, - { - "name": "Project-CreateProject-CallToActionSameActionValue-Alumni", - "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);", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "IdentityId", - "type": "text", - "value": "{{alumniIdentityId}}" - } - ], - "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\": \"Apply now\",\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", - "host": [ - "{{apiUrl}}" - ], - "path": [ - "api", - "Project" - ] - } - }, - "response": [] - }, { "name": "Project-GetAllProjects-Alumni", "event": [ @@ -30966,7 +30641,7 @@ "", "function findItem(jsonData, item) {", " for (var i = 0; i < jsonData.length; i++) {", - " if (jsonData[i].projectId == item) {", + " if (jsonData[i].project.id == item) {", " return i;", " }", " }", From f00da66a52708a32626300fd848081e33dfb08b2 Mon Sep 17 00:00:00 2001 From: Tristan Date: Fri, 18 Jun 2021 11:18:52 +0200 Subject: [PATCH 5/7] Removed Test Itemgroup --- Data/06_Data.csproj | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Data/06_Data.csproj b/Data/06_Data.csproj index 0bd5d869..b87ed4e6 100644 --- a/Data/06_Data.csproj +++ b/Data/06_Data.csproj @@ -11,11 +11,6 @@ - - - - - From 783e02a5d67cb3cf1d3ec0427da94792b7cc2621 Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 21 Jun 2021 12:13:10 +0200 Subject: [PATCH 6/7] Disabled double call to action value checks. --- API/Controllers/ProjectController.cs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/API/Controllers/ProjectController.cs b/API/Controllers/ProjectController.cs index 0e91172a..6bdca865 100644 --- a/API/Controllers/ProjectController.cs +++ b/API/Controllers/ProjectController.cs @@ -343,17 +343,6 @@ public async Task CreateProjectAsync([FromBody] ProjectResource p return BadRequest(problem); } - if(projectResource.CallToActions.GroupBy(cta => cta.Value).Any(cta => cta.Count() > 1)) - { - ProblemDetails problem = new ProblemDetails - { - Title = "Duplicate call to action value.", - Detail = "It is not possible to create a project with multiple call to actions with the same values.", - Instance = "965D9C50-064F-4AFD-8CEB-28E556E47906" - }; - return BadRequest(problem); - } - if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) { ProblemDetails problem = new ProblemDetails @@ -523,24 +512,12 @@ public async Task UpdateProject(int projectId, [FromBody] Project 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.", + 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.GroupBy(cta => cta.Value).Any(cta => cta.Count() > 1)) - { - ProblemDetails problem = new ProblemDetails - { - Title = "Duplicate call to action value.", - Detail = "It is not possible to create a project with multiple call to actions with the same values.", - Instance = "965D9C50-064F-4AFD-8CEB-28E556E47906" - }; - return BadRequest(problem); - } - if(projectResource.CallToActions.Count > projectResource.MaximumCallToActions) { ProblemDetails problem = new ProblemDetails From c65ec493b320ef97fcaf65a0d2d2ebc2be8e61f7 Mon Sep 17 00:00:00 2001 From: Tristan Date: Mon, 21 Jun 2021 12:23:21 +0200 Subject: [PATCH 7/7] Changed postman tests to not check for duplicate values anymore. --- Postman/dex.postman_collection.json | 2 +- Postman/local.postman_environment.json | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Postman/dex.postman_collection.json b/Postman/dex.postman_collection.json index 90d7cbc8..546aa932 100644 --- a/Postman/dex.postman_collection.json +++ b/Postman/dex.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "6c937908-e95d-4a26-9338-e0d29d333c82", + "_postman_id": "5f0b70e0-590e-4bf4-9ea9-c4bff5012bb7", "name": "DEV", "description": "Testing Digital Excellence API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" diff --git a/Postman/local.postman_environment.json b/Postman/local.postman_environment.json index f74362f9..22ac3cb8 100644 --- a/Postman/local.postman_environment.json +++ b/Postman/local.postman_environment.json @@ -1,5 +1,5 @@ { - "id": "1ca24dd4-db0f-4583-b3e3-08526ad2b464", + "id": "27c0ab04-e996-4d7f-9ef2-db0b0067c9ef", "name": "Local", "values": [ { @@ -441,9 +441,14 @@ "key": "projectId3", "value": "", "enabled": true + }, + { + "key": "administratorUserId", + "value": "", + "enabled": true } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2021-06-04T10:38:39.818Z", - "_postman_exported_using": "Postman/8.5.1" + "_postman_exported_at": "2021-06-21T10:20:35.533Z", + "_postman_exported_using": "Postman/8.6.2" } \ No newline at end of file