Professional Documents
Culture Documents
Unknown
Unknown
BUSINESS SCENARIO
Technical Requirements
For all the functional requirements 1, 2 and 3 component specification and method specification are
given below. Please follow the same order to implement them using the code skeleton.
A. Component Specification:
Require • Parse Input
ment
Name
Compon Reads the input text file, and convert the data into objects
ent
Definiti
on
Files InsuranceCompanyAdminService.java, ApplicationUtil.java, Customer.java, MemberShip.java,
Include inputfeed.txt, InsuranceCompanyException.java
d
(refer
Skeleto
n)
Respons Reads the input file, checks if the insurance type is “Health Insurance” and builds the “Customer”
ibilities and “MemberShip” value object and returns it
Design • Input file format is .txt and is comma separated (Sample rows are added. You can add any
Constrai number of rows to test your service class from main method.
nts • File Structure is like below:
<customerId>,<customerName>,<contactNo>,<email>,<membershipType>,<insuranceType
>,<dueDate>,<numberOfMonths>,<hospitalName>,<waitingPeriod>,<percentageCovered>.
• In the input feed, filter Customer’s payment details record for which the insurance type is
“Health Insurance”.
• Do not change the data types of the value object given in POJO.
• Use ApplicationUtil.java for reading file.
Resourc inputfeed.txt is the input file that must be parsed. The file, along with file location will be sent as an
es argument to the InsuranceCompanyAdminService.addCustomerDetails method. File location/path
must not be hardcoded
Process • InsuranceCompanyAdminService addCustomerDetails with the inputfeed (.txt) file
Flow • addCustomerDetails calls the readFile() method by passing the file to it as arg.
• Read the file using File I/O or Java Streams in ApplicationUtil.readFile method
• readFile returns List<String> of records, that were read from the file. It should filter only
records where the InsuranceType is “HealthInsurance” and returns these records (with each
record’s fields delimited by comma).
• Code the method InsuranceCompanyAdminService.buildCustomerList, pass the output of
the readFile method to this method.
• In the method InsuranceCompanyAdminService.buildCustomerList, iterate every line from
the list, split the records based on comma separator, generate Customer object, and
MemberShip object (inject Customer object in MemberShip object with other fields)
• Use InsuranceCompanyAdminService.findAmountToBePaid method to set each customer
with the amount to be paid according to the number of years of membership and the
percentage passed as parameter.
• From the InsuranceCompanyAdminService.buildPaymentDetailsList return the
List<MemberShip>.
Excepti While doing File I/O in the ApplicationUtil.readFile method, catch all exceptions and throw
onal application specific exception “InsuranceCompanyException”
Conditi
ons
B. Method Specification:
Exceptional While working with DAO methods, catch all exceptions and throw application
Conditions specific exception, InsuranceCompanyException.
You are allowed to modify input file text to incorporate more test data for various test scenarios /
boundary conditions. Test your application by invoking the service methods from the main class,
main () method. Follow Java Naming conventions; test the code quality by running PMD rules in
Eclipse or any other IDE that you use.