@@ -0,0 +1,1958 @@
+/*-%0A * -%5C-%5C-%0A * Spotify Styx Service Common%0A * --%0A * Copyright (C) 2016 - 2019 Spotify AB%0A * --%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %0A *      http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * -/-/-%0A */%0A%0Apackage com.spotify.styx.storage;%0A%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport com.google.cloud.datastore.DatastoreException;%0Aimport org.junit.Test;%0A%0Apublic class TransactionExceptionTest %7B%0A%0A  @Test%0A  public void isConflict() %7B%0A    assertThat(transactionException(10, %22%22, %22%22).isConflict(), is(true));%0A    assertThat(transactionException(1, %22%22, %22ABORTED%22).isConflict(), is(true));%0A    assertThat(transactionException(1, %22%22, %22%22).isConflict(), is(false));%0A  %7D%0A%0A  @Test%0A  public void isAlreadyExists() %7B%0A    assertThat(transactionException(1, %22%22, %22ALREADY_EXISTS%22).isAlreadyExists(), is(true));%0A    assertThat(transactionException(1, %22entity already exists%22, %22%22).isAlreadyExists(), is(true));%0A    assertThat(transactionException(1, %22%22, %22%22).isAlreadyExists(), is(false));%0A  %7D%0A%0A  @Test%0A  public void isNotFound() %7B%0A    assertThat(transactionException(1, %22%22, %22NOT_FOUND%22).isNotFound(), is(true));%0A    assertThat(transactionException(1, %22no entity to update%22, %22%22).isNotFound(), is(true));%0A    assertThat(transactionException(1, %22%22, %22%22).isNotFound(), is(false));%0A  %7D%0A%0A  private TransactionException transactionException(int code, String message, String reason) %7B%0A    return new TransactionException(new DatastoreException(code, message, reason));%0A  %7D%0A%7D

add test