예제 #1
0
 @Test
 public void testGetSkinFile_FileFound() throws Exception {
   subAppResourcesNetworkServicePluginRoot.start();
   catchException(subAppResourcesNetworkServicePluginRoot)
       .getSkinFile(skinId.randomUUID(), "walletPublicKey");
   assertThat(caughtException()).isNull();
 }
예제 #2
0
  @Before
  public void setUp() throws Exception {
    subAppResourcesNetworkServicePluginRoot = new SubAppResourcesNetworkServicePluginRoot();
    subAppResourcesNetworkServicePluginRoot.setPluginFileSystem(pluginFileSystem);
    subAppResourcesNetworkServicePluginRoot.setEventManager(mockEventManager);
    subAppResourcesNetworkServicePluginRoot.setErrorManager(errorManager);
    subAppResourcesNetworkServicePluginRoot.setPluginDatabaseSystem(mockPluginDatabaseSystem);

    when(mockPluginDatabaseSystem.openDatabase(any(UUID.class), anyString()))
        .thenReturn(mockDatabase);
    when(gitHubConnection.getFile(anyString())).thenReturn(repoManifest);
    when(pluginFileSystem.createTextFile(
            any(UUID.class),
            anyString(),
            anyString(),
            any(FilePrivacy.class),
            any(FileLifeSpan.class)))
        .thenReturn(layoutFile);
    when(pluginFileSystem.createBinaryFile(
            any(UUID.class),
            anyString(),
            anyString(),
            any(FilePrivacy.class),
            any(FileLifeSpan.class)))
        .thenReturn(imageFile);

    when(mockEventManager.getNewListener(EventType.BEGUN_WALLET_INSTALLATION))
        .thenReturn(mockFermatEventListener);
    when(pluginFileSystem.getTextFile(
            any(UUID.class),
            anyString(),
            anyString(),
            any(FilePrivacy.class),
            any(FileLifeSpan.class)))
        .thenReturn(mockPluginTextFile);
    setUpDataBase();
  }
예제 #3
0
 @Test
 public void getClassTest() throws CantStartPluginException {
   pluginRoot = new SubAppResourcesNetworkServicePluginRoot();
   assertThat(pluginRoot.getClassesFullPath()).isInstanceOf(List.class);
 }
예제 #4
0
 @Test
 public void testGetSkinFile_FileNotFound() throws Exception {
   subAppResourcesNetworkServicePluginRoot.start();
   catchException(subAppResourcesNetworkServicePluginRoot).getSkinFile(null, null);
   assertThat(caughtException()).isNotNull();
 }