diff options
Diffstat (limited to 'controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java')
-rw-r--r-- | controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java index 37b138527fe..f0c11c0ddbd 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/ContactInformationMaintainerTest.java @@ -6,8 +6,8 @@ import com.yahoo.vespa.hosted.controller.ControllerTester; import com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId; import com.yahoo.vespa.hosted.controller.api.integration.organization.Contact; import com.yahoo.vespa.hosted.controller.tenant.AthenzTenant; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.net.URI; import java.time.Duration; @@ -16,8 +16,8 @@ import java.util.List; import java.util.Optional; import java.util.function.Supplier; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; /** * @author mpolden @@ -27,30 +27,32 @@ public class ContactInformationMaintainerTest { private ControllerTester tester; private ContactInformationMaintainer maintainer; - @Before + @BeforeEach public void before() { tester = new ControllerTester(); maintainer = new ContactInformationMaintainer(tester.controller(), Duration.ofDays(1)); } @Test - public void updates_contact_information() { + void updates_contact_information() { PropertyId propertyId1 = new PropertyId("1"); PropertyId propertyId2 = new PropertyId("2"); TenantName name1 = tester.createTenant("tenant1", "domain1", 1L); TenantName name2 = tester.createTenant("zenant1", "domain2", 2L); Supplier<AthenzTenant> tenant1 = () -> (AthenzTenant) tester.controller().tenants().require(name1); Supplier<AthenzTenant> tenant2 = () -> (AthenzTenant) tester.controller().tenants().require(name2); - assertFalse("No contact information initially", tenant1.get().contact().isPresent()); - assertFalse("No contact information initially", tenant2.get().contact().isPresent()); + assertFalse(tenant1.get().contact().isPresent(), "No contact information initially"); + assertFalse(tenant2.get().contact().isPresent(), "No contact information initially"); Contact contact = testContact(); - tester.serviceRegistry().contactRetriever().addContact(propertyId1, () -> { throw new RuntimeException("ERROR"); }); + tester.serviceRegistry().contactRetriever().addContact(propertyId1, () -> { + throw new RuntimeException("ERROR"); + }); tester.serviceRegistry().contactRetriever().addContact(propertyId2, () -> contact); maintainer.maintain(); - assertEquals("No contact information added due to error", Optional.empty(), tenant1.get().contact()); - assertEquals("Contact information added", Optional.of(contact), tenant2.get().contact()); + assertEquals(Optional.empty(), tenant1.get().contact(), "No contact information added due to error"); + assertEquals(Optional.of(contact), tenant2.get().contact(), "Contact information added"); } private static Contact testContact() { |