Preciso fazer teste unitário de PlanilhaReader
porém esta extende ArrayList<String>
e sobrescrevo o método contains. Há alguma maneira de executá-lo?
@Component
public class PlanilhaReader extends ArrayList<String> {
final String UPLOAD_PATH = PropertiesSingleton.getValue("api.upload.dir");
@Override
public boolean contains(Object o) {
String paramStr = (String)o;
for (String s : this) {
if (paramStr.equalsIgnoreCase(s)) return true;
}
return false;
}
public BasicDBList readMetadados(Planilha planilha) {...}
}
Teste
public class PlanilhaReaderTest {
@Test
public void testReadMetadados() throws Exception {
PlanilhaReader reader = new PlanilhaReader();
Planilha planilha = new Planilha().setPath("552d4cf1ccf2c0a58301a744/55163343b0df070bbc66e1bb6e0c3f9b.xlsx");
reader.readMetadados(planilha);
}
}
Ao compilar obtenho o erro:
Hot Swap failed
Tomcat 8.0.18: hierarchy change not implemented;
Tomcat 8.0.18: Operation not supported by VM;
PlanilhaReaderTest: hierarchy change not implemented;
PlanilhaReaderTest: Operation not supported by VM;
PlanilhaReaderTest: hierarchy change not implemented;
PlanilhaReaderTest: Operation not supported by VM
ArrayList<String>
? Isso me parece ser uma péssima ideia!