/** Test to create a new TransportUnit that already exists. */ @Test public final void testMoveUnknownTransportUnit() { try { transportService.moveTransportUnit(new Barcode("TEST"), targetLocationPk); fail( "Must throw a ServiceException while trying to create a TransportUnit with unknown Barcode"); } catch (ServiceRuntimeException se) { LOGGER.debug( "OK:ServiceException expected while trying to create a TransportUnit with unknown Barcode"); } }
/** Positive test to move a TransportUnit. */ @Test public final void testMoveTransportUnit() { TransportUnit transportUnit = transportService.create(new Barcode("4711"), transportUnitType, locationPk); assertNotNull("TransportService must create a new TransportUnit", transportUnit); assertEquals( "The actual Location of the TransportUnit must be preset", locationPk, transportUnit.getActualLocation().getLocationId()); transportService.moveTransportUnit(transportUnit.getBarcode(), targetLocationPk); assertEquals( "The actual Location of the TransportUnit must be changed", targetLocationPk, transportUnit.getActualLocation().getLocationId()); }