-1
I need some help to do the unit test on Junit.
How to do the @Test method below:
public static StringBuilder findSQLPA() {
StringBuilder sql = new StringBuilder();
sql.append(" select fi1.co_carteira as carteira, ");
sql.append(" fi1.nu_cpf_cnpj as cpf_cnpj, ");
sql.append(" fi1.co_fundo_siart as siart, ");
sql.append(" fi1.no_fundo as fundo, ");
sql.append(" fi1.no_cotista as cotista, ");
sql.append(" fi1.nu_operacao_conta as op, ");
sql.append(" fi1.nu_conta as conta, ");
sql.append(" fi1.dt_mvtco_antiga as dt_antiga, ");
sql.append(" fi1.dt_mvtco_recente as dt_recente, ");
sql.append(" fi1.pc_taxa_administracao as taxa, ");
sql.append(" fd.no_tipo_macro_fundo as tipo_fundo, ");
sql.append(" fi1.vr_saldo_bruto, ");
sql.append(" fi1.vr_saldo_liquido, ");
sql.append(" fi1.vr_potencial_mes, ");
sql.append(" fi1.vr_pontecial_ano, ");
sql.append(" fi1.vr_potencial_12m , ");
sql.append(" fi1.nu_unidade_dire as dire, ");
sql.append(" fi1.nu_unidade_sr as sr, ");
sql.append(" fi1.nu_unidade as age ");
sql.append(" from cfism001.cfitb001_fundo_investimento fi1 ");
sql.append(" inner join cfism001.cfitb007_resumo_cliente fi ");
sql.append(" on fi.nu_cpf_cnpj = fi1.nu_cpf_cnpj ");
sql.append(" and fi.nu_unidade_dire = fi1.nu_unidade_dire ");
sql.append(" and fi.nu_unidade_sr = fi1.nu_unidade_sr ");
sql.append(" and fi.nu_unidade = fi1.nu_unidade ");
sql.append(" and fi.dt_importacao = fi1.dt_importacao ");
sql.append(" left join icosm001.icotbu24_unidade u ");
sql.append(" on (fi1.nu_unidade = u.nu_unidade AND u.dt_fim is null AND u.ic_ultima_situacao = 'AT') ");
sql.append(" left join cfism001.cfitb002_tipo_macro_fundo fd ");
sql.append(" on (fi1.co_tipo_macro_fundo = fd.co_tipo_macro_fundo) ");
sql.append(" where fi1.dt_importacao = :dt_importacao and fi1.nu_unidade = :nu_unidade @filtro ");
return sql;
}
first iramene thanks for the return. I see that the staff comments on the Mockito framework. You know?
– aleestevao
I do. Mockito is a very robust framework used largely by the Spring framework for integration testing, too. But it alone, for the test it wants to do, is only an auxiliary tool. The "thick" of an integration test is a framework like Spring that does. Here is a little bit about the various types of integration tests and how Mockito appears among them: https://www.baeldung.com/spring-boot-testing
– Dherik