package com.atlassian.bitbucket.mesh.partition;

import com.atlassian.bitbucket.mesh.junit.LogListener;
import com.atlassian.bitbucket.mesh.platform.DefaultOperatingSystemService;
import io.grpc.Status;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.*;

public class InvalidPartitionNameExceptionTest {

    @Rule
    public final LogListener logListener = new LogListener(DefaultOperatingSystemService.class);

    @Test
    public void testExpectedMessage() throws Exception {
        InvalidPartitionNameException ex = new InvalidPartitionNameException("001");

        assertEquals("The provided partition name is not valid: 001", ex.getMessage());
    }

    @Test
    public void testExpectedStatus() throws Exception {
        InvalidPartitionNameException ex = new InvalidPartitionNameException("001");

        assertEquals(Status.INVALID_ARGUMENT, ex.getStatus());
    }
}
