// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintEncryptionResult.java
// public class FingerprintEncryptionResult extends FingerprintAuthenticationResult {
// 
//     private final String encrypted;
// 
//     /**
//      * Default constructor
//      *
//      * @param result    result of the operation
//      * @param message   message to be displayed to the user
//      * @param encrypted encrypted data
//      */
//     public FingerprintEncryptionResult(FingerprintResult result, String message, String encrypted) {
//         super(result, message);
//         this.encrypted = encrypted;
//     }
// 
//     /**
//      * @return encrypted data, can only be accessed if the result was of
//      * type {@link FingerprintResult#AUTHENTICATED}
//      */
//     public String getEncrypted() {
//         if (!isSuccess()) {
//             throw new IllegalAccessError("Fingerprint authentication was not successful, cannot access encryption result");
//         }
//         return encrypted;
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintUnavailableException.java
// public class FingerprintUnavailableException extends Exception {
// 
// 	public FingerprintUnavailableException(String s) {
// 		super(s);
// 	}
// }


import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import com.mtramin.rxfingerprint.data.FingerprintEncryptionResult;
import com.mtramin.rxfingerprint.data.FingerprintUnavailableException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import javax.crypto.Cipher;
import io.reactivex.Observable;
/*
 * Copyright 2017 Marvin Ramin.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <http://www.apache.org/licenses/LICENSE-2.0>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mtramin.rxfingerprint;






@RunWith(PowerMockRunner.class)
@PrepareForTest(Cipher.class)
public class RsaEncryptionObservableTest {

	private static final String INPUT = "TEST";

	@Mock FingerprintApiWrapper fingerprintApiWrapper;
	@Mock RsaCipherProvider cipherProvider;
	Cipher cipher;

// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintEncryptionResult.java
// public class FingerprintEncryptionResult extends FingerprintAuthenticationResult {
// 
//     private final String encrypted;
// 
//     /**
//      * Default constructor
//      *
//      * @param result    result of the operation
//      * @param message   message to be displayed to the user
//      * @param encrypted encrypted data
//      */
//     public FingerprintEncryptionResult(FingerprintResult result, String message, String encrypted) {
//         super(result, message);
//         this.encrypted = encrypted;
//     }
// 
//     /**
//      * @return encrypted data, can only be accessed if the result was of
//      * type {@link FingerprintResult#AUTHENTICATED}
//      */
//     public String getEncrypted() {
//         if (!isSuccess()) {
//             throw new IllegalAccessError("Fingerprint authentication was not successful, cannot access encryption result");
//         }
//         return encrypted;
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintUnavailableException.java
// public class FingerprintUnavailableException extends Exception {
// 
// 	public FingerprintUnavailableException(String s) {
// 		super(s);
// 	}
// }


// Path: rxfingerprint/src/test/java/com/mtramin/rxfingerprint/RsaEncryptionObservableTest.java
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mock;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import com.mtramin.rxfingerprint.data.FingerprintEncryptionResult;
import com.mtramin.rxfingerprint.data.FingerprintUnavailableException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import javax.crypto.Cipher;
import io.reactivex.Observable;

/*
 * Copyright 2017 Marvin Ramin.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * <http://www.apache.org/licenses/LICENSE-2.0>
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.mtramin.rxfingerprint;






@RunWith(PowerMockRunner.class)
@PrepareForTest(Cipher.class)
public class RsaEncryptionObservableTest {

	private static final String INPUT = "TEST";

	@Mock FingerprintApiWrapper fingerprintApiWrapper;
	@Mock RsaCipherProvider cipherProvider;
	Cipher cipher;

	private Observable<FingerprintEncryptionResult> observable;