Skip to content

Instantly share code, notes, and snippets.

@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 08:03
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
def "API to test prime factors of given integer"(){
@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 08:01
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
def "API to test prime factors of given integer"(){
@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 08:00
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
def "API to test prime factors of given integer"(){
@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 07:58
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
def "API to test prime factors of given integer"(){
@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 07:55
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
def "API to test prime factors of given integer"(){
@sapanparikh18
sapanparikh18 / PrimeFactorsSpec1.groovy
Created October 24, 2018 07:53
Created with Copy to Gist
package primefactors
import spock.lang.Specification
class PrimeFactorsSpec extends Specification{
def "api to t test nothing"(){
expect: "nothing" == "nothing"
}
}
@sapanparikh18
sapanparikh18 / build.gradle
Created October 24, 2018 07:48
Created with Copy to Gist
plugins {
id 'groovy'
id 'java'
}
group 'sapan.demo'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
public Reviewanswer getAnswer(int questionId) throws DataNotFoundException {
String sql = "select * from answers where questionid=:questionId";
Map<String, Object> params = new HashMap<>();
params.put("questionId",questionId);
Reviewanswer answer = new Reviewanswer();
try {
answer = namedParameterJdbcTemplate.queryForObject(sql,params,Reviewanswer.class);
}catch (DataAccessException ex){
if("data not found(or something on similar lines)".equals(ex.getMessage())){
throw new DataNotFoundException();
public Reviewanswer getAnswer(int questionId) {
String sql = "select * from answers where questionid=:questionId";
Map<String, Object> params = new HashMap<>();
Reviewanswer answer = new Reviewanswer();
params.put("questionId",questionId);
try {
answer = namedParameterJdbcTemplate.queryForObject(sql,params,Reviewanswer.class);
}catch (DataAccessException ex){
Logger.getLogger(this.getClass().getName()).log(Level.ALL,ex.getLocalizedMessage());
}
refresh(){
Broker.getInstance().sendMessage(Broker.CommonTopics.ON_TAX_CHANGE,Collections.emptyMap());
}