Search in sources :

Example 66 with PageEntity

use of io.gravitee.rest.api.model.PageEntity in project gravitee-management-rest-api by gravitee-io.

the class ApiQualityMetricFunctionalDocumentationTest method shouldBeValidWithMarkdownPublished.

@Test
public void shouldBeValidWithMarkdownPublished() {
    PageEntity item = mock(PageEntity.class);
    when(mockPageService.search(any(), eq(GraviteeContext.getCurrentEnvironment()))).thenReturn(Collections.singletonList(item));
    ApiEntity api = mock(ApiEntity.class);
    when(api.getId()).thenReturn(API_ID);
    boolean valid = srv.isValid(api);
    assertTrue(valid);
}
Also used : PageEntity(io.gravitee.rest.api.model.PageEntity) ApiEntity(io.gravitee.rest.api.model.api.ApiEntity) Test(org.junit.Test)

Example 67 with PageEntity

use of io.gravitee.rest.api.model.PageEntity in project gravitee-management-rest-api by gravitee-io.

the class ApiQualityMetricTechnicalDocumentationTest method shouldBeValidWithSwaggerPublished.

@Test
public void shouldBeValidWithSwaggerPublished() {
    PageEntity item = mock(PageEntity.class);
    when(mockPageService.search(any(), eq(GraviteeContext.getCurrentEnvironment()))).thenReturn(Collections.singletonList(item));
    ApiEntity api = mock(ApiEntity.class);
    when(api.getId()).thenReturn(API_ID);
    boolean valid = srv.isValid(api);
    assertTrue(valid);
}
Also used : PageEntity(io.gravitee.rest.api.model.PageEntity) ApiEntity(io.gravitee.rest.api.model.api.ApiEntity) Test(org.junit.Test)

Aggregations

PageEntity (io.gravitee.rest.api.model.PageEntity)67 Test (org.junit.Test)48 ApiEntity (io.gravitee.rest.api.model.api.ApiEntity)15 OAIDescriptor (io.gravitee.rest.api.service.swagger.OAIDescriptor)15 Page (io.gravitee.rest.api.portal.rest.model.Page)13 Response (javax.ws.rs.core.Response)13 UpdatePageEntity (io.gravitee.rest.api.model.UpdatePageEntity)9 PageConfigurationOAITransformer (io.gravitee.rest.api.service.impl.swagger.transformer.page.PageConfigurationOAITransformer)8 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 Permissions (io.gravitee.rest.api.management.rest.security.Permissions)6 EntrypointsOAITransformer (io.gravitee.rest.api.service.impl.swagger.transformer.entrypoints.EntrypointsOAITransformer)6 SwaggerDescriptor (io.gravitee.rest.api.service.swagger.SwaggerDescriptor)5 Before (org.junit.Before)5 Page (io.gravitee.repository.management.model.Page)4 NewPageEntity (io.gravitee.rest.api.model.NewPageEntity)4 PageNotFoundException (io.gravitee.rest.api.service.exceptions.PageNotFoundException)4 ArgumentMatchers (org.mockito.ArgumentMatchers)4 TechnicalException (io.gravitee.repository.exceptions.TechnicalException)3 PageRepository (io.gravitee.repository.management.api.PageRepository)3 PageReferenceType (io.gravitee.repository.management.model.PageReferenceType)3