@Test public void extractConnectionUserDetails() { ConnectionUserResponseExtractor e = new ConnectionUserResponseExtractor(); ConnectionUser user = e.extractData(new RpcResponse("20012\r\nVEHU,TEN\r\nTen Vehu\r\n21787^SLC-FO EDIS DEV^960D\r\nScholar Extraordinaire\r\nMEDICINE\r\n\r\n5400\r\n\r\n")); assertEquals("20012", user.getDUZ()); assertEquals("VEHU,TEN", user.getName()); assertEquals("Ten Vehu", user.getStandardName()); assertEquals("960", user.getPrimaryStationNumber()); assertEquals("960D", user.getDivision()); assertEquals("Scholar Extraordinaire", user.getTitle()); assertEquals("MEDICINE", user.getServiceSection()); assertEquals("", user.getLanguage()); assertEquals("5400", user.getDTime()); assertEquals("SLC-FO EDIS DEV", user.getDivisionNames().get(user.getDivision())); assertNull(user.getCredentials()); }
@Override public ConnectionUser extractData(RpcResponse response) throws RpcResponseExtractionException { String[] lines = linesFromRpcResponseExtractor.extractData(response); ConnectionUser user = new ConnectionUser(); user.setDUZ(lines[0]); user.setName(lines[1]); user.setStandardName(lines[2]); String division = VistaStringUtils.piece(lines[3], VistaStringUtils.U, 3); user.setDivision(division); user.setDivisionNames(Collections.singletonMap(division, VistaStringUtils.piece(lines[3], VistaStringUtils.U, 2))); user.setTitle(lines[4]); user.setServiceSection(lines[5]); user.setLanguage(lines[6]); user.setDTime(lines[7]); return user; }
ConnectionUserResponseExtractor implements RpcResponseExtractor<ConnectionUser> { @Override public ConnectionUser extractData(RpcResponse response) throws RpcResponseExtractionException { String[] lines = linesFromRpcResponseExtractor.extractData(response); ConnectionUser user = new ConnectionUser(); user.setDUZ(lines[0]); user.setName(lines[1]); user.setStandardName(lines[2]); String division = VistaStringUtils.piece(lines[3], VistaStringUtils.U, 3); user.setDivision(division); user.setDivisionNames(Collections.singletonMap(division, VistaStringUtils.piece(lines[3], VistaStringUtils.U, 2))); user.setTitle(lines[4]); user.setServiceSection(lines[5]); user.setLanguage(lines[6]); user.setDTime(lines[7]); return user; } }
ConnectionUserResponseExtractor implements RpcResponseExtractor<ConnectionUser> { @Override public ConnectionUser extractData(RpcResponse response) throws RpcResponseExtractionException { String[] lines = linesFromRpcResponseExtractor.extractData(response); ConnectionUser user = new ConnectionUser(); user.setDUZ(lines[0]); user.setName(lines[1]); user.setStandardName(lines[2]); String division = VistaStringUtils.piece(lines[3], VistaStringUtils.U, 3); user.setDivision(division); user.setDivisionNames(Collections.singletonMap(division, VistaStringUtils.piece(lines[3], VistaStringUtils.U, 2))); user.setTitle(lines[4]); user.setServiceSection(lines[5]); user.setLanguage(lines[6]); user.setDTime(lines[7]); return user; }  }
ConnectionUserResponseExtractor implements RpcResponseExtractor<ConnectionUser> { @Override public ConnectionUser extractData(RpcResponse response) throws RpcResponseExtractionException { String[] lines = linesFromRpcResponseExtractor.extractData(response); ConnectionUser user = new ConnectionUser(); user.setDUZ(lines[0]); user.setName(lines[1]); user.setStandardName(lines[2]); String division = VistaStringUtils.piece(lines[3], VistaStringUtils.U, 3); user.setDivision(division); user.setDivisionNames(Collections.singletonMap(division, VistaStringUtils.piece(lines[3], VistaStringUtils.U, 2))); user.setTitle(lines[4]); user.setServiceSection(lines[5]); user.setLanguage(lines[6]); user.setDTime(lines[7]); return user; }  @Override ConnectionUser extractData(RpcResponse response); }
ConnectionUserResponseExtractor implements RpcResponseExtractor<ConnectionUser> { @Override public ConnectionUser extractData(RpcResponse response) throws RpcResponseExtractionException { String[] lines = linesFromRpcResponseExtractor.extractData(response); ConnectionUser user = new ConnectionUser(); user.setDUZ(lines[0]); user.setName(lines[1]); user.setStandardName(lines[2]); String division = VistaStringUtils.piece(lines[3], VistaStringUtils.U, 3); user.setDivision(division); user.setDivisionNames(Collections.singletonMap(division, VistaStringUtils.piece(lines[3], VistaStringUtils.U, 2))); user.setTitle(lines[4]); user.setServiceSection(lines[5]); user.setLanguage(lines[6]); user.setDTime(lines[7]); return user; }  @Override ConnectionUser extractData(RpcResponse response);  }