public async Task PostPartyLookup_ExpiredToken_ReturnsUnAuthorized()
        {
            string token = PrincipalUtil.GetExpiredToken();

            // Arrange
            string OrgNo = "555000103";

            Mock <IParties> partiesService = new Mock <IParties>();

            HttpClient client = GetTestClient(partiesService.Object);

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            PartyLookup lookUp = new PartyLookup {
                OrgNo = OrgNo
            };

            StringContent requestBody = new StringContent(JsonSerializer.Serialize(lookUp), Encoding.UTF8, "application/json");

            // Act
            HttpResponseMessage response = await client.PostAsync("/register/api/v1/parties/lookup", requestBody);

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async Task GetParty_ExpiredToken_ReturnsUnAuthorized()
        {
            string token   = PrincipalUtil.GetExpiredToken();
            int    partyId = 6565;

            // Arrange
            Mock <IParties> partiesService = new Mock <IParties>();

            HttpClient client = GetTestClient(partiesService.Object);

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            // Act
            HttpResponseMessage response = await client.GetAsync("/register/api/v1/parties/" + partyId);

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }
        public async Task GetOrganization_ExpiredToken_ReturnsUnauthorized()
        {
            string token = PrincipalUtil.GetExpiredToken();
            string orgNo = "836281763";

            // Arrange
            Mock <IOrganizations> organizationsService = new Mock <IOrganizations>();

            HttpClient client = GetTestClient(organizationsService.Object);

            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

            HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Get, "/register/api/v1/organizations/" + orgNo);

            httpRequestMessage.Headers.Add("PlatformAccessToken", PrincipalUtil.GetAccessToken("ttd", "unittest"));

            // Act
            HttpResponseMessage response = await client.SendAsync(httpRequestMessage);

            // Assert
            Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
        }