I started writing unit tests recently and need to test reading fields in a spreadsheet (.xlsx and .xls), my biggest question is:
Should I create a spreadsheet by code using Apache POI or use external spreadsheet models that are used in software? What is the best practice?
How the spreadsheet/workbook is created shouldn't matter. You may have some issues with cells whose value is derived from a formula though. I like to work with .csv files if at all possible. They are much easier to parse if you write the java code yourself (without using 3rd party libraries).
Here are a few examples for Excel file types, from HelloSelenium.com, that I found: