@Test public void testBindyUnmarshalQuoteAndCommaDelimiter() throws Exception { MockEndpoint mock = getMockEndpoint("mock:out"); mock.expectedMessageCount(1); template.sendBody("direct:out", HEADER + "\n" + ROW); assertMockEndpointsSatisfied(); Map<?, ?> map1 = (Map<?, ?>) mock.getReceivedExchanges().get(0).getIn().getBody(List.class).get(0); Car rec1 = (Car) map1.values().iterator().next(); assertEquals("SS552", rec1.getStockid()); assertEquals("TOYOTA", rec1.getMake()); assertEquals("KLUGER", rec1.getModel()); assertEquals(2005, rec1.getYear()); assertEquals(Double.valueOf("155000.0"), rec1.getKlms(), 0.0001); assertEquals("EZR05I", rec1.getNvic()); assertEquals("Used", rec1.getStatus()); assertEquals(Car.Colour.BLACK, rec1.getColour()); }
private Car getCar() { Car car = new Car(); car.setStockid("SS552"); car.setMake("TOYOTA"); car.setModel("KLUGER"); car.setDeriv("CV 4X4"); car.setSeries("MCU28R UPGRADE"); car.setRegistration("TBA"); car.setChassis(""); car.setEngine(""); car.setYear(2005); car.setKlms(155000); car.setBody("4D WAGON"); car.setColour(Colour.BLACK); car.setEnginesize("3.3 LTR"); car.setTrans("5 Sp Auto"); car.setFuel("MULTI POINT FINJ"); car.setOptions( "POWER MIRRORS, POWER STEERING, POWER WINDOWS, CRUISE CONTROL," + " ENGINE IMMOBILISER, BRAKE ASSIST, DUAL AIRBAG PACKAGE, ANTI-LOCK BRAKING, CENTRAL LOCKING REMOTE CONTROL, ALARM SYSTEM/REMOTE" + " ANTI THEFT, AUTOMATIC AIR CON / CLIMATE CONTROL, ELECTRONIC BRAKE FORCE DISTRIBUTION, CLOTH TRIM, LIMITED SLIP DIFFERENTIAL," + " RADIO CD WITH 6 SPEAKERS"); car.setDesc( "Dual Airbag Package, Anti-lock Braking, Automatic Air Con / Climate Control, Alarm System/Remote" + " Anti Theft, Brake Assist, Cruise Control, Central Locking Remote Control, Cloth Trim, Electronic Brake Force Distribution," + " Engine Immobiliser, Limited Slip Differential, Power Mirrors, Power Steering, Power Windows, Radio CD with 6 Speakers" + " CV GOOD KLMS AUTO POWER OPTIONS GOOD KLMS "); car.setStatus("Used"); car.setNvic("EZR05I"); return car; }