Ejemplo n.º 1
0
  @Test
  public void testCreateArtifact() throws OseeCoreException {
    when(txData.isCommitInProgress()).thenReturn(false);
    when(txData.getTxState()).thenReturn(TxState.NEW_TX);
    when(artifactFactory.createArtifact(session, branch, DirectSoftwareRequirement, guid))
        .thenReturn(artifact1);
    when(proxyManager.asExternalArtifact(session, artifact1)).thenReturn(readable1);

    ArtifactData data = Mockito.mock(ArtifactData.class);
    when(artifact1.getOrcsData()).thenReturn(data);
    when(data.isUseBackingData()).thenReturn(false);

    ArtifactReadable actual =
        txDataManager.createArtifact(
            txData, DirectSoftwareRequirement, "Direct SW requirement", guid);

    verify(artifactFactory).createArtifact(session, branch, DirectSoftwareRequirement, guid);
    assertEquals(readable1, actual);
  }