001package co.codewizards.cloudstore.rest.server.service; 002 003import javax.ws.rs.Consumes; 004import javax.ws.rs.GET; 005import javax.ws.rs.POST; 006import javax.ws.rs.Path; 007import javax.ws.rs.QueryParam; 008import javax.ws.rs.core.MediaType; 009 010import org.slf4j.Logger; 011import org.slf4j.LoggerFactory; 012 013import co.codewizards.cloudstore.core.util.TestException; 014 015@Path("_test") 016@Consumes(MediaType.WILDCARD) 017public class TestService 018{ 019 private static final Logger logger = LoggerFactory.getLogger(TestService.class); 020 021 { 022 logger.debug("<init>: Instance created."); 023 } 024 025 private @QueryParam("exception") boolean exception; 026 027 @POST 028 public String testPOST() 029 { 030 return test(); 031 } 032 033 @GET 034 public String test() 035 { 036 if (exception) 037 throw new TestException("Test"); 038 039 return "SUCCESS"; 040 } 041}