1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.hack23.cia.service.impl.action.admin;
20
21 import org.junit.Test;
22
23 import com.hack23.cia.service.api.action.admin.UpdateSearchIndexRequest;
24 import com.hack23.cia.service.api.action.admin.UpdateSearchIndexResponse;
25 import com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest;
26 import com.hack23.cia.service.api.action.common.ServiceResponse.ServiceResult;
27 import com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest;
28
29
30
31
32 public final class UpdateSearchIndexServiceITest extends AbstractServiceFunctionalIntegrationTest {
33
34
35
36
37
38
39
40 @Test
41 public void Test() throws Exception {
42 setAuthenticatedAdminuser();
43 final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
44
45 final UpdateSearchIndexRequest serviceRequest = new UpdateSearchIndexRequest();
46 serviceRequest.setSessionId(createSessionRequest.getSessionId());
47
48 final UpdateSearchIndexResponse response = (UpdateSearchIndexResponse) applicationManager
49 .service(serviceRequest);
50 assertNotNull(EXPECT_A_RESULT, response);
51 }
52
53
54
55
56
57
58
59 @Test
60 public void serviceRequestValidationFailureTest() throws Exception {
61 setAuthenticatedAdminuser();
62 final UpdateSearchIndexRequest serviceRequest = new UpdateSearchIndexRequest();
63
64 final UpdateSearchIndexResponse response = (UpdateSearchIndexResponse) applicationManager
65 .service(serviceRequest);
66 assertNotNull(EXPECT_A_RESULT, response);
67 assertEquals(EXPECT_SUCCESS, ServiceResult.FAILURE,response.getResult());
68 assertEquals("sessionId must not be null", response.getErrorMessage());
69 }
70
71 }