org.springframework.hateoas.VndErrors

Here are the examples of the java api org.springframework.hateoas.VndErrors taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

18 Source : DataFlowClientException.java
with Apache License 2.0
from spring-cloud

/**
 * A Java exception that wraps the serialized {@link VndErrors} object.
 *
 * @author Eric Bottard
 * @author Mark Fisher
 */
@SuppressWarnings("serial")
public clreplaced DataFlowClientException extends RuntimeException {

    private VndErrors vndErrors;

    public DataFlowClientException(VndErrors error) {
        this.vndErrors = error;
    }

    @Override
    public String getMessage() {
        StringBuilder builder = new StringBuilder();
        for (VndErrors.VndError e : vndErrors) {
            builder.append(e.getMessage()).append('\n');
        }
        return builder.toString();
    }
}

17 Source : VndErrorResponseErrorHandler.java
with Apache License 2.0
from spring-cloud

@Override
public void handleError(ClientHttpResponse response) throws IOException {
    VndErrors error = null;
    try {
        error = errorExtractor.extractData(response);
    } catch (Exception e) {
        super.handleError(response);
    }
    throw new DataFlowClientException(error);
}

12 Source : TaskLauncherTaskletTests.java
with Apache License 2.0
from spring-cloud-task-app-starters

@Test
@DirtiesContext
public void testInvalidTaskName() {
    final String ERROR_MESSAGE = "Could not find task definition named " + TASK_NAME;
    VndErrors errors = new VndErrors("message", ERROR_MESSAGE, new Link("ref"));
    Mockito.doThrow(new DataFlowClientException(errors)).when(this.taskOperations).launch(ArgumentMatchers.anyString(), ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any());
    TaskLauncherTasklet taskLauncherTasklet = getTaskExecutionTasklet();
    ChunkContext chunkContext = chunkContext();
    Throwable exception = replacedertThrows(DataFlowClientException.clreplaced, () -> taskLauncherTasklet.execute(null, chunkContext));
    replacedertions.replacedertThat(exception.getMessage()).isEqualTo(ERROR_MESSAGE);
}