Search in sources :

Example 6 with ErrorData

use of io.crnk.core.engine.document.ErrorData in project crnk-framework by crnk-project.

the class ErrorDataBuilderTest method shouldSetDetail.

@Test
public void shouldSetDetail() throws Exception {
    ErrorData error = ErrorData.builder().setDetail(ErrorDataMother.DETAIL).build();
    assertThat(error.getDetail()).isEqualTo(ErrorDataMother.DETAIL);
}
Also used : ErrorData(io.crnk.core.engine.document.ErrorData) Test(org.junit.Test)

Example 7 with ErrorData

use of io.crnk.core.engine.document.ErrorData in project crnk-framework by crnk-project.

the class ErrorDataBuilderTest method shouldSetId.

@Test
public void shouldSetId() throws Exception {
    ErrorData error = ErrorData.builder().setId(ErrorDataMother.ID).build();
    assertThat(error.getId()).isEqualTo(ErrorDataMother.ID);
}
Also used : ErrorData(io.crnk.core.engine.document.ErrorData) Test(org.junit.Test)

Example 8 with ErrorData

use of io.crnk.core.engine.document.ErrorData in project crnk-framework by crnk-project.

the class ErrorDataBuilderTest method shouldSetPaths.

@Test
public void shouldSetPaths() throws Exception {
    ErrorData error = ErrorData.builder().setSourceParameter(ErrorDataMother.PARAMETER).build();
    assertThat(error.getSourceParameter()).isEqualTo(ErrorDataMother.PARAMETER);
}
Also used : ErrorData(io.crnk.core.engine.document.ErrorData) Test(org.junit.Test)

Example 9 with ErrorData

use of io.crnk.core.engine.document.ErrorData in project crnk-framework by crnk-project.

the class ErrorDataBuilderTest method shouldSetCode.

@Test
public void shouldSetCode() throws Exception {
    ErrorData error = ErrorData.builder().setCode(ErrorDataMother.CODE).build();
    assertThat(error.getCode()).isEqualTo(ErrorDataMother.CODE);
}
Also used : ErrorData(io.crnk.core.engine.document.ErrorData) Test(org.junit.Test)

Example 10 with ErrorData

use of io.crnk.core.engine.document.ErrorData in project crnk-framework by crnk-project.

the class ErrorDataBuilderTest method shouldSetTitle.

@Test
public void shouldSetTitle() throws Exception {
    ErrorData error = ErrorData.builder().setTitle(ErrorDataMother.TITLE).build();
    assertThat(error.getTitle()).isEqualTo(ErrorDataMother.TITLE);
}
Also used : ErrorData(io.crnk.core.engine.document.ErrorData) Test(org.junit.Test)

Aggregations

ErrorData (io.crnk.core.engine.document.ErrorData)50 Test (org.junit.Test)30 ErrorResponse (io.crnk.core.engine.error.ErrorResponse)10 Document (io.crnk.core.engine.document.Document)9 ErrorDataBuilder (io.crnk.core.engine.document.ErrorDataBuilder)8 ExceptionMapperRegistry (io.crnk.core.engine.internal.exception.ExceptionMapperRegistry)6 JsonApiResponse (io.crnk.core.repository.response.JsonApiResponse)6 ArrayList (java.util.ArrayList)5 JsonApiExceptionMapper (io.crnk.core.engine.error.JsonApiExceptionMapper)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 HttpAdapterResponse (io.crnk.client.http.HttpAdapterResponse)3 ExceptionMapper (io.crnk.core.engine.error.ExceptionMapper)3 BadRequestException (io.crnk.core.exception.BadRequestException)3 RepositoryFilterContext (io.crnk.core.engine.filter.RepositoryFilterContext)2 InternalServerErrorException (io.crnk.core.exception.InternalServerErrorException)2 ResourceNotFoundException (io.crnk.core.exception.ResourceNotFoundException)2 Optional (io.crnk.core.utils.Optional)2 HashMap (java.util.HashMap)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 CrnkBoot (io.crnk.core.boot.CrnkBoot)1