22
33import static org .apache .commons .lang3 .RandomStringUtils .randomAlphabetic ;
44
5- import java .util .List ;
6-
7- import org .apache .commons .lang3 .tuple .Pair ;
8- import org .apache .http .HttpHeaders ;
95import org .rest .client .template .AbstractRESTTemplate ;
10- import org .rest .client .template .ClientOperations ;
116import org .rest .sec .client .ExamplePaths ;
127import org .rest .sec .model .Privilege ;
138import org .rest .sec .model .Role ;
14- import org .rest .sec .util .SearchTestUtil ;
159import org .rest .testing .security .AuthenticationUtil ;
1610import org .springframework .beans .factory .annotation .Autowired ;
1711import org .springframework .stereotype .Component ;
1812
19- import com .google .common .base .Preconditions ;
2013import com .google .common .collect .Sets ;
21- import com .jayway .restassured .response .Response ;
2214import com .jayway .restassured .specification .RequestSpecification ;
2315
2416@ Component
@@ -38,28 +30,6 @@ public final Role findByName(final String name) {
3830 return marshaller .decode (resourceAsXML , clazz );
3931 }
4032
41- @ Override
42- public final Response searchAsResponse (final Pair <Long , ClientOperations > idOp , final Pair <String , ClientOperations > nameOp ) {
43- final String queryURI = getURI () + "?q=" + SearchTestUtil .constructQueryString (idOp , nameOp );
44- return givenAuthenticated ().header (HttpHeaders .ACCEPT , marshaller .getMime ()).get (queryURI );
45- }
46-
47- @ Override
48- public final Response searchAsResponse (final Long id , final String name ) {
49- final String queryURI = getURI () + "?q=" + SearchTestUtil .constructQueryString (id , name );
50- return givenAuthenticated ().header (HttpHeaders .ACCEPT , marshaller .getMime ()).get (queryURI );
51- }
52-
53- @ SuppressWarnings ({ "unchecked" , "rawtypes" })
54- @ Override
55- public final List <Role > search (final Long id , final String name ) {
56- final String queryURI = getURI () + "?q=" + SearchTestUtil .constructQueryString (id , name );
57- final Response searchResponse = givenAuthenticated ().header (HttpHeaders .ACCEPT , marshaller .getMime ()).get (queryURI );
58- Preconditions .checkState (searchResponse .getStatusCode () == 200 );
59-
60- return getMarshaller ().<List > decode (searchResponse .getBody ().asString (), List .class );
61- }
62-
6333 // template method
6434
6535 @ Override
0 commit comments