Search in sources :

Example 1 with BoltBinding

use of com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding in project sofa-boot by sofastack.

the class BoltBindingConverter method convert.

@Override
public RpcBinding convert(SofaReference sofaReferenceAnnotation, SofaReferenceBinding sofaReferenceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new BoltBindingParam();
    convertReferenceAnnotation(bindingParam, sofaReferenceBindingAnnotation, bindingConverterContext);
    return new BoltBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)

Example 2 with BoltBinding

use of com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding in project sofa-boot by sofastack.

the class MockBeanConfigTest method testEmptyMockBean.

@Test
public void testEmptyMockBean() {
    RpcBindingParam rpcBindingParam = new BoltBindingParam();
    RpcBinding rpcBinding = new BoltBinding(rpcBindingParam, null, true);
    try {
        consumerConfigHelper.getMockRef(rpcBinding, null);
        Assert.fail();
    } catch (IllegalArgumentException e) {
    // success;
    }
}
Also used : RpcBinding(com.alipay.sofa.rpc.boot.runtime.binding.RpcBinding) BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with BoltBinding

use of com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding in project sofa-boot by alipay.

the class BoltBindingConverter method convert.

@Override
public RpcBinding convert(SofaService sofaServiceAnnotation, SofaServiceBinding sofaServiceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new BoltBindingParam();
    convertServiceAnnotation(bindingParam, sofaServiceAnnotation, sofaServiceBindingAnnotation, bindingConverterContext);
    return new BoltBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)

Example 4 with BoltBinding

use of com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding in project sofa-boot by alipay.

the class MockBeanConfigTest method testEmptyMockBean.

@Test
public void testEmptyMockBean() {
    RpcBindingParam rpcBindingParam = new BoltBindingParam();
    RpcBinding rpcBinding = new BoltBinding(rpcBindingParam, null, true);
    try {
        consumerConfigHelper.getMockRef(rpcBinding, null);
        Assert.fail();
    } catch (IllegalArgumentException e) {
    // success;
    }
}
Also used : RpcBinding(com.alipay.sofa.rpc.boot.runtime.binding.RpcBinding) BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with BoltBinding

use of com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding in project sofa-boot by alipay.

the class BoltBindingConverter method convert.

@Override
public RpcBinding convert(SofaReference sofaReferenceAnnotation, SofaReferenceBinding sofaReferenceBindingAnnotation, BindingConverterContext bindingConverterContext) {
    RpcBindingParam bindingParam = new BoltBindingParam();
    convertReferenceAnnotation(bindingParam, sofaReferenceBindingAnnotation, bindingConverterContext);
    return new BoltBinding(bindingParam, bindingConverterContext.getApplicationContext(), bindingConverterContext.isInBinding());
}
Also used : BoltBinding(com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding) RpcBindingParam(com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam) BoltBindingParam(com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)

Aggregations

BoltBinding (com.alipay.sofa.rpc.boot.runtime.binding.BoltBinding)6 BoltBindingParam (com.alipay.sofa.rpc.boot.runtime.param.BoltBindingParam)6 RpcBindingParam (com.alipay.sofa.rpc.boot.runtime.param.RpcBindingParam)6 RpcBinding (com.alipay.sofa.rpc.boot.runtime.binding.RpcBinding)2 Test (org.junit.Test)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2