1+ /*******************************************************************************
2+ * Copyright (c) 2017 Intuit
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ *******************************************************************************/
16+ package com .intuit .ipp .services ;
17+
18+ import com .intuit .ipp .core .Context ;
19+ import com .intuit .ipp .exception .FMSException ;
20+ import com .intuit .ipp .interceptors .IntuitInterceptorProvider ;
21+ import com .intuit .ipp .interceptors .IntuitMessage ;
22+ import mockit .Mock ;
23+ import mockit .MockUp ;
24+ import mockit .Mocked ;
25+ import org .testng .annotations .BeforeClass ;
26+ import org .testng .annotations .Test ;
27+
28+ public class ReportServiceTest {
29+ @ Mocked
30+ private Context context ;
31+
32+ private ReportService reportService ;
33+
34+ @ BeforeClass
35+ public void setup () {
36+ reportService = new ReportService (context );
37+ reportService = getMockedIntuitMessage ();
38+ }
39+
40+ @ Test
41+ public void testExecuteReport () throws FMSException {
42+ MockIntuitInterceptorProvider mockIntuitInterceptorProvider
43+ = new MockIntuitInterceptorProvider ();
44+ reportService .executeReport ("mock" );
45+ }
46+
47+ public ReportService getMockedIntuitMessage () {
48+ reportService .setReport_date ("" );
49+ reportService .setStart_date ("" );
50+ reportService .setEnd_date ("" );
51+ reportService .setDate_macro ("" );
52+ reportService .setDate_macro ("" );
53+ reportService .setPast_due ("" );
54+ reportService .setEnd_duedate ("" );
55+ reportService .setStart_duedate ("" );
56+ reportService .setDuedate_macro ("" );
57+ reportService .setAccounting_method ("" );
58+ reportService .setAccount ("" );
59+ reportService .setSource_account ("" );
60+ reportService .setSource_account_type ("" );
61+ reportService .setSummarize_column_by ("" );
62+ reportService .setAccount_type ("" );
63+ reportService .setCustomer ("" );
64+ reportService .setVendor ("" );
65+ reportService .setItem ("" );
66+ reportService .setClassid ("" );
67+ reportService .setAppaid ("" );
68+ reportService .setDepartment ("" );
69+ reportService .setQzurl ("" );
70+ reportService .setAging_period ("" );
71+ reportService .setAging_method ("" );
72+ reportService .setNum_periods ("" );
73+ reportService .setTerm ("" );
74+ reportService .setColumns ("" );
75+ reportService .setSort_by ("" );
76+ reportService .setSort_order ("" );
77+ reportService .setGroup_by ("" );
78+ reportService .setCreatedate_macro ("" );
79+ reportService .setEnd_createdate ("" );
80+ reportService .setStart_createdate ("" );
81+ reportService .setModdate_macro ("" );
82+ reportService .setEnd_moddate ("" );
83+ reportService .setStart_moddate ("" );
84+ reportService .setPayment_method ("" );
85+ reportService .setName ("" );
86+ reportService .setTransaction_type ("" );
87+ reportService .setCleared ("" );
88+ reportService .setArpaid ("" );
89+ reportService .setPrinted ("" );
90+ reportService .setBoth_amount ("" );
91+ reportService .setMemo ("" );
92+ reportService .setDoc_num ("" );
93+ reportService .setJournal_code ("" );
94+ reportService .setEmployee ("" );
95+ reportService .setAgency_id ("" );
96+ reportService .setCustom1 ("" );
97+ reportService .setCustom2 ("" );
98+ reportService .setCustom3 ("" );
99+ reportService .setShipvia ("" );
100+ reportService .setAccount_status ("" );
101+ reportService .setSubcol_pct_inc ("" );
102+ reportService .setSubcol_pct_exp ("" );
103+
104+ return reportService ;
105+ }
106+ private static final class MockIntuitInterceptorProvider extends MockUp <IntuitInterceptorProvider > {
107+
108+ @ Mock
109+ public void executeInterceptors (final IntuitMessage intuitMessage ) throws FMSException {
110+ // mocked executeInterceptors
111+ }
112+ }
113+ }
0 commit comments