/** * Invoked after JAXB has unmarshalled this object. */ private void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { if (containsOperations != null && coupledResources != null) { OperationName.resolve(containsOperations, coupledResources); } } }
/** * Invoked after JAXB has unmarshalled this object. */ @SuppressWarnings("unused") private void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { if (containsOperations != null && coupledResources != null) { OperationName.resolve(containsOperations, coupledResources); } } }
/** * Tests {@link OperationName#resolve(Collection, Collection)}. */ @Test public void testOperationNameResolve() { final DefaultCoupledResource resource = create(DefaultFactories.forBuildin(NameFactory.class)); final DefaultOperationMetadata operation = resource.getOperation(); /* * Test OperationName replacement when the name matches. */ resource.setOperation(new OperationName(operation.getOperationName())); assertNotSame("Before resolve", operation, resource.getOperation()); OperationName.resolve(singleton(operation), singleton(resource)); assertSame("After resolve", operation, resource.getOperation()); /* * If the name doesn't match, no replacement shall be done. */ final OperationName other = new OperationName("Other"); resource.setOperation(other); assertSame("Before resolve", other, resource.getOperation()); OperationName.resolve(singleton(operation), singleton(resource)); assertSame("After resolve", other, resource.getOperation()); } }