PolarisRouterContext buildRouterContext(HttpHeaders headers) {
		Collection<String> labelHeaderValues = headers.get(RouterConstant.ROUTER_LABEL_HEADER);
		if (CollectionUtils.isEmpty(labelHeaderValues)) {
			labelHeaderValues = new ArrayList<>();
		}
		PolarisRouterContext routerContext = new PolarisRouterContext();

		Map<String, String> labelHeaderValuesMap = new HashMap<>();
		try {
			Optional<String> labelHeaderValuesOptional = labelHeaderValues.stream().findFirst();
			if (labelHeaderValuesOptional.isPresent()) {
				String labelHeaderValuesContent = labelHeaderValuesOptional.get();
				labelHeaderValuesMap.putAll(
						JacksonUtils.deserialize2Map(URLDecoder.decode(labelHeaderValuesContent, UTF_8)));
			}
		}
		catch (UnsupportedEncodingException e) {
			throw new RuntimeException("unsupported charset exception " + UTF_8);
		}
		routerContext.putLabels(RouterConstant.ROUTER_LABELS, labelHeaderValuesMap);
		return routerContext;
	}
@Test
	public void buildRouterContext() {
		PolarisRouterServiceInstanceListSupplier polarisSupplier = new PolarisRouterServiceInstanceListSupplier(
				delegate, routerAPI, requestInterceptors, null, new PolarisInstanceTransformer());

		HttpHeaders headers = new HttpHeaders();
		PolarisRouterContext context = polarisSupplier.buildRouterContext(headers);
		assertThat(context).isNotNull();

		// mock
		try (MockedStatic<ApplicationContextAwareUtils> mockedApplicationContextAwareUtils = Mockito.mockStatic(ApplicationContextAwareUtils.class)) {
			mockedApplicationContextAwareUtils.when(() -> ApplicationContextAwareUtils.getProperties(anyString()))
					.thenReturn("mock-value");
			MetadataContextHolder.set(new MetadataContext());

			headers = new HttpHeaders();
			headers.add(RouterConstant.ROUTER_LABEL_HEADER, "{\"k1\":\"v1\"}");
			PolarisRouterContext routerContext = polarisSupplier.buildRouterContext(headers);
			assertThat(routerContext.getLabel("k1")).isEqualTo("v1");
		}
	}