private CoercionTarget target(Class<?> type) { return CoercionTargets.find(type); } }
protected CoercionTarget coercionType(final Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget() { return CoercionTargets.find(DateTimeFormatter.class); }
private CoercionTarget coercionTarget(final Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget(Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget(final Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget(final Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget(final Class<?> type) { return CoercionTargets.find(type); }
private CoercionTarget coercionTarget() { return CoercionTargets.find(Pattern.class); }
private CoercionTarget coercionTarget() { return CoercionTargets.find(InetSocketAddress.class); }
private CoercionTarget coercionTarget() { return CoercionTargets.find(Charset.class); }
private CoercionTarget coercionTarget() { return CoercionTargets.find(Fields.find(getClass(), "type")); }
private CoercionTarget componentCoercionType() { String name = testName.getMethodName(); Field field = getField(name); return CoercionTargets.find(field); }
private CoercionTarget componentCoercionType() { String name = testName.getMethodName(); Field field = getField(name); return CoercionTargets.find(field); }
private CoercionTarget componentCoercionType() { String name = testName.getMethodName(); Field field = getField(name); return CoercionTargets.find(field.getGenericType(), getClass(), field.getName()); }
@Test(expected = CouldNotConnectToWebServiceException.class) public void coerceNothing() { new WebServiceCoercion().coerce(CoercionTargets.find(OtherWs.class), WS_URL); }
@Test(expected = CouldNotConnectToWebServiceException.class) public void coerceWhere() { new WebServiceCoercion().coerce(CoercionTargets.find(OtherWs.class), "http://where"); }
@Test(expected = CouldNotCreateServiceProxyException.class) public void coerceOther() { WhatTestWs implementor = new WhatTestWs(); Endpoint endpoint = Endpoint.publish(WS_URL, implementor); try { new WebServiceCoercion().coerce(CoercionTargets.find(OtherWs.class), WS_URL); } finally { endpoint.stop(); } }
@Test(expected = CouldNotConnectToWebServiceException.class) public void coerceWrongUrl() { WhatTestWs implementor = new WhatTestWs(); Endpoint endpoint = Endpoint.publish(WS_URL + "/moved", implementor); try { new WebServiceCoercion().coerce(CoercionTargets.find(TestWs.class), WS_URL); } finally { endpoint.stop(); } }