|
3 | 3 | import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; |
4 | 4 | import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric; |
5 | 5 | import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; |
6 | | -import static org.baeldung.common.search.ClientOperation.EQ; |
7 | | -import static org.baeldung.common.search.ClientOperation.NEG_EQ; |
8 | 6 | import static org.baeldung.common.spring.util.Profiles.CLIENT; |
9 | 7 | import static org.baeldung.common.spring.util.Profiles.TEST; |
10 | 8 | import static org.hamcrest.CoreMatchers.is; |
11 | 9 | import static org.hamcrest.MatcherAssert.assertThat; |
12 | | -import static org.hamcrest.Matchers.equalTo; |
13 | 10 | import static org.hamcrest.Matchers.notNullValue; |
14 | 11 | import static org.junit.Assert.assertEquals; |
15 | 12 | import static org.junit.Assert.assertNotNull; |
16 | 13 |
|
17 | | -import org.apache.commons.lang3.tuple.ImmutableTriple; |
18 | 14 | import org.apache.http.HttpHeaders; |
19 | 15 | import org.baeldung.client.IDtoOperations; |
20 | 16 | import org.baeldung.client.marshall.IMarshaller; |
21 | 17 | import org.baeldung.common.interfaces.INameableDto; |
22 | | -import org.baeldung.common.search.ClientOperation; |
23 | | -import org.baeldung.common.util.SearchField; |
24 | 18 | import org.baeldung.common.web.WebConstants; |
25 | 19 | import org.baeldung.test.common.client.template.IRestClient; |
26 | 20 | import org.baeldung.test.common.util.IDUtil; |
@@ -103,58 +97,6 @@ public final void givenResourceExists_whenResourceIsRetrieved_thenResourceIsCorr |
103 | 97 | assertThat(res.getStatusCode(), is(409)); |
104 | 98 | } |
105 | 99 |
|
106 | | - // find one - by attributes |
107 | | - // note: kept as the same tests from AbstractLogicClientRestLiveTest are |
108 | | - // still ignored (bug in RestTemplate) |
109 | | - |
110 | | - @Test |
111 | | - /**/public final void givenResourceExists_whenResourceIsSearchedByNameAttribute_thenNoExceptions() { |
112 | | - // Given |
113 | | - final T existingResource = getApi().create(createNewResource()); |
114 | | - |
115 | | - // When |
116 | | - final ImmutableTriple<String, ClientOperation, String> nameConstraint = new ImmutableTriple<String, ClientOperation, String>(SearchField.name.name(), EQ, existingResource.getName()); |
117 | | - getApi().searchOne(nameConstraint); |
118 | | - } |
119 | | - |
120 | | - @Test |
121 | | - /**/public final void givenResourceExists_whenResourceIsSearchedByNameAttribute_thenResourceIsFound() { |
122 | | - // Given |
123 | | - final T existingResource = getApi().create(createNewResource()); |
124 | | - |
125 | | - // When |
126 | | - final ImmutableTriple<String, ClientOperation, String> nameConstraint = new ImmutableTriple<String, ClientOperation, String>(SearchField.name.name(), EQ, existingResource.getName()); |
127 | | - final T resourceByName = getApi().searchOne(nameConstraint); |
128 | | - |
129 | | - // Then |
130 | | - assertNotNull(resourceByName); |
131 | | - } |
132 | | - |
133 | | - @Test |
134 | | - /**/public final void givenResourceExists_whenResourceIsSearchedByNameAttribute_thenFoundResourceIsCorrect() { |
135 | | - // Given |
136 | | - final T existingResource = getApi().create(createNewResource()); |
137 | | - |
138 | | - // When |
139 | | - final ImmutableTriple<String, ClientOperation, String> nameConstraint = new ImmutableTriple<String, ClientOperation, String>(SearchField.name.name(), EQ, existingResource.getName()); |
140 | | - final T resourceByName = getApi().searchOne(nameConstraint); |
141 | | - |
142 | | - // Then |
143 | | - assertThat(existingResource, equalTo(resourceByName)); |
144 | | - } |
145 | | - |
146 | | - @Test |
147 | | - /**/public final void givenResourceExists_whenResourceIsSearchedByNagatedNameAttribute_thenNoExceptions() { |
148 | | - // Given |
149 | | - final T existingResource = getApi().create(createNewResource()); |
150 | | - |
151 | | - // When |
152 | | - final ImmutableTriple<String, ClientOperation, String> nameConstraint = new ImmutableTriple<String, ClientOperation, String>(SearchField.name.name(), NEG_EQ, existingResource.getName()); |
153 | | - getApi().searchAll(nameConstraint); |
154 | | - |
155 | | - // Then |
156 | | - } |
157 | | - |
158 | 100 | // create |
159 | 101 |
|
160 | 102 | @Test |
|
0 commit comments