001/*
002 * acme4j - Java ACME client
003 *
004 * Copyright (C) 2015 Richard "Shred" Körber
005 *   http://acme4j.shredzone.org
006 *
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
013 */
014package org.shredzone.acme4j.connector;
015
016import static org.assertj.core.api.Assertions.assertThat;
017
018import org.assertj.core.api.SoftAssertions;
019import org.junit.jupiter.api.Test;
020
021/**
022 * Unit test for {@link Resource}.
023 */
024public class ResourceTest {
025
026    /**
027     * Test {@link Resource#path()}.
028     */
029    @Test
030    public void testPath() {
031        SoftAssertions.assertSoftly(softly -> {
032            softly.assertThat(Resource.NEW_NONCE.path()).isEqualTo("newNonce");
033            softly.assertThat(Resource.NEW_ACCOUNT.path()).isEqualTo("newAccount");
034            softly.assertThat(Resource.NEW_ORDER.path()).isEqualTo("newOrder");
035            softly.assertThat(Resource.NEW_AUTHZ.path()).isEqualTo("newAuthz");
036            softly.assertThat(Resource.REVOKE_CERT.path()).isEqualTo("revokeCert");
037            softly.assertThat(Resource.KEY_CHANGE.path()).isEqualTo("keyChange");
038            softly.assertThat(Resource.RENEWAL_INFO.path()).isEqualTo("renewalInfo");
039        });
040
041        // fails if there are untested future Resource values
042        assertThat(Resource.values()).hasSize(7);
043    }
044
045}