target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void findExecutor_oneParam(@Mocked Executor executor, @Mocked OperationMeta operationMeta) { new Expectations(BeanUtils.class) { { BeanUtils.getBean(ExecutorManager.EXECUTOR_DEFAULT); result = executor; } }; Assert.assertSame(executor, new ExecutorManager().findExecutor(operationMeta)); }
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test public void findExecutor_twoParam_opCfg_withoutOpDef(@Mocked Executor executor, @Mocked OperationMeta operationMeta) { String schemaQualifiedName = "schemaId.opId"; String opBeanId = "opBeanId"; ArchaiusUtils.setProperty(ExecutorManager.KEY_EXECUTORS_PREFIX + schemaQualifiedName, opBeanId); new Expectations(BeanU...
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test public void findExecutor_twoParam_opCfg_withOpDef(@Mocked Executor executor, @Mocked Executor defExecutor, @Mocked OperationMeta operationMeta) { String schemaQualifiedName = "schemaId.opId"; String opBeanId = "opBeanId"; ArchaiusUtils.setProperty(ExecutorManager.KEY_EXECUTORS_PREFIX + schemaQualifiedName, opBean...
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test public void findExecutor_twoParam_schemaCfg_withOpDef(@Mocked OperationMeta operationMeta, @Mocked Executor defExecutor) { Assert.assertSame(defExecutor, new ExecutorManager().findExecutor(operationMeta, defExecutor)); }
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test public void test_getMicroservice_forOtherService_shouldCallZeroConfigRegistryService() { when(zeroConfigRegistryService.getMicroservice(otherServiceId)) .thenReturn(prepareServerServiceInstance(true)); Microservice returnedResult = target.getMicroservice(otherServiceId); Assert.assertEquals(otherServiceId, return...
public Microservice getMicroservice(String microserviceId) { if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice; } else { return ClientUtil .convertToClientMicroservice(zeroConfigRegistryService.getMicroservice(microserviceId)); } }
ZeroConfigClient { public Microservice getMicroservice(String microserviceId) { if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice; } else { return ClientUtil .convertToClientMicroservice(zeroConfigRegistryService.getMicroservice(microserviceId)); } } }
ZeroConfigClient { public Microservice getMicroservice(String microserviceId) { if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice; } else { return ClientUtil .convertToClientMicroservice(zeroConfigRegistryService.getMicroservice(microserviceId)); } } private ZeroConfigClient(ZeroCon...
ZeroConfigClient { public Microservice getMicroservice(String microserviceId) { if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice; } else { return ClientUtil .convertToClientMicroservice(zeroConfigRegistryService.getMicroservice(microserviceId)); } } private ZeroConfigClient(ZeroCon...
ZeroConfigClient { public Microservice getMicroservice(String microserviceId) { if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice; } else { return ClientUtil .convertToClientMicroservice(zeroConfigRegistryService.getMicroservice(microserviceId)); } } private ZeroConfigClient(ZeroCon...
@Test public void findExecutor_twoParam_schemaCfg_withoutOpDef(@Mocked Executor executor, @Mocked OperationMeta operationMeta) { String schemaName = "schemaId"; String opBeanId = "opBeanId"; ArchaiusUtils.setProperty(ExecutorManager.KEY_EXECUTORS_PREFIX + schemaName, opBeanId); new Expectations(BeanUtils.class) { { ope...
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test public void findExecutor_twoParam_defaultCfg(@Mocked Executor executor, @Mocked SchemaMeta schemaMeta, @Mocked OperationMeta operationMeta) { String beanId = "beanId"; ArchaiusUtils.setProperty(ExecutorManager.KEY_EXECUTORS_DEFAULT, beanId); new Expectations(BeanUtils.class) { { BeanUtils.getBean(beanId); result ...
public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); }
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
ExecutorManager { public Executor findExecutor(OperationMeta operationMeta) { return findExecutor(operationMeta, null); } ExecutorManager(); void registerExecutor(String id, Executor executor); Executor findExecutor(OperationMeta operationMeta); Executor findExecutor(OperationMeta operationMeta, Executor defaultOperati...
@Test(expected = IllegalArgumentException.class) public void testMyAbstractTransportException(@Mocked TransportManager manager) { MyAbstractTransport transport = new MyAbstractTransport(); transport.setListenAddressWithoutSchema(":127.0.0.1:9090"); }
protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); }
AbstractTransport implements Transport { protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); } }
AbstractTransport implements Transport { protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); } }
AbstractTransport implements Transport { protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); } @Override Endpoint getPublishEndpoint(); @Override Endpoint getEndpoint(); @Override Object parseAddress(String address); }
AbstractTransport implements Transport { protected void setListenAddressWithoutSchema(String addressWithoutSchema) { setListenAddressWithoutSchema(addressWithoutSchema, null); } @Override Endpoint getPublishEndpoint(); @Override Endpoint getEndpoint(); @Override Object parseAddress(String address); static final String...
@Test public void testGroupByName(@Mocked Transport t1, @Mocked Transport t2_1, @Mocked Transport t2_2) { new Expectations() { { t1.getName(); result = "t1"; t2_1.getName(); result = "t2"; t2_2.getName(); result = "t2"; } }; TransportManager manager = new TransportManager(); manager.addTransportsBeforeInit(Arrays.asLis...
protected Map<String, List<Transport>> groupByName() { Map<String, List<Transport>> groups = new HashMap<>(); for (Transport transport : transports) { List<Transport> list = groups.computeIfAbsent(transport.getName(), name -> new ArrayList<>()); list.add(transport); } return groups; }
TransportManager { protected Map<String, List<Transport>> groupByName() { Map<String, List<Transport>> groups = new HashMap<>(); for (Transport transport : transports) { List<Transport> list = groups.computeIfAbsent(transport.getName(), name -> new ArrayList<>()); list.add(transport); } return groups; } }
TransportManager { protected Map<String, List<Transport>> groupByName() { Map<String, List<Transport>> groups = new HashMap<>(); for (Transport transport : transports) { List<Transport> list = groups.computeIfAbsent(transport.getName(), name -> new ArrayList<>()); list.add(transport); } return groups; } }
TransportManager { protected Map<String, List<Transport>> groupByName() { Map<String, List<Transport>> groups = new HashMap<>(); for (Transport transport : transports) { List<Transport> list = groups.computeIfAbsent(transport.getName(), name -> new ArrayList<>()); list.add(transport); } return groups; } void clearTran...
TransportManager { protected Map<String, List<Transport>> groupByName() { Map<String, List<Transport>> groups = new HashMap<>(); for (Transport transport : transports) { List<Transport> list = groups.computeIfAbsent(transport.getName(), name -> new ArrayList<>()); list.add(transport); } return groups; } void clearTran...
@Test public void testCheckTransportGroupInvalid(@Mocked Transport t1, @Mocked Transport t2) { new Expectations() { { t1.getOrder(); result = 1; t2.getOrder(); result = 1; } }; TransportManager manager = new TransportManager(); List<Transport> group = Arrays.asList(t1, t2); try { manager.checkTransportGroup(group); Ass...
protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.format("%s and %s have...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
@Test public void testCheckTransportGroupValid(@Mocked Transport t1, @Mocked Transport t2) { new Expectations() { { t1.getOrder(); result = 1; t2.getOrder(); result = 2; } }; TransportManager manager = new TransportManager(); List<Transport> group = Arrays.asList(t1, t2); try { manager.checkTransportGroup(group); } cat...
protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.format("%s and %s have...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
TransportManager { protected void checkTransportGroup(List<Transport> group) { Map<Integer, Transport> orderMap = new HashMap<>(); for (Transport transport : group) { Transport existTransport = orderMap.putIfAbsent(transport.getOrder(), transport); if (existTransport != null) { throw new ServiceCombException(String.for...
@Test public void testChooseOneTransportFirst(@Mocked Transport t1, @Mocked Transport t2) { new Expectations() { { t1.getOrder(); result = 1; t1.canInit(); result = true; t2.getOrder(); result = 2; } }; TransportManager manager = new TransportManager(); List<Transport> group = Arrays.asList(t1, t2); Assert.assertEquals...
protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw new ServiceCombExcep...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
@Test public void testChooseOneTransportSecond(@Mocked Transport t1, @Mocked Transport t2) { new Expectations() { { t1.getOrder(); result = Integer.MAX_VALUE; t1.canInit(); result = true; t2.getOrder(); result = -1000; t2.canInit(); result = false; } }; TransportManager manager = new TransportManager(); List<Transport>...
protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw new ServiceCombExcep...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
@Test public void testChooseOneTransportNone(@Mocked Transport t1, @Mocked Transport t2) { new Expectations() { { t1.getName(); result = "t"; t1.getOrder(); result = 1; t1.canInit(); result = false; t2.getOrder(); result = 2; t2.canInit(); result = false; } }; TransportManager manager = new TransportManager(); List<Tra...
protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw new ServiceCombExcep...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
TransportManager { protected Transport chooseOneTransport(List<Transport> group) { group.sort(Comparator.comparingInt(Transport::getOrder)); for (Transport transport : group) { if (transport.canInit()) { LOGGER.info("choose {} for {}.", transport.getClass().getName(), transport.getName()); return transport; } } throw n...
@Test public void should_allow_not_share_filter_instance() { default_chain("simple-load-balance"); FilterChainsManager filterChains = createFilterChains(); List<Filter> aFilters = filterChains.createConsumerFilters("a"); List<Filter> bFilters = filterChains.createConsumerFilters("b"); assertThat(aFilters.get(0)).isNotS...
public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
@Test public void test_getSchema_forSelfMicroservice_shouldNotCallZeroConfigRegistryService_And_Succeed() { String returnedResult = target.getSchema(selfServiceId, schemaId1); Assert.assertEquals(schemaContent1, returnedResult); verifyZeroInteractions(zeroConfigRegistryService); }
public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k, v) -> v); } else ...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
@Test public void should_allow_share_filter_instance() { default_chain("simple-retry"); FilterChainsManager filterChains = createFilterChains(); List<Filter> aFilters = filterChains.createConsumerFilters("a"); List<Filter> bFilters = filterChains.createConsumerFilters("b"); assertThat(aFilters).hasSameElementsAs(bFilte...
public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
@Test public void should_allow_mix_share_and_not_share_filter_instance() { default_chain("simple-load-balance, simple-retry"); FilterChainsManager filterChains = createFilterChains(); List<Filter> aFilters = filterChains.createConsumerFilters("a"); List<Filter> bFilters = filterChains.createConsumerFilters("b"); assert...
public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
@Test public void microservice_scope_should_override_default_scope() { default_chain("simple-load-balance"); microservice_chain("a", "simple-retry"); FilterChainsManager filterChains = createFilterChains(); List<Filter> filters = filterChains.createConsumerFilters("a"); assertThat(filters.get(0)).isInstanceOf(SimpleRet...
public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } }
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
FilterChainsManager { public List<Filter> createConsumerFilters(String microservice) { return createFilters(consumerChainsConfig, microservice); } @Autowired FilterChainsManager setTransportFiltersConfig(TransportFiltersConfig transportFiltersConfig); @Value("${servicecomb.filter-chains.enabled:false}") FilterChainsMa...
@Test public void should_invoke_next_directly_when_invocation_already_has_endpoint() throws ExecutionException, InterruptedException { Response response = Response.ok("ok"); new Expectations() { { invocation.getEndpoint(); result = endpoint; nextNode.onFilter(invocation); result = CompletableFuture.completedFuture(resp...
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { if (invocation.getEndpoint() != null) { return nextNode.onFilter(invocation); } invocation.setEndpoint(selectEndpoint(invocation)); return nextNode.onFilter(invocation); }
SimpleLoadBalanceFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { if (invocation.getEndpoint() != null) { return nextNode.onFilter(invocation); } invocation.setEndpoint(selectEndpoint(invocation)); return nextNode.onFilter(invocation); } }
SimpleLoadBalanceFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { if (invocation.getEndpoint() != null) { return nextNode.onFilter(invocation); } invocation.setEndpoint(selectEndpoint(invocation)); return nextNode.onFilter(invocation); } Simp...
SimpleLoadBalanceFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { if (invocation.getEndpoint() != null) { return nextNode.onFilter(invocation); } invocation.setEndpoint(selectEndpoint(invocation)); return nextNode.onFilter(invocation); } Simp...
SimpleLoadBalanceFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { if (invocation.getEndpoint() != null) { return nextNode.onFilter(invocation); } invocation.setEndpoint(selectEndpoint(invocation)); return nextNode.onFilter(invocation); } Simp...
@Test public void should_record_invocation_trace_time() throws NoSuchMethodException { setInvokeSyncMethod(); filter.onFilter(invocation, FilterNode.EMPTY); new Verifications() { { invocation.onBusinessMethodStart(); times = 1; invocation.onBusinessMethodFinish(); times = 1; invocation.onBusinessFinish(); times = 1; } ...
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_provide_thread_local_invocation_context_for_sync_method() throws NoSuchMethodException { setInvokeSyncMethod(); filter.onFilter(invocation, FilterNode.EMPTY); assertThat(threadInvocationContext).isSameAs(invocation); }
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_clear_thread_local_invocation_context_after_sync_method() throws NoSuchMethodException { setInvokeSyncMethod(); filter.onFilter(invocation, FilterNode.EMPTY); assertThat(ContextUtils.getInvocationContext()).isNull(); }
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_catch_sync_business_exception() throws NoSuchMethodException { setInvokeMethod("syncException"); CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY); assertThat(future).hasFailedWithThrowableThat() .isInstanceOf(RuntimeExceptionWithoutStackTrace.class) .hasMessage...
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_provide_thread_local_invocation_context_for_async_method() throws NoSuchMethodException { setInvokeAsyncMethod(); filter.onFilter(invocation, FilterNode.EMPTY); assertThat(threadInvocationContext).isSameAs(invocation); }
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_clear_thread_local_invocation_context_after_async_method() throws NoSuchMethodException { setInvokeAsyncMethod(); filter.onFilter(invocation, FilterNode.EMPTY); assertThat(ContextUtils.getInvocationContext()).isNull(); }
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void test_getSchema_forOtherMicroservice_shouldReturnNull() { String returnedResult = target.getSchema(otherServiceId, schemaId1); Assert.assertNull(returnedResult); }
public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k, v) -> v); } else ...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
ZeroConfigClient { public String getSchema(String microserviceId, String schemaId) { LOGGER.info("Retrieve schema content for Microservice ID: {}, Schema ID: {}", microserviceId, schemaId); if (selfMicroservice.getServiceId().equals(microserviceId)) { return selfMicroservice.getSchemaMap().computeIfPresent(schemaId, (k...
@Test public void init() { new Expectations(SCBEngine.class) { { SCBEngine.getInstance().getProducerMicroserviceMeta(); result = microserviceMeta; } }; Map<String, Executor> beanExecutors = new HashMap<>(); beanExecutors.put("executor", executor); beanExecutors.put("groupExecutor", groupExecutor); beanExecutors.put("th...
@Override public void init(GlobalRegistry globalRegistry, EventBus eventBus, MetricsBootstrapConfig config) { registry = globalRegistry.getDefaultRegistry(); createThreadPoolMeters(); }
ThreadPoolMetersInitializer implements MetricsInitializer { @Override public void init(GlobalRegistry globalRegistry, EventBus eventBus, MetricsBootstrapConfig config) { registry = globalRegistry.getDefaultRegistry(); createThreadPoolMeters(); } }
ThreadPoolMetersInitializer implements MetricsInitializer { @Override public void init(GlobalRegistry globalRegistry, EventBus eventBus, MetricsBootstrapConfig config) { registry = globalRegistry.getDefaultRegistry(); createThreadPoolMeters(); } }
ThreadPoolMetersInitializer implements MetricsInitializer { @Override public void init(GlobalRegistry globalRegistry, EventBus eventBus, MetricsBootstrapConfig config) { registry = globalRegistry.getDefaultRegistry(); createThreadPoolMeters(); } @Override void init(GlobalRegistry globalRegistry, EventBus eventBus, Met...
ThreadPoolMetersInitializer implements MetricsInitializer { @Override public void init(GlobalRegistry globalRegistry, EventBus eventBus, MetricsBootstrapConfig config) { registry = globalRegistry.getDefaultRegistry(); createThreadPoolMeters(); } @Override void init(GlobalRegistry globalRegistry, EventBus eventBus, Met...
@Test public void should_catch_async_business_exception() throws NoSuchMethodException { setInvokeMethod("asyncException"); CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY); assertThat(future).hasFailedWithThrowableThat() .isInstanceOf(RuntimeExceptionWithoutStackTrace.class) .hasMessa...
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_unify_IllegalArgumentException_message_when_convert_exception() throws NoSuchMethodException { setInvokeSyncMethod(); new Expectations() { { invocation.toProducerArguments(); result = new Object[] {1}; } }; CompletableFuture<Response> future = filter.onFilter(invocation, FilterNode.EMPTY); asse...
@Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperation.getProducerInstance(); Method method = pro...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
ProducerOperationFilter implements Filter { @Override public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) { invocation.onBusinessMethodStart(); SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation(); Object instance = producerOperatio...
@Test public void should_send_exception_response_when_failed_to_create_invocation() { RuntimeException exception = new RuntimeExceptionWithoutStackTrace(); TestFlow flow = new TestFlow(() -> { throw exception; }); flow.run(); assertThat(sendException).isSameAs(exception); }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void should_start_invocation_when_succeed_to_create_invocation() { mockFilterChain(); TestFlow flow = new TestFlow(() -> invocation); flow.run(); new Verifications() { { invocation.onStart((HttpServletRequestEx) any, anyLong); times = 1; } }; }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void should_send_response_when_invocation_success() { mockFilterChain(); TestFlow flow = new TestFlow(() -> invocation); flow.run(); assertThat(sendInvocation).isSameAs(invocation); }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void should_finish_invocation_when_invocation_success() { mockFilterChain(); TestFlow flow = new TestFlow(() -> invocation); flow.run(); new Verifications() { { invocation.onFinish((Response) any); times = 1; } }; }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void should_send_response_when_invocation_fail() { mockInvocationFailed(); TestFlow flow = new TestFlow(() -> invocation); flow.run(); assertThat(sendInvocation).isSameAs(invocation); }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void should_finish_invocation_when_invocation_fail() { mockInvocationFailed(); TestFlow flow = new TestFlow(() -> invocation); flow.run(); new Verifications() { { invocation.onFinish((Response) any); times = 1; } }; }
public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } }
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
ProducerInvocationFlow { public void run() { CompletableFuture.completedFuture(null) .thenApply(v -> invocationCreator.create()) .exceptionally(this::sendCreateInvocationException) .thenAccept(this::tryRunInvocation); } ProducerInvocationFlow(InvocationCreator invocationCreator); ProducerInvocationFlow(InvocationCreat...
@Test public void allowedNoProvider() { new ProducerProviderManager(null).init(); }
public void init() { registerProducerMetas(producerMetas); for (ProducerProvider provider : producerProviderList) { List<ProducerMeta> producerMetas = provider.init(); if (producerMetas == null) { LOGGER.warn("ProducerProvider {} not provide any producer.", provider.getClass().getName()); continue; } registerProducerMe...
ProducerProviderManager { public void init() { registerProducerMetas(producerMetas); for (ProducerProvider provider : producerProviderList) { List<ProducerMeta> producerMetas = provider.init(); if (producerMetas == null) { LOGGER.warn("ProducerProvider {} not provide any producer.", provider.getClass().getName()); cont...
ProducerProviderManager { public void init() { registerProducerMetas(producerMetas); for (ProducerProvider provider : producerProviderList) { List<ProducerMeta> producerMetas = provider.init(); if (producerMetas == null) { LOGGER.warn("ProducerProvider {} not provide any producer.", provider.getClass().getName()); cont...
ProducerProviderManager { public void init() { registerProducerMetas(producerMetas); for (ProducerProvider provider : producerProviderList) { List<ProducerMeta> producerMetas = provider.init(); if (producerMetas == null) { LOGGER.warn("ProducerProvider {} not provide any producer.", provider.getClass().getName()); cont...
ProducerProviderManager { public void init() { registerProducerMetas(producerMetas); for (ProducerProvider provider : producerProviderList) { List<ProducerMeta> producerMetas = provider.init(); if (producerMetas == null) { LOGGER.warn("ProducerProvider {} not provide any producer.", provider.getClass().getName()); cont...
@Test public void getOrder() { Assert.assertEquals(Short.MAX_VALUE, filter.getOrder()); }
@Override public int getOrder() { return Short.MAX_VALUE; }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override public int getOrder() { return Short.MAX_VALUE; } }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override public int getOrder() { return Short.MAX_VALUE; } }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override public int getOrder() { return Short.MAX_VALUE; } @Override int getOrder(); }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override public int getOrder() { return Short.MAX_VALUE; } @Override int getOrder(); }
@Test public void test_findMicroserviceInstance_forNonExistInstance_shouldReturnNull() { when(zeroConfigRegistryService.findServiceInstance(selfServiceId, selfInstanceId)) .thenReturn(null); MicroserviceInstance returnedResult = target .findMicroserviceInstance(selfServiceId, selfInstanceId); Assert.assertNull(returned...
public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Microservice Instance f...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
@Test public void getTransportName() { new Expectations() { { invocation.getConfigTransportName(); result = Const.RESTFUL; } }; Assert.assertEquals(Const.RESTFUL, filter.findTransportName(context, null)); }
@Override protected String findTransportName(DiscoveryContext context, DiscoveryTreeNode parent) { Invocation invocation = context.getInputParameters(); return invocation.getConfigTransportName(); }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected String findTransportName(DiscoveryContext context, DiscoveryTreeNode parent) { Invocation invocation = context.getInputParameters(); return invocation.getConfigTransportName(); } }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected String findTransportName(DiscoveryContext context, DiscoveryTreeNode parent) { Invocation invocation = context.getInputParameters(); return invocation.getConfigTransportName(); } }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected String findTransportName(DiscoveryContext context, DiscoveryTreeNode parent) { Invocation invocation = context.getInputParameters(); return invocation.getConfigTransportName(); } @Override int getOrder(); }
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected String findTransportName(DiscoveryContext context, DiscoveryTreeNode parent) { Invocation invocation = context.getInputParameters(); return invocation.getConfigTransportName(); } @Override int getOrder(); }
@Test public void createEndpointNullTransport() { Assert.assertNull(filter.createEndpoint(Const.RESTFUL, "", null)); }
@Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not deployed transport {}, ignore {}.", transportName, endpoint); retu...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
@Test public void createEndpointNormal(@Mocked Transport transport, @Mocked MicroserviceInstance instance) { String endpoint = "rest: Object address = new Object(); new Expectations(scbEngine.getTransportManager()) { { scbEngine.getTransportManager().findTransport(Const.RESTFUL); result = transport; transport.parseAddr...
@Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not deployed transport {}, ignore {}.", transportName, endpoint); retu...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
EndpointDiscoveryFilter extends AbstractEndpointDiscoveryFilter { @Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = SCBEngine.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { LOGGER.info("not ...
@Test public void testEndpoint(@Mocked Transport transport) { new Expectations() { { transport.parseAddress("rest: result = "rest: } }; Endpoint endpoint = new Endpoint(transport, "rest: Assert.assertEquals(endpoint.getAddress(), "rest: Assert.assertEquals(endpoint.getEndpoint(), "rest: Assert.assertEquals(endpoint.get...
public Endpoint(Transport transport, String endpoint) { this(transport, endpoint, null); }
Endpoint { public Endpoint(Transport transport, String endpoint) { this(transport, endpoint, null); } }
Endpoint { public Endpoint(Transport transport, String endpoint) { this(transport, endpoint, null); } Endpoint(Transport transport, String endpoint); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance, Object addr...
Endpoint { public Endpoint(Transport transport, String endpoint) { this(transport, endpoint, null); } Endpoint(Transport transport, String endpoint); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance, Object addr...
Endpoint { public Endpoint(Transport transport, String endpoint) { this(transport, endpoint, null); } Endpoint(Transport transport, String endpoint); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance); Endpoint(Transport transport, String endpoint, MicroserviceInstance instance, Object addr...
@Test public void generateStringId() { TraceIdGenerator traceIdGenerator = new BraveTraceIdGenerator(); assertNotEquals(traceIdGenerator.generate(), traceIdGenerator.generate()); String traceId = traceIdGenerator.generate(); try { Long.parseLong(traceId, 16); } catch (NumberFormatException e) { fail("wrong traceId form...
@Override public String generate() { return Long.toHexString(Platform.get().nextTraceIdHigh()); }
BraveTraceIdGenerator implements TraceIdGenerator { @Override public String generate() { return Long.toHexString(Platform.get().nextTraceIdHigh()); } }
BraveTraceIdGenerator implements TraceIdGenerator { @Override public String generate() { return Long.toHexString(Platform.get().nextTraceIdHigh()); } }
BraveTraceIdGenerator implements TraceIdGenerator { @Override public String generate() { return Long.toHexString(Platform.get().nextTraceIdHigh()); } @Override String getTraceIdKeyName(); @Override String generate(); }
BraveTraceIdGenerator implements TraceIdGenerator { @Override public String generate() { return Long.toHexString(Platform.get().nextTraceIdHigh()); } @Override String getTraceIdKeyName(); @Override String generate(); }
@Test public void onStart() { mockNonaTime(); Holder<Invocation> result = new Holder<>(); Object subscriber = new Object() { @Subscribe public void onStart(InvocationStartEvent event) { result.value = event.getInvocation(); } }; EventManager.register(subscriber); Invocation invocation = new Invocation(endpoint, operati...
public void onStart(long start) { invocationStageTrace.start(start); initTraceId(); EventManager.post(new InvocationStartEvent(this)); }
Invocation extends SwaggerInvocation { public void onStart(long start) { invocationStageTrace.start(start); initTraceId(); EventManager.post(new InvocationStartEvent(this)); } }
Invocation extends SwaggerInvocation { public void onStart(long start) { invocationStageTrace.start(start); initTraceId(); EventManager.post(new InvocationStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, ...
Invocation extends SwaggerInvocation { public void onStart(long start) { invocationStageTrace.start(start); initTraceId(); EventManager.post(new InvocationStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, ...
Invocation extends SwaggerInvocation { public void onStart(long start) { invocationStageTrace.start(start); initTraceId(); EventManager.post(new InvocationStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, ...
@Test public void onFinish() { mockNonaTime(); Holder<InvocationFinishEvent> result = new Holder<>(); Object subscriber = new Object() { @Subscribe public void onStart(InvocationFinishEvent event) { result.value = event; } }; EventManager.register(subscriber); Invocation invocation = new Invocation(endpoint, operationM...
public void onFinish(Response response) { if (finished) { return; } invocationStageTrace.finish(); EventManager.post(new InvocationFinishEvent(this, response)); finished = true; }
Invocation extends SwaggerInvocation { public void onFinish(Response response) { if (finished) { return; } invocationStageTrace.finish(); EventManager.post(new InvocationFinishEvent(this, response)); finished = true; } }
Invocation extends SwaggerInvocation { public void onFinish(Response response) { if (finished) { return; } invocationStageTrace.finish(); EventManager.post(new InvocationFinishEvent(this, response)); finished = true; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, Invocat...
Invocation extends SwaggerInvocation { public void onFinish(Response response) { if (finished) { return; } invocationStageTrace.finish(); EventManager.post(new InvocationFinishEvent(this, response)); finished = true; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, Invocat...
Invocation extends SwaggerInvocation { public void onFinish(Response response) { if (finished) { return; } invocationStageTrace.finish(); EventManager.post(new InvocationFinishEvent(this, response)); finished = true; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, Invocat...
@Test public void isConsumer_yes() { Invocation invocation = new Invocation(endpoint, operationMeta, arguments); Assert.assertFalse(invocation.isConsumer()); }
public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); }
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } }
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
@Test public void isConsumer_no(@Mocked ReferenceConfig referenceConfig) { Invocation invocation = new Invocation(referenceConfig, operationMeta, invocationRuntimeType, arguments); Assert.assertTrue(invocation.isConsumer()); }
public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); }
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } }
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
Invocation extends SwaggerInvocation { public boolean isConsumer() { return InvocationType.CONSUMER.equals(invocationType); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocatio...
@Test public void localContext(@Mocked ReferenceConfig referenceConfig) { Invocation invocation = new Invocation(referenceConfig, operationMeta, invocationRuntimeType, arguments); invocation.addLocalContext("k", 1); Assert.assertSame(invocation.getHandlerContext(), invocation.getLocalContext()); Assert.assertEquals(1, ...
public Map<String, Object> getHandlerContext() { return handlerContext; }
Invocation extends SwaggerInvocation { public Map<String, Object> getHandlerContext() { return handlerContext; } }
Invocation extends SwaggerInvocation { public Map<String, Object> getHandlerContext() { return handlerContext; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(Endpoint en...
Invocation extends SwaggerInvocation { public Map<String, Object> getHandlerContext() { return handlerContext; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(Endpoint en...
Invocation extends SwaggerInvocation { public Map<String, Object> getHandlerContext() { return handlerContext; } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(Endpoint en...
@Test public void test_findMicroServiceInstance_forExistInstance_shouldReturnInstance() { when(zeroConfigRegistryService.findServiceInstance(otherServiceId, selfInstanceId)) .thenReturn(prepareServerServiceInstance(true)); MicroserviceInstance returnedResult = target .findMicroserviceInstance(otherServiceId, selfInstan...
public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Microservice Instance f...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
ZeroConfigClient { public MicroserviceInstance findMicroserviceInstance(String serviceId, String instanceId) { ServerMicroserviceInstance instance = this.zeroConfigRegistryService .findServiceInstance(serviceId, instanceId); if (instance == null) { LOGGER.error( "Invalid serviceId OR instanceId! Failed to retrieve Micr...
@Test public void traceIdGeneratorInit(@Mocked TraceIdGenerator gen1, @Mocked TraceIdGenerator gen2, @Mocked TraceIdGenerator gen3, @Mocked TraceIdGenerator gen4) { new Expectations(SPIServiceUtils.class) { { gen1.getName(); result = "zipkin"; gen3.getName(); result = "apm"; gen2.getName(); result = "zipkin"; gen4.getN...
static Collection<TraceIdGenerator> loadTraceIdGenerators() { return SPIServiceUtils.getPriorityHighestServices(TraceIdGenerator::getName, TraceIdGenerator.class); }
Invocation extends SwaggerInvocation { static Collection<TraceIdGenerator> loadTraceIdGenerators() { return SPIServiceUtils.getPriorityHighestServices(TraceIdGenerator::getName, TraceIdGenerator.class); } }
Invocation extends SwaggerInvocation { static Collection<TraceIdGenerator> loadTraceIdGenerators() { return SPIServiceUtils.getPriorityHighestServices(TraceIdGenerator::getName, TraceIdGenerator.class); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType...
Invocation extends SwaggerInvocation { static Collection<TraceIdGenerator> loadTraceIdGenerators() { return SPIServiceUtils.getPriorityHighestServices(TraceIdGenerator::getName, TraceIdGenerator.class); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType...
Invocation extends SwaggerInvocation { static Collection<TraceIdGenerator> loadTraceIdGenerators() { return SPIServiceUtils.getPriorityHighestServices(TraceIdGenerator::getName, TraceIdGenerator.class); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType...
@Test public void onBusinessMethodStart() { Object listener = new Object() { @Subscribe public void onBusinessMethodStart(InvocationBusinessMethodStartEvent event) { invocationBaseEvent = event; } }; EventManager.getEventBus().register(listener); Invocation invocation = new Invocation(endpoint, operationMeta, arguments...
@Override public void onBusinessMethodStart() { invocationStageTrace.startBusinessMethod(); EventManager.post(new InvocationBusinessMethodStartEvent(this)); }
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodStart() { invocationStageTrace.startBusinessMethod(); EventManager.post(new InvocationBusinessMethodStartEvent(this)); } }
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodStart() { invocationStageTrace.startBusinessMethod(); EventManager.post(new InvocationBusinessMethodStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invoca...
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodStart() { invocationStageTrace.startBusinessMethod(); EventManager.post(new InvocationBusinessMethodStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invoca...
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodStart() { invocationStageTrace.startBusinessMethod(); EventManager.post(new InvocationBusinessMethodStartEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invoca...
@Test public void onBusinessMethodFinish() { Object listener = new Object() { @Subscribe public void onBusinessMethodStart(InvocationBusinessMethodFinishEvent event) { invocationBaseEvent = event; } }; EventManager.getEventBus().register(listener); Invocation invocation = new Invocation(endpoint, operationMeta, argumen...
@Override public void onBusinessMethodFinish() { EventManager.post(new InvocationBusinessMethodFinishEvent(this)); }
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodFinish() { EventManager.post(new InvocationBusinessMethodFinishEvent(this)); } }
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodFinish() { EventManager.post(new InvocationBusinessMethodFinishEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object>...
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodFinish() { EventManager.post(new InvocationBusinessMethodFinishEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object>...
Invocation extends SwaggerInvocation { @Override public void onBusinessMethodFinish() { EventManager.post(new InvocationBusinessMethodFinishEvent(this)); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object>...
@Test public void onBusinessFinish() { Invocation invocation = new Invocation(endpoint, operationMeta, arguments); mockNonaTime(); invocation.onBusinessFinish(); Assert.assertEquals(nanoTime, invocation.getInvocationStageTrace().getFinishBusiness()); }
@Override public void onBusinessFinish() { invocationStageTrace.finishBusiness(); }
Invocation extends SwaggerInvocation { @Override public void onBusinessFinish() { invocationStageTrace.finishBusiness(); } }
Invocation extends SwaggerInvocation { @Override public void onBusinessFinish() { invocationStageTrace.finishBusiness(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(E...
Invocation extends SwaggerInvocation { @Override public void onBusinessFinish() { invocationStageTrace.finishBusiness(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(E...
Invocation extends SwaggerInvocation { @Override public void onBusinessFinish() { invocationStageTrace.finishBusiness(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocation(E...
@Test public void isThirdPartyInvocation(@Mocked ReferenceConfig referenceConfig) { Invocation invocation = new Invocation(referenceConfig, operationMeta, invocationRuntimeType, arguments); Assert.assertFalse(invocation.isThirdPartyInvocation()); new Expectations() { { referenceConfig.is3rdPartyService(); result = true...
public boolean isThirdPartyInvocation() { return referenceConfig.is3rdPartyService(); }
Invocation extends SwaggerInvocation { public boolean isThirdPartyInvocation() { return referenceConfig.is3rdPartyService(); } }
Invocation extends SwaggerInvocation { public boolean isThirdPartyInvocation() { return referenceConfig.is3rdPartyService(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocati...
Invocation extends SwaggerInvocation { public boolean isThirdPartyInvocation() { return referenceConfig.is3rdPartyService(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocati...
Invocation extends SwaggerInvocation { public boolean isThirdPartyInvocation() { return referenceConfig.is3rdPartyService(); } Invocation(); Invocation(ReferenceConfig referenceConfig, OperationMeta operationMeta, InvocationRuntimeType invocationRuntimeType, Map<String, Object> swaggerArguments); Invocati...
@Test public void test() throws Exception { when(invocation.getTransport()).thenReturn(transport); when(invocation.getEndpoint()).thenReturn(endpoint); transportClientHandler.handle(invocation, asyncResp); verify(transport).send(invocation, asyncResp); }
@Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Transport transport = invocation.getTransport(); log.debug( "Sending request {} to {}", invocation.getMicroserviceQualifiedName(), invocation.getEndpoint().getEndpoint()); transport.send(invocation, asyncResp); }
TransportClientHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Transport transport = invocation.getTransport(); log.debug( "Sending request {} to {}", invocation.getMicroserviceQualifiedName(), invocation.getEndpoint().getEndpoint()); transpor...
TransportClientHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Transport transport = invocation.getTransport(); log.debug( "Sending request {} to {}", invocation.getMicroserviceQualifiedName(), invocation.getEndpoint().getEndpoint()); transpor...
TransportClientHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Transport transport = invocation.getTransport(); log.debug( "Sending request {} to {}", invocation.getMicroserviceQualifiedName(), invocation.getEndpoint().getEndpoint()); transpor...
TransportClientHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { Transport transport = invocation.getTransport(); log.debug( "Sending request {} to {}", invocation.getMicroserviceQualifiedName(), invocation.getEndpoint().getEndpoint()); transpor...
@Test public void processException_normal(@Mocked SwaggerInvocation invocation) { Error error = new Error("abc"); Response response = handler.processException(invocation, error); Assert.assertSame(Status.OK, response.getStatus()); Assert.assertEquals("response from error: abc", response.getResult()); }
protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } @Override void ha...
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } @Override void ha...
@Test public void processException_InvocationTargetException(@Mocked SwaggerInvocation invocation) { Error error = new Error("abc"); InvocationTargetException targetException = new InvocationTargetException(error); Response response = handler.processException(invocation, error); Assert.assertSame(Status.OK, response.ge...
protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } }
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } @Override void ha...
ProducerOperationHandler implements Handler { protected Response processException(SwaggerInvocation invocation, Throwable e) { if (e instanceof InvocationTargetException) { e = ((InvocationTargetException) e).getTargetException(); } return ExceptionFactory.convertExceptionToResponse(invocation, e); } @Override void ha...
@Test public void handle_emptyEndPoint() throws Exception { handler.handle(invocation, ar); Throwable result = response.getResult(); Assert.assertEquals( "InvocationException: code=490;msg=CommonExceptionData [message=Unexpected consumer error, please check logs for details]", result.getMessage()); Assert.assertEquals(...
@Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); VersionedCache endpointsVersionedCache = discoveryTree....
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
@Test public void handle(@Mocked Transport transport) throws Exception { MicroserviceInstance instance = new MicroserviceInstance(); instance.setInstanceId("id"); instance.getEndpoints().add("rest: instance.getEndpoints().add("highway: instanceVersionedCache.data(Collections.singletonMap("id", instance)).autoCacheVersi...
@Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); VersionedCache endpointsVersionedCache = discoveryTree....
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
SimpleLoadBalanceHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResp) throws Exception { if (invocation.getEndpoint() != null) { invocation.next(asyncResp); return; } DiscoveryContext context = new DiscoveryContext(); context.setInputParameters(invocation); Versioned...
@Test public void test_findServiceInstances_forNonExistInstance_shouldReturnEmptyResult() { List<ServerMicroserviceInstance> serverMicroserviceInstancesList = new ArrayList<>(); when(zeroConfigRegistryService.findServiceInstances(selfServiceId, selfInstanceId)) .thenReturn(serverMicroserviceInstancesList); Microservice...
public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances resultMicroserviceIn...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
@Test public void onApplicationEvent_close(@Mocked ContextClosedEvent contextClosedEvent) { SCBEngine scbEngine = SCBBootstrap.createSCBEngineForTest(); scbEngine.setStatus(SCBStatus.UP); CseApplicationListener listener = new CseApplicationListener(); listener.onApplicationEvent(contextClosedEvent); Assert.assertEquals...
@Override public void onApplicationEvent(ApplicationEvent event) { if (initEventClass.isInstance(event)) { if (applicationContext instanceof AbstractApplicationContext) { ((AbstractApplicationContext) applicationContext).registerShutdownHook(); } SCBEngine scbEngine = SCBEngine.getInstance(); scbEngine.setApplicationCo...
CseApplicationListener implements ApplicationListener<ApplicationEvent>, Ordered, ApplicationContextAware { @Override public void onApplicationEvent(ApplicationEvent event) { if (initEventClass.isInstance(event)) { if (applicationContext instanceof AbstractApplicationContext) { ((AbstractApplicationContext) application...
CseApplicationListener implements ApplicationListener<ApplicationEvent>, Ordered, ApplicationContextAware { @Override public void onApplicationEvent(ApplicationEvent event) { if (initEventClass.isInstance(event)) { if (applicationContext instanceof AbstractApplicationContext) { ((AbstractApplicationContext) application...
CseApplicationListener implements ApplicationListener<ApplicationEvent>, Ordered, ApplicationContextAware { @Override public void onApplicationEvent(ApplicationEvent event) { if (initEventClass.isInstance(event)) { if (applicationContext instanceof AbstractApplicationContext) { ((AbstractApplicationContext) application...
CseApplicationListener implements ApplicationListener<ApplicationEvent>, Ordered, ApplicationContextAware { @Override public void onApplicationEvent(ApplicationEvent event) { if (initEventClass.isInstance(event)) { if (applicationContext instanceof AbstractApplicationContext) { ((AbstractApplicationContext) application...
@Test public void construct(@Mocked Invocation invocation, @Mocked Response response) { InvocationStageTrace stageTrace = new InvocationStageTrace(invocation); long time = 123; new MockUp<System>() { @Mock long nanoTime() { return time; } }; new Expectations() { { invocation.getInvocationStageTrace(); result = stageTra...
public long getNanoCurrent() { return nanoCurrent; }
InvocationFinishEvent extends InvocationWithResponseEvent { public long getNanoCurrent() { return nanoCurrent; } }
InvocationFinishEvent extends InvocationWithResponseEvent { public long getNanoCurrent() { return nanoCurrent; } InvocationFinishEvent(Invocation invocation, Response response); }
InvocationFinishEvent extends InvocationWithResponseEvent { public long getNanoCurrent() { return nanoCurrent; } InvocationFinishEvent(Invocation invocation, Response response); long getNanoCurrent(); }
InvocationFinishEvent extends InvocationWithResponseEvent { public long getNanoCurrent() { return nanoCurrent; } InvocationFinishEvent(Invocation invocation, Response response); long getNanoCurrent(); }
@Test public void createProperty() { Property property = multipartFilePropertyCreator.createProperty(); Assert.assertThat(property, Matchers.instanceOf(FileProperty.class)); }
@Override public Property createProperty() { return new FileProperty(); }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } @Override Property createProperty(); @Override Class<?>[] classes(); }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } @Override Property createProperty(); @Override Class<?>[] classes(); }
@Test public void classes() { Class<?>[] classes = multipartFilePropertyCreator.classes(); Assert.assertThat(classes, Matchers.arrayContaining(MultipartFile.class)); }
@Override public Class<?>[] classes() { return classes; }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } @Override Property createProperty(); @Override Class<?>[] classes(); }
MultipartFilePropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } @Override Property createProperty(); @Override Class<?>[] classes(); }
@Test public void getProcessType() { Assert.assertEquals(requestPartAnnotationProcessor.getProcessType(), RequestPart.class); }
@Override public Type getProcessType() { return RequestPart.class; }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public Type getProcessType() { return RequestPart.class; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public Type getProcessType() { return RequestPart.class; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public Type getProcessType() { return RequestPart.class; } @Override Type getProcessType(); @Override String getParameterName(RequestPart annotation); @Override HttpParameterType getHttpPa...
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public Type getProcessType() { return RequestPart.class; } @Override Type getProcessType(); @Override String getParameterName(RequestPart annotation); @Override HttpParameterType getHttpPa...
@Test public void getParameterName_fromValue() { Parameter[] parameters = producerMethod.getParameters(); Parameter stringParam = parameters[0]; RequestPart stringParamAnnotation = stringParam.getAnnotation(RequestPart.class); Assert.assertThat(requestPartAnnotationProcessor.getParameterName(stringParamAnnotation), Mat...
@Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } @Override Type getProcessTyp...
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } @Override Type getProcessTyp...
@Test public void getParameterName_fromName() { Parameter[] parameters = producerMethod.getParameters(); Parameter intParam = parameters[1]; RequestPart intParamAnnotation = intParam.getAnnotation(RequestPart.class); Assert.assertThat(requestPartAnnotationProcessor.getParameterName(intParamAnnotation), Matchers.is("int...
@Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } @Override Type getProcessTyp...
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public String getParameterName(RequestPart annotation) { String value = annotation.value(); if (value.isEmpty()) { value = annotation.name(); } return value; } @Override Type getProcessTyp...
@Test public void getHttpParameterType() { Assert.assertThat(requestPartAnnotationProcessor.getHttpParameterType(null), Matchers.is(HttpParameterType.FORM)); }
@Override public HttpParameterType getHttpParameterType(RequestPart parameterAnnotation) { return HttpParameterType.FORM; }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public HttpParameterType getHttpParameterType(RequestPart parameterAnnotation) { return HttpParameterType.FORM; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public HttpParameterType getHttpParameterType(RequestPart parameterAnnotation) { return HttpParameterType.FORM; } }
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public HttpParameterType getHttpParameterType(RequestPart parameterAnnotation) { return HttpParameterType.FORM; } @Override Type getProcessType(); @Override String getParameterName(Request...
RequestPartAnnotationProcessor extends AbstractSpringmvcSerializableParameterProcessor<FormParameter, RequestPart> { @Override public HttpParameterType getHttpParameterType(RequestPart parameterAnnotation) { return HttpParameterType.FORM; } @Override Type getProcessType(); @Override String getParameterName(Request...
@Test public void testGetClassMethods() throws Exception { List<Method> methods = MethodUtils.findSwaggerMethods(Hello2Endpoint.class); Assert.assertEquals(3, methods.size()); Assert.assertEquals(Hello2Endpoint.class, methods.get(0).getDeclaringClass()); Assert.assertEquals(Hello2Endpoint.class, methods.get(1).getDecla...
public static List<Method> findSwaggerMethods(Class<?> cls) { Method[] methods = cls.getMethods(); List<Method> result = new ArrayList<>(methods.length); for (Method m : methods) { if (!isSkipMethod(cls, m)) { result.add(m); } } result.sort(Comparator.comparing(MethodUtils::findSwaggerMethodName)); return result; }
MethodUtils { public static List<Method> findSwaggerMethods(Class<?> cls) { Method[] methods = cls.getMethods(); List<Method> result = new ArrayList<>(methods.length); for (Method m : methods) { if (!isSkipMethod(cls, m)) { result.add(m); } } result.sort(Comparator.comparing(MethodUtils::findSwaggerMethodName)); return...
MethodUtils { public static List<Method> findSwaggerMethods(Class<?> cls) { Method[] methods = cls.getMethods(); List<Method> result = new ArrayList<>(methods.length); for (Method m : methods) { if (!isSkipMethod(cls, m)) { result.add(m); } } result.sort(Comparator.comparing(MethodUtils::findSwaggerMethodName)); return...
MethodUtils { public static List<Method> findSwaggerMethods(Class<?> cls) { Method[] methods = cls.getMethods(); List<Method> result = new ArrayList<>(methods.length); for (Method m : methods) { if (!isSkipMethod(cls, m)) { result.add(m); } } result.sort(Comparator.comparing(MethodUtils::findSwaggerMethodName)); return...
MethodUtils { public static List<Method> findSwaggerMethods(Class<?> cls) { Method[] methods = cls.getMethods(); List<Method> result = new ArrayList<>(methods.length); for (Method m : methods) { if (!isSkipMethod(cls, m)) { result.add(m); } } result.sort(Comparator.comparing(MethodUtils::findSwaggerMethodName)); return...
@Test public void testConvertTags() { SwaggerOperation swaggerOperation = swaggerOperations.findOperation("function"); assertThat(swaggerOperation.getOperation().getTags(), containsInAnyOrder("tag1", "tag2")); }
private void convertTags(String[] tags, Operation operation) { if (tags == null || tags.length == 0) { return; } for (String tag : tags) { if (StringUtils.isEmpty(tag)) { continue; } operation.addTag(tag); } }
ApiOperationProcessor implements MethodAnnotationProcessor<ApiOperation> { private void convertTags(String[] tags, Operation operation) { if (tags == null || tags.length == 0) { return; } for (String tag : tags) { if (StringUtils.isEmpty(tag)) { continue; } operation.addTag(tag); } } }
ApiOperationProcessor implements MethodAnnotationProcessor<ApiOperation> { private void convertTags(String[] tags, Operation operation) { if (tags == null || tags.length == 0) { return; } for (String tag : tags) { if (StringUtils.isEmpty(tag)) { continue; } operation.addTag(tag); } } }
ApiOperationProcessor implements MethodAnnotationProcessor<ApiOperation> { private void convertTags(String[] tags, Operation operation) { if (tags == null || tags.length == 0) { return; } for (String tag : tags) { if (StringUtils.isEmpty(tag)) { continue; } operation.addTag(tag); } } Type getProcessType(); @Override v...
ApiOperationProcessor implements MethodAnnotationProcessor<ApiOperation> { private void convertTags(String[] tags, Operation operation) { if (tags == null || tags.length == 0) { return; } for (String tag : tags) { if (StringUtils.isEmpty(tag)) { continue; } operation.addTag(tag); } } Type getProcessType(); @Override v...
@Test public void test_findServiceInstances_forExistInstance_shouldReturnInstances() { List<ServerMicroserviceInstance> serverMicroserviceInstancesList = new ArrayList<>(); serverMicroserviceInstancesList.add(prepareServerServiceInstance(true)); when(zeroConfigRegistryService.findServiceInstances(appId, serviceName)) ....
public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances resultMicroserviceIn...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
ZeroConfigClient { public MicroserviceInstances findServiceInstances(String appId, String providerServiceName, String strVersionRule) { LOGGER.info( "Find service instance for App ID: {}, Provider ServiceName: {}, versionRule: {} in Zero-Config mode", appId, providerServiceName, strVersionRule); MicroserviceInstances r...
@Test public void testProcess() { Swagger swagger = SwaggerGenerator.generate(SwaggerTestTarget.class); assertEquals(1, swagger.getTags().size()); io.swagger.models.Tag tag = swagger.getTags().get(0); assertEquals("testTag", tag.getName()); assertEquals("desc", tag.getDescription()); assertEquals("testValue", tag.getEx...
@Override public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) { Swagger swagger = swaggerGenerator.getSwagger(); if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) { swaggerGenerator.setBasePath(definitionAnnotation.basePath()); } if (StringUtils.isNotEmpty(definitio...
SwaggerDefinitionProcessor implements ClassAnnotationProcessor<SwaggerDefinition> { @Override public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) { Swagger swagger = swaggerGenerator.getSwagger(); if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) { swaggerGenerator....
SwaggerDefinitionProcessor implements ClassAnnotationProcessor<SwaggerDefinition> { @Override public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) { Swagger swagger = swaggerGenerator.getSwagger(); if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) { swaggerGenerator....
SwaggerDefinitionProcessor implements ClassAnnotationProcessor<SwaggerDefinition> { @Override public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) { Swagger swagger = swaggerGenerator.getSwagger(); if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) { swaggerGenerator....
SwaggerDefinitionProcessor implements ClassAnnotationProcessor<SwaggerDefinition> { @Override public void process(SwaggerGenerator swaggerGenerator, SwaggerDefinition definitionAnnotation) { Swagger swagger = swaggerGenerator.getSwagger(); if (StringUtils.isNotEmpty(definitionAnnotation.basePath())) { swaggerGenerator....
@Test public void process() { SwaggerOperations swaggerOperations = SwaggerOperations.generate(SwaggerTestTarget.class); SwaggerOperation swaggerOperation = swaggerOperations.findOperation("op"); assertThat(swaggerOperation.getOperation().getTags(), contains("tag1", "tag2")); assertThat(swaggerOperation.getSwagger().ge...
@Override public void process(SwaggerGenerator swaggerGenerator, Api api) { setTags(swaggerGenerator, api); SwaggerUtils.setCommaConsumes(swaggerGenerator.getSwagger(), api.consumes()); SwaggerUtils.setCommaProduces(swaggerGenerator.getSwagger(), api.produces()); }
ApiProcessor implements ClassAnnotationProcessor<Api> { @Override public void process(SwaggerGenerator swaggerGenerator, Api api) { setTags(swaggerGenerator, api); SwaggerUtils.setCommaConsumes(swaggerGenerator.getSwagger(), api.consumes()); SwaggerUtils.setCommaProduces(swaggerGenerator.getSwagger(), api.produces()); ...
ApiProcessor implements ClassAnnotationProcessor<Api> { @Override public void process(SwaggerGenerator swaggerGenerator, Api api) { setTags(swaggerGenerator, api); SwaggerUtils.setCommaConsumes(swaggerGenerator.getSwagger(), api.consumes()); SwaggerUtils.setCommaProduces(swaggerGenerator.getSwagger(), api.produces()); ...
ApiProcessor implements ClassAnnotationProcessor<Api> { @Override public void process(SwaggerGenerator swaggerGenerator, Api api) { setTags(swaggerGenerator, api); SwaggerUtils.setCommaConsumes(swaggerGenerator.getSwagger(), api.consumes()); SwaggerUtils.setCommaProduces(swaggerGenerator.getSwagger(), api.produces()); ...
ApiProcessor implements ClassAnnotationProcessor<Api> { @Override public void process(SwaggerGenerator swaggerGenerator, Api api) { setTags(swaggerGenerator, api); SwaggerUtils.setCommaConsumes(swaggerGenerator.getSwagger(), api.consumes()); SwaggerUtils.setCommaProduces(swaggerGenerator.getSwagger(), api.produces()); ...
@SuppressWarnings("unchecked") @Test public void classes() { Assert.assertThat(creator.classes(), Matchers.arrayContaining(Part.class)); }
@Override public Class<?>[] classes() { return classes; }
PartPropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } }
PartPropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } }
PartPropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } @Override Property createProperty(); @Override Class<?>[] classes(); }
PartPropertyCreator implements PropertyCreator { @Override public Class<?>[] classes() { return classes; } @Override Property createProperty(); @Override Class<?>[] classes(); }
@Test public void createProperty() { Assert.assertThat(creator.createProperty(), Matchers.instanceOf(FileProperty.class)); }
@Override public Property createProperty() { return new FileProperty(); }
PartPropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } }
PartPropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } }
PartPropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } @Override Property createProperty(); @Override Class<?>[] classes(); }
PartPropertyCreator implements PropertyCreator { @Override public Property createProperty() { return new FileProperty(); } @Override Property createProperty(); @Override Class<?>[] classes(); }
@Test public void setType() { JavaType type = TypeFactory.defaultInstance().constructCollectionType(List.class, String.class); resolver.setType(type, vendorExtensions); Assert.assertEquals("java.util.List<java.lang.String>", vendorExtensions.get(SwaggerConst.EXT_JAVA_CLASS)); }
@VisibleForTesting protected void setType(JavaType type, Map<String, Object> vendorExtensions) { if (SwaggerGeneratorFeature.isLocalExtJavaClassInVendor()) { vendorExtensions.put(SwaggerConst.EXT_JAVA_CLASS, type.toCanonical()); } }
ModelResolverExt extends ModelResolver { @VisibleForTesting protected void setType(JavaType type, Map<String, Object> vendorExtensions) { if (SwaggerGeneratorFeature.isLocalExtJavaClassInVendor()) { vendorExtensions.put(SwaggerConst.EXT_JAVA_CLASS, type.toCanonical()); } } }
ModelResolverExt extends ModelResolver { @VisibleForTesting protected void setType(JavaType type, Map<String, Object> vendorExtensions) { if (SwaggerGeneratorFeature.isLocalExtJavaClassInVendor()) { vendorExtensions.put(SwaggerConst.EXT_JAVA_CLASS, type.toCanonical()); } } ModelResolverExt(); }
ModelResolverExt extends ModelResolver { @VisibleForTesting protected void setType(JavaType type, Map<String, Object> vendorExtensions) { if (SwaggerGeneratorFeature.isLocalExtJavaClassInVendor()) { vendorExtensions.put(SwaggerConst.EXT_JAVA_CLASS, type.toCanonical()); } } ModelResolverExt(); @Override Model resolve(Ja...
ModelResolverExt extends ModelResolver { @VisibleForTesting protected void setType(JavaType type, Map<String, Object> vendorExtensions) { if (SwaggerGeneratorFeature.isLocalExtJavaClassInVendor()) { vendorExtensions.put(SwaggerConst.EXT_JAVA_CLASS, type.toCanonical()); } } ModelResolverExt(); @Override Model resolve(Ja...
@Test public void findEnumValue() { JsonPropertyIntrospector introspector = new JsonPropertyIntrospector(); assertEquals("AB", introspector.findEnumValue(TestEnum.AB)); assertEquals("C-D", introspector.findEnumValue(TestEnum.C_D)); assertEquals("E.F", introspector.findEnumValue(TestEnum.E_F)); assertEquals("HI", intros...
@SuppressWarnings("deprecation") @Override public String findEnumValue(Enum<?> value) { try { JsonProperty annotation = value.getClass().getField(value.name()).getAnnotation(JsonProperty.class); if (null == annotation || StringUtils.isEmpty(annotation.value())) { return super.findEnumValue(value); } return annotation.v...
JsonPropertyIntrospector extends SwaggerAnnotationIntrospector { @SuppressWarnings("deprecation") @Override public String findEnumValue(Enum<?> value) { try { JsonProperty annotation = value.getClass().getField(value.name()).getAnnotation(JsonProperty.class); if (null == annotation || StringUtils.isEmpty(annotation.val...
JsonPropertyIntrospector extends SwaggerAnnotationIntrospector { @SuppressWarnings("deprecation") @Override public String findEnumValue(Enum<?> value) { try { JsonProperty annotation = value.getClass().getField(value.name()).getAnnotation(JsonProperty.class); if (null == annotation || StringUtils.isEmpty(annotation.val...
JsonPropertyIntrospector extends SwaggerAnnotationIntrospector { @SuppressWarnings("deprecation") @Override public String findEnumValue(Enum<?> value) { try { JsonProperty annotation = value.getClass().getField(value.name()).getAnnotation(JsonProperty.class); if (null == annotation || StringUtils.isEmpty(annotation.val...
JsonPropertyIntrospector extends SwaggerAnnotationIntrospector { @SuppressWarnings("deprecation") @Override public String findEnumValue(Enum<?> value) { try { JsonProperty annotation = value.getClass().getField(value.name()).getAnnotation(JsonProperty.class); if (null == annotation || StringUtils.isEmpty(annotation.val...
@Test public void swaggerToStringException(@Mocked Swagger swagger) { new Expectations() { { swagger.getBasePath(); result = new RuntimeExceptionWithoutStackTrace(); } }; expectedException.expect(ServiceCombException.class); expectedException.expectMessage("Convert swagger to string failed, "); SwaggerUtils.swaggerToSt...
public static String swaggerToString(Swagger swagger) { try { return Yaml.mapper().writeValueAsString(swagger); } catch (Throwable e) { throw new ServiceCombException("Convert swagger to string failed, ", e); } }
SwaggerUtils { public static String swaggerToString(Swagger swagger) { try { return Yaml.mapper().writeValueAsString(swagger); } catch (Throwable e) { throw new ServiceCombException("Convert swagger to string failed, ", e); } } }
SwaggerUtils { public static String swaggerToString(Swagger swagger) { try { return Yaml.mapper().writeValueAsString(swagger); } catch (Throwable e) { throw new ServiceCombException("Convert swagger to string failed, ", e); } } private SwaggerUtils(); }
SwaggerUtils { public static String swaggerToString(Swagger swagger) { try { return Yaml.mapper().writeValueAsString(swagger); } catch (Throwable e) { throw new ServiceCombException("Convert swagger to string failed, ", e); } } private SwaggerUtils(); static String swaggerToString(Swagger swagger); static Swagger pars...
SwaggerUtils { public static String swaggerToString(Swagger swagger) { try { return Yaml.mapper().writeValueAsString(swagger); } catch (Throwable e) { throw new ServiceCombException("Convert swagger to string failed, ", e); } } private SwaggerUtils(); static String swaggerToString(Swagger swagger); static Swagger pars...
@Test public void parseSwaggerUrlNormal(@Mocked URL url) throws IOException { String content = "swagger: \"2.0\""; new Expectations(IOUtils.class) { { IOUtils.toString(url, StandardCharsets.UTF_8); result = content; } }; Swagger swagger = Yaml.mapper().readValue(content, Swagger.class); Swagger result = SwaggerUtils.pa...
public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
@Test public void parseSwaggerUrlException(@Mocked URL url) throws IOException { new Expectations(IOUtils.class) { { IOUtils.toString(url, StandardCharsets.UTF_8); result = new RuntimeExceptionWithoutStackTrace("failed"); } }; expectedException.expect(ServiceCombException.class); expectedException.expectMessage("Parse ...
public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
@Test public void parseSwaggerContentException() throws IOException { expectedException.expect(ServiceCombException.class); expectedException.expectMessage("Parse swagger from content failed, "); SwaggerUtils.parseSwagger(""); }
public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); }
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
SwaggerUtils { public static Swagger parseSwagger(URL url) { try { String swaggerContent = IOUtils.toString(url, StandardCharsets.UTF_8); return internalParseSwagger(swaggerContent); } catch (Throwable e) { throw new ServiceCombException("Parse swagger from url failed, url=" + url, e); } } private SwaggerUtils(); stat...
@Test(expected = IllegalArgumentException.class) public void test_registerMicroserviceInstance_whenServiceIdIsNull_shouldThrowIllegalArgumentException() { target.registerMicroserviceInstance(prepareServerServiceInstance(false, instanceId)); }
public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == null || instanceId == null) { ...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
@Test public void correctResponsesOperationFixEmptyDescription() { Response response = new Response(); Operation operation = new Operation(); operation.addResponse("200", response); SwaggerUtils.correctResponses(operation); Assert.assertEquals("response of 200", response.getDescription()); }
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void correctResponsesOperationNotChangeExistDescription() { Response response = new Response(); response.setDescription("description"); Operation operation = new Operation(); operation.addResponse("200", response); SwaggerUtils.correctResponses(operation); Assert.assertEquals("description", response.getDes...
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void correctResponsesOperationDefaultTo200() { Response response = new Response(); Operation operation = new Operation(); operation.addResponse("default", response); SwaggerUtils.correctResponses(operation); Assert.assertSame(response, operation.getResponses().get("200")); }
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void correctResponsesOperation2xxTo200() { Response response = new Response(); Operation operation = new Operation(); operation.addResponse("default", new Response()); operation.addResponse("201", response); operation.addResponse("301", new Response()); SwaggerUtils.correctResponses(operation); Assert.asse...
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void correctResponsesNoPaths() { Swagger swagger = new Swagger(); SwaggerUtils.correctResponses(swagger); }
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void correctResponsesHavePaths() { Response response = new Response(); Operation operation = new Operation(); operation.addResponse("200", response); Path path = new Path(); path.set("get", operation); Swagger swagger = new Swagger(); swagger.path("/base", path); SwaggerUtils.correctResponses(swagger); Ass...
public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (StringUtils.isEm...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
SwaggerUtils { public static void correctResponses(Operation operation) { int okCode = Status.OK.getStatusCode(); String strOkCode = String.valueOf(okCode); Response okResponse = null; for (Entry<String, Response> responseEntry : operation.getResponses().entrySet()) { Response response = responseEntry.getValue(); if (S...
@Test public void should_use_swagger_type_when_model_type_is_available() { Model model = swagger.getDefinitions().get("User"); assertThat(SwaggerUtils.getClassName(model.getVendorExtensions())).isEqualTo(User.class.getName()); assertThat(ConverterMgr.findJavaType(swagger, model).getRawClass()).isEqualTo(User.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_use_Object_when_model_type_is_not_available() { Model model = swagger.getDefinitions().get("testEnumBody"); assertThat(SwaggerUtils.getClassName(model.getVendorExtensions())).isEqualTo("gen.cse.ms.ut.testEnumBody"); assertThat(ConverterMgr.findJavaType(swagger, model).getRawClass()).isEqualTo(O...
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_use_Object_when_model_not_declare_type() { Model model = swagger.getDefinitions().get("testFloatBody"); assertThat(SwaggerUtils.getClassName(model.getVendorExtensions())).isNull(); assertThat(ConverterMgr.findJavaType(swagger, model).getRawClass()).isEqualTo(Object.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_ref_model() { Operation operation = swagger.getPath("/nestedListString").getPost(); Model model = ((BodyParameter) operation.getParameters().get(0)).getSchema(); assertThat(ConverterMgr.findJavaType(swagger, model).getRawClass()).isEqualTo(Object.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void test_registerMicroserviceInstance_whenInstanceNotExist_shouldRegisterSuccessfully() { ServerUtil.microserviceInstanceMap = prepareEmptyServiceInstanceMap(); target.registerMicroserviceInstance(prepareServerServiceInstance(true, instanceId)); Assert.assertTrue(ServerUtil.microserviceInstanceMap.contain...
public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == null || instanceId == null) { ...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
ZeroConfigRegistryService { public void registerMicroserviceInstance(ServerMicroserviceInstance receivedInstance) { String instanceId = receivedInstance.getInstanceId(); String serviceId = receivedInstance.getServiceId(); String serviceName = receivedInstance.getServiceName(); if (serviceId == null || serviceName == nu...
@Test public void should_support_array_model() { Operation operation = swagger.getPath("/nestedListString").getPost(); Model model = operation.getResponses().get("200").getResponseSchema(); assertThat(SwaggerUtils.getClassName(model.getVendorExtensions())).isNull(); assertThat(ConverterMgr.findJavaType(swagger, model)....
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_boolean_property() { Model model = swagger.getDefinitions().get("AllType"); Property property = model.getProperties().get("bValue"); assertThat(ConverterMgr.findJavaType(swagger, property).getRawClass()).isEqualTo(Boolean.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_int8_property() { Model model = swagger.getDefinitions().get("AllType"); Property property = model.getProperties().get("byteValue"); assertThat(ConverterMgr.findJavaType(swagger, property).getRawClass()).isEqualTo(Integer.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_int16_property() { Model model = swagger.getDefinitions().get("AllType"); Property property = model.getProperties().get("sValue"); assertThat(ConverterMgr.findJavaType(swagger, property).getRawClass()).isEqualTo(Integer.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_int32_property() { Model model = swagger.getDefinitions().get("AllType"); Property property = model.getProperties().get("iValue"); assertThat(ConverterMgr.findJavaType(swagger, property).getRawClass()).isEqualTo(Integer.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
@Test public void should_support_int64_property() { Model model = swagger.getDefinitions().get("AllType"); Property property = model.getProperties().get("lValue"); assertThat(ConverterMgr.findJavaType(swagger, property).getRawClass()).isEqualTo(Long.class); }
public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }
ConverterMgr { public static JavaType findJavaType(String type, String format) { String key = genTypeFormatKey(type, format); return TYPE_FORMAT_MAP.get(key); } private ConverterMgr(); static JavaType findJavaType(String type, String format); static JavaType findJavaType(Swagger swagger, Object def); }