org.springframework.http.HttpStatus.Series Java Examples

The following examples show how to use org.springframework.http.HttpStatus.Series. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RoutingTreeTest.java    From riptide with MIT License 6 votes vote down vote up
@Test
void shouldUseOtherWhenMergingOnDifferentAttributes() throws Exception {
    final RoutingTree<Series> left = dispatch(series(),
            on(SUCCESSFUL).dispatch(status(),
                    anyStatus().call(other)),
            anySeries().call(pass()));

    final RoutingTree<HttpStatus> right = dispatch(status(),
            on(CREATED).call(expected),
            anyStatus().call(pass()));

    final Route merge = left.merge(right);

    merge.execute(response(CREATED), reader);
    merge.execute(response(OK), reader);

    verify(expected).execute(any(), any());
    verify(other, never()).execute(any(), any());
}
 
Example #2
Source File: RoutingTreeTest.java    From riptide with MIT License 5 votes vote down vote up
@Test
void shouldMergeRecursively() throws Exception {
    final RoutingTree<Series> left = dispatch(series(),
            on(SUCCESSFUL).dispatch(status(),
                    anyStatus().call(other)),
            anySeries().call(other));

    final RoutingTree<Series> right = dispatch(series(),
            on(SUCCESSFUL).dispatch(status(),
                    on(CREATED).call(expected)));

    left.merge(right).execute(response(CREATED), reader);

    verify(expected).execute(any(), any());
}
 
Example #3
Source File: RoutingTreeTest.java    From riptide with MIT License 5 votes vote down vote up
@Test
void shouldUseNonRoutingTreeOnMerge() throws Exception {
    final RoutingTree<Series> left = dispatch(series(),
            on(SUCCESSFUL).dispatch(status(),
                    anyStatus().call(other)),
            anySeries().call(pass()));

    final Route merge = left.merge(expected);

    merge.execute(response(CREATED), reader);
    merge.execute(response(OK), reader);

    verify(expected, times(2)).execute(any(), any());
    verify(other, never()).execute(any(), any());
}
 
Example #4
Source File: ExRetryGatewayFilterFactory.java    From wecube-platform with Apache License 2.0 4 votes vote down vote up
public List<Series> getSeries() {
    return series;
}
 
Example #5
Source File: ExRetryGatewayFilterFactory.java    From wecube-platform with Apache License 2.0 4 votes vote down vote up
public RetryConfig setSeries(Series... series) {
    this.series = Arrays.asList(series);
    return this;
}
 
Example #6
Source File: RetryGatewayFilterFactory.java    From spring-cloud-gateway with Apache License 2.0 4 votes vote down vote up
public List<Series> getSeries() {
	return series;
}
 
Example #7
Source File: RetryGatewayFilterFactory.java    From spring-cloud-gateway with Apache License 2.0 4 votes vote down vote up
public RetryConfig setSeries(Series... series) {
	this.series = Arrays.asList(series);
	return this;
}
 
Example #8
Source File: NavigatorsTest.java    From riptide with MIT License 4 votes vote down vote up
@Test
void shouldExposeTypeOfSeries() {
    assertThat(series().getType(), is(TypeToken.of(Series.class)));
}
 
Example #9
Source File: HttpOperations.java    From riptide with MIT License 4 votes vote down vote up
public HttpOperations withDefaultRoutingTree(final RoutingTree<Series> defaultRoutingTree) {
    return new HttpOperations(http, defaultRoutingTree);
}
 
Example #10
Source File: AsyncHttpOperations.java    From riptide with MIT License 4 votes vote down vote up
public AsyncHttpOperations withDefaultRoutingTree(final RoutingTree<Series> defaultRoutingTree) {
    return new AsyncHttpOperations(http, defaultRoutingTree);
}
 
Example #11
Source File: Navigators.java    From riptide with MIT License 2 votes vote down vote up
/**
 * A {@link Navigator} that selects a binding based on the response's status code series
 *
 * @return an HTTP status code series selector
 * @see Series
 */
public static Navigator<Series> series() {
    return SeriesNavigator.INSTANCE;
}