@Test public void test() throws Exception { Mockito.when(rs.next()).thenReturn(true); when(rs.getLong("id")).thenReturn(Long.valueOf("6")); when(rs.getString("name")).thenReturn("MarriageCertificate"); when(rs.getString("code")).thenReturn("00015"); when(rs.getBoolean("isactive")).thenReturn(true); when(rs.getBoolean("isindividual")).thenReturn(true); when(rs.getBoolean("isrequired")).thenReturn(true); when(rs.getString("proof")).thenReturn(DocumentProof.ADDRESS_PROOF.toString()); when(rs.getString("appltype")).thenReturn(ApplicationType.REGISTRATION.toString()); when(rs.getString("tenantid")).thenReturn("ap.kurnool"); MarriageDocumentType marriageDocumentType = marriageDocumenttypeRowMapper.mapRow(rs, 1); assertEquals(getMarriageDocumentType(), marriageDocumentType); }
@Override public MarriageDocumentType mapRow(ResultSet rs, int rowNum) throws SQLException { MarriageDocumentType marriageDocumentType = new MarriageDocumentType(); marriageDocumentType.setId(rs.getLong("id")); marriageDocumentType.setName(rs.getString("name")); marriageDocumentType.setCode(rs.getString("code")); marriageDocumentType.setIsActive(rs.getBoolean("isactive")); marriageDocumentType.setIsIndividual(rs.getBoolean("isindividual")); marriageDocumentType.setIsRequired(rs.getBoolean("isrequired")); marriageDocumentType.setProof(DocumentProof.fromValue(rs.getString("proof"))); marriageDocumentType.setApplicationType(ApplicationType.fromValue(rs.getString("appltype"))); marriageDocumentType.setTenantId(rs.getString("tenantid")); return marriageDocumentType; }
MarriageDocumentTypeRowMapper implements RowMapper<MarriageDocumentType> { @Override public MarriageDocumentType mapRow(ResultSet rs, int rowNum) throws SQLException { MarriageDocumentType marriageDocumentType = new MarriageDocumentType(); marriageDocumentType.setId(rs.getLong("id")); marriageDocumentType.setName(rs.getString("name")); marriageDocumentType.setCode(rs.getString("code")); marriageDocumentType.setIsActive(rs.getBoolean("isactive")); marriageDocumentType.setIsIndividual(rs.getBoolean("isindividual")); marriageDocumentType.setIsRequired(rs.getBoolean("isrequired")); marriageDocumentType.setProof(DocumentProof.fromValue(rs.getString("proof"))); marriageDocumentType.setApplicationType(ApplicationType.fromValue(rs.getString("appltype"))); marriageDocumentType.setTenantId(rs.getString("tenantid")); return marriageDocumentType; } }
MarriageDocumentTypeRowMapper implements RowMapper<MarriageDocumentType> { @Override public MarriageDocumentType mapRow(ResultSet rs, int rowNum) throws SQLException { MarriageDocumentType marriageDocumentType = new MarriageDocumentType(); marriageDocumentType.setId(rs.getLong("id")); marriageDocumentType.setName(rs.getString("name")); marriageDocumentType.setCode(rs.getString("code")); marriageDocumentType.setIsActive(rs.getBoolean("isactive")); marriageDocumentType.setIsIndividual(rs.getBoolean("isindividual")); marriageDocumentType.setIsRequired(rs.getBoolean("isrequired")); marriageDocumentType.setProof(DocumentProof.fromValue(rs.getString("proof"))); marriageDocumentType.setApplicationType(ApplicationType.fromValue(rs.getString("appltype"))); marriageDocumentType.setTenantId(rs.getString("tenantid")); return marriageDocumentType; }  }
MarriageDocumentTypeRowMapper implements RowMapper<MarriageDocumentType> { @Override public MarriageDocumentType mapRow(ResultSet rs, int rowNum) throws SQLException { MarriageDocumentType marriageDocumentType = new MarriageDocumentType(); marriageDocumentType.setId(rs.getLong("id")); marriageDocumentType.setName(rs.getString("name")); marriageDocumentType.setCode(rs.getString("code")); marriageDocumentType.setIsActive(rs.getBoolean("isactive")); marriageDocumentType.setIsIndividual(rs.getBoolean("isindividual")); marriageDocumentType.setIsRequired(rs.getBoolean("isrequired")); marriageDocumentType.setProof(DocumentProof.fromValue(rs.getString("proof"))); marriageDocumentType.setApplicationType(ApplicationType.fromValue(rs.getString("appltype"))); marriageDocumentType.setTenantId(rs.getString("tenantid")); return marriageDocumentType; }  @Override MarriageDocumentType mapRow(ResultSet rs, int rowNum); }
MarriageDocumentTypeRowMapper implements RowMapper<MarriageDocumentType> { @Override public MarriageDocumentType mapRow(ResultSet rs, int rowNum) throws SQLException { MarriageDocumentType marriageDocumentType = new MarriageDocumentType(); marriageDocumentType.setId(rs.getLong("id")); marriageDocumentType.setName(rs.getString("name")); marriageDocumentType.setCode(rs.getString("code")); marriageDocumentType.setIsActive(rs.getBoolean("isactive")); marriageDocumentType.setIsIndividual(rs.getBoolean("isindividual")); marriageDocumentType.setIsRequired(rs.getBoolean("isrequired")); marriageDocumentType.setProof(DocumentProof.fromValue(rs.getString("proof"))); marriageDocumentType.setApplicationType(ApplicationType.fromValue(rs.getString("appltype"))); marriageDocumentType.setTenantId(rs.getString("tenantid")); return marriageDocumentType; }  @Override MarriageDocumentType mapRow(ResultSet rs, int rowNum);  }