@Test
public void getServicesShouldReturnOnlyMatchingServicesWhenLabelsAreAppliedToTheClient() {

	mockServer.expect().get().withPath("/api/v1/namespaces/test/services?labelSelector=label%3Dvalue")
			.andReturn(200, new ServiceListBuilder().addNewItem().withNewMetadata().withName("s1")
					.withLabels(new HashMap<String, String>() {
						{
							put("label", "value");
						}
					}).endMetadata().endItem().addNewItem().withNewMetadata().withName("s2")
					.withLabels(new HashMap<String, String>() {
						{
							put("label", "value");
							put("label2", "value2");
						}
					}).endMetadata().endItem().build())
			.once();
	final KubernetesDiscoveryProperties properties = new KubernetesDiscoveryProperties();
	final DiscoveryClient discoveryClient = new KubernetesDiscoveryClient(mockClient, properties,
			client -> client.services().withLabels(new HashMap<String, String>() {
				{
					put("label", "value");
				}
			}), new DefaultIsServicePortSecureResolver(properties));
	final List<String> services = discoveryClient.getServices();
	assertThat(services).containsOnly("s1", "s2");
}