Пример #1
0
        protected internal virtual TenantQuery setUpMockQuery(Tenant tenant)
        {
            TenantQuery query = mock(typeof(TenantQuery));

            when(query.tenantId(anyString())).thenReturn(query);
            when(query.singleResult()).thenReturn(tenant);

            when(identityServiceMock.createTenantQuery()).thenReturn(query);

            return(query);
        }
Пример #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void getNonExistingTenant()
        public virtual void getNonExistingTenant()
        {
            when(mockQuery.singleResult()).thenReturn(null);

            given().pathParam("id", "aNonExistingTenant").then().expect().statusCode(Status.NOT_FOUND.StatusCode).contentType(ContentType.JSON).body("type", equalTo(typeof(InvalidRequestException).Name)).body("message", equalTo("Tenant with id aNonExistingTenant does not exist")).when().get(TENANT_URL);
        }