diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java index 703d3cfbac..c305a1a85e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/hateoas/HypermediaAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package org.springframework.boot.autoconfigure.hateoas; +import java.util.Optional; + import org.junit.After; import org.junit.Test; @@ -69,8 +71,9 @@ public class HypermediaAutoConfigurationTests { this.context.refresh(); LinkDiscoverers discoverers = this.context.getBean(LinkDiscoverers.class); assertThat(discoverers).isNotNull(); - LinkDiscoverer discoverer = discoverers.getLinkDiscovererFor(MediaTypes.HAL_JSON); - assertThat(discoverer).isInstanceOf(HalLinkDiscoverer.class); + Optional discoverer = discoverers + .getLinkDiscovererFor(MediaTypes.HAL_JSON); + assertThat(discoverer).containsInstanceOf(HalLinkDiscoverer.class); } @Test