By default, status codes 200,201,202,203,204 are considered a success for all requests, if we need to change this behavior for a single request we can use the @SuccessCodes annotation.
@RequestFactory
public interface MoviesService {
@Path("library/movies/:movieName")
@GET
Movie getMovieByName(@PathParam("movieName") String movieName);
@Path("library/movies")
@GET
List<Movie> listMovies();
@Path("library/movies/:name")
@PUT
@SuccessCodes({200})
void updateMovie(@beanParam @RequestBody Movie movie);
}
With the annotation added now updateMethod will only be considered success if the response status code is 200.