// Path: src/main/java/com/github/sqrlserverjava/backchannel/SqrlTifResponse.java
// public static class SqrlTifResponseBuilder {
// 	private final Set<SqrlTifFlag> tifFlagList = new HashSet<>();
// 	private int builderTifInt;
// 
// 	public SqrlTifResponseBuilder(final boolean ipsMatched) {
// 		if (ipsMatched) {
// 			addFlag(SqrlTifFlag.IPS_MATCHED);
// 		}
// 	}
// 
// 	public SqrlTifResponseBuilder() {
// 	}
// 
// 	public SqrlTifResponseBuilder addFlag(final SqrlTifFlag tifFlag) {
// 		builderTifInt |= tifFlag.getMask();
// 		tifFlagList.add(tifFlag);
// 		return this;
// 	}
// 
// 	/**
// 	 * Removes all flags that are set
// 	 */
// 	public SqrlTifResponseBuilder clearAllFlags() {
// 		builderTifInt = 0;
// 		return this;
// 	}
// 
// 	public SqrlTifResponse createTif() {
// 		return new SqrlTifResponse(tifFlagList, builderTifInt);
// 	}
// }


import junit.framework.TestCase;
import java.util.Collections;
import org.junit.Test;
import com.github.sqrlserverjava.backchannel.SqrlTifResponse.SqrlTifResponseBuilder;
package com.github.sqrlserverjava.backchannel;





public class SqrlServerResponseTest extends TestCase {
	// @formatter:off
	/**
	 * from decode page at grc
	 * dmVyPTENCm51dD1SX0lzc1FReWwtTEItc0IxUGlJRkd3DQp0aWY9NQ0KcXJ5PS9zcXJsP251dD1SX0lzc1FReWwtTEItc0IxUGlJRkd3DQo
		server reply decode: 
		ver=1
		nut=R_IssQQyl-LB-sB1PiIFGw
		tif=5
		qry=/sqrl?nut=R_IssQQyl-LB-sB1PiIFGw
	 */
	// @formatter:on
	@Test
	public void testBuildReply() throws Exception {
		final SqrlTifResponse tif = new SqrlTifResponseBuilder(true).addFlag(SqrlTifFlag.CURRENT_ID_MATCH).createTif();
		final String nut = "R_IssQQyl-LB-sB1PiIFGw";
		final String query = "/sqrl?nut=R_IssQQyl-LB-sB1PiIFGw";
		final String correlator = "alkfjaliejilsf";
// Path: src/main/java/com/github/sqrlserverjava/backchannel/SqrlTifResponse.java
// public static class SqrlTifResponseBuilder {
// 	private final Set<SqrlTifFlag> tifFlagList = new HashSet<>();
// 	private int builderTifInt;
// 
// 	public SqrlTifResponseBuilder(final boolean ipsMatched) {
// 		if (ipsMatched) {
// 			addFlag(SqrlTifFlag.IPS_MATCHED);
// 		}
// 	}
// 
// 	public SqrlTifResponseBuilder() {
// 	}
// 
// 	public SqrlTifResponseBuilder addFlag(final SqrlTifFlag tifFlag) {
// 		builderTifInt |= tifFlag.getMask();
// 		tifFlagList.add(tifFlag);
// 		return this;
// 	}
// 
// 	/**
// 	 * Removes all flags that are set
// 	 */
// 	public SqrlTifResponseBuilder clearAllFlags() {
// 		builderTifInt = 0;
// 		return this;
// 	}
// 
// 	public SqrlTifResponse createTif() {
// 		return new SqrlTifResponse(tifFlagList, builderTifInt);
// 	}
// }


// Path: src/test/java/com/github/sqrlserverjava/backchannel/SqrlServerResponseTest.java
import junit.framework.TestCase;
import java.util.Collections;
import org.junit.Test;
import com.github.sqrlserverjava.backchannel.SqrlTifResponse.SqrlTifResponseBuilder;

package com.github.sqrlserverjava.backchannel;





public class SqrlServerResponseTest extends TestCase {
	// @formatter:off
	/**
	 * from decode page at grc
	 * dmVyPTENCm51dD1SX0lzc1FReWwtTEItc0IxUGlJRkd3DQp0aWY9NQ0KcXJ5PS9zcXJsP251dD1SX0lzc1FReWwtTEItc0IxUGlJRkd3DQo
		server reply decode: 
		ver=1
		nut=R_IssQQyl-LB-sB1PiIFGw
		tif=5
		qry=/sqrl?nut=R_IssQQyl-LB-sB1PiIFGw
	 */
	// @formatter:on
	@Test
	public void testBuildReply() throws Exception {
		final SqrlTifResponse tif = new SqrlTifResponseBuilder(true).addFlag(SqrlTifFlag.CURRENT_ID_MATCH).createTif();
		final String nut = "R_IssQQyl-LB-sB1PiIFGw";
		final String query = "/sqrl?nut=R_IssQQyl-LB-sB1PiIFGw";
		final String correlator = "alkfjaliejilsf";
		final SqrlClientReply reply = new SqrlClientReply(nut, tif, query, correlator, Collections.emptyMap());