forked from fanruan/finekit
Dylan.Liu
4 years ago
6 changed files with 80 additions and 8 deletions
@ -0,0 +1,24 @@
|
||||
package com.fanruan.api.cluster.state; |
||||
|
||||
import com.fr.collections.api.FineCollectionClient; |
||||
import com.fr.collections.api.FineCollectionClientWrapper; |
||||
import org.junit.Test; |
||||
|
||||
import static org.easymock.EasyMock.*; |
||||
import static org.junit.Assert.*; |
||||
|
||||
/** |
||||
* @author Dylan.Liu |
||||
* @version 10.0 |
||||
* Created by Dylan.Liu on 2020/10/23 |
||||
*/ |
||||
public class FineCollectionsKitTest { |
||||
|
||||
@Test |
||||
public void testGetClient() throws Exception { |
||||
// test
|
||||
FineCollectionClient client = FineCollectionsKit.getClient(); |
||||
|
||||
assertTrue(client instanceof FineCollectionClientWrapper); |
||||
} |
||||
} |
@ -0,0 +1,39 @@
|
||||
package com.fanruan.api.cluster.state; |
||||
|
||||
import com.fr.ftp.client.FineSFTPClient; |
||||
import com.fr.store.impl.accessor.FineStorePool; |
||||
import org.junit.Test; |
||||
import org.junit.runner.RunWith; |
||||
import org.powermock.api.easymock.PowerMock; |
||||
import org.powermock.core.classloader.annotations.PrepareForTest; |
||||
import org.powermock.modules.junit4.PowerMockRunner; |
||||
|
||||
import static org.easymock.EasyMock.*; |
||||
import static org.junit.Assert.*; |
||||
|
||||
/** |
||||
* @author Dylan.Liu |
||||
* @version 10.0 |
||||
* Created by Dylan.Liu on 2020/10/23 |
||||
*/ |
||||
@RunWith(PowerMockRunner.class) |
||||
@PrepareForTest({FineStorePool.class}) |
||||
public class StoreTemplateKitTest { |
||||
|
||||
@Test |
||||
public void testClose() throws Exception { |
||||
// test
|
||||
FineStorePool fineStorePool = mock(FineStorePool.class); |
||||
fineStorePool.close(); |
||||
expectLastCall().times(1); |
||||
|
||||
PowerMock.mockStaticPartial(FineStorePool.class, "getPool"); |
||||
expect(FineStorePool.getPool()).andReturn(fineStorePool).times(1); |
||||
|
||||
PowerMock.replayAll(); |
||||
|
||||
StoreTemplateKit.close(); |
||||
|
||||
PowerMock.verifyAll(); |
||||
} |
||||
} |
Loading…
Reference in new issue