This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.repository; | |
import com.safebear.tasklist.model.Task; | |
import org.assertj.core.api.Assertions; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | |
import org.springframework.test.context.junit4.SpringRunner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.service; | |
import com.safebear.tasklist.model.Task; | |
import com.safebear.tasklist.repository.TaskRepository; | |
import org.assertj.core.api.Assertions; | |
import org.assertj.core.util.Lists; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.mockito.Mockito; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage('cucumber bdd tests') { | |
steps { | |
sh 'mvn clean -Dtest=${cuke} test -Ddomain=${domain} -Dport=${test_port} -Dcontext=${context} -Dsleep="0" -Dbrowser="headless"' | |
} | |
post { | |
always { | |
publishHTML([ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.usertests; | |
import com.cucumber.listener.Reporter; | |
import cucumber.api.CucumberOptions; | |
import cucumber.api.junit.Cucumber; | |
import org.junit.AfterClass; | |
import org.junit.runner.RunWith; | |
import java.io.File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<extentreports> | |
<configuration> | |
<!-- report theme --> <!-- standard, dark --> | |
<theme>standard</theme> | |
<!-- document encoding --> <!-- defaults to UTF-8 --> | |
<encoding>UTF-8</encoding> | |
<!-- protocol for script and stylesheets --> <!-- defaults to https --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage('Run API Tests') { | |
steps { | |
// sh 'mvn -Dtest=${apiTests} test -Ddomain=${domain} -Dport=${test_port} -Dcontext=${context}' | |
sh 'newman run src/test/collections/tasklist.postman_collection.json -e src/test/collections/testenv.postman_environment.json --bail newman' | |
} | |
// post { | |
// always { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Given("^the following tasks are created:$") | |
public void the_following_tasks_are_created(DataTable tasks) { | |
// Here I'm converting the raw data into a list of lists. The inner list contains the data from a row in the table, while the outer list is the list of rows. | |
List<List<String>> data = tasks.raw(); | |
// Here I'm checking to see if the first task in the first row (x=0,y=0) has already been created in the system. If it has, then I don't create them. | |
if (!taskListPage.checkForTask(data.get(0).get(0))) { | |
// Here I'm iterating through the rows in the table and storing each row in a List called 'task' each time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
steps { | |
sh 'mvn clean package sonar:sonar -Dsonar.organization=safebear-student-bitbucket -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=f08a36f3598527bf9b20d9b861b57c0aaa5937e3' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.service; | |
import com.safebear.tasklist.domain.Task; | |
import com.safebear.tasklist.repository.TaskRepository; | |
import org.springframework.stereotype.Service; | |
@Service | |
public class TaskServiceImpl implements TaskService { | |
private TaskRepository taskRepository; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.safebear.tasklist.service; | |
import com.safebear.tasklist.domain.Task; | |
public interface TaskService { | |
Iterable<Task> list(); | |
Task save(Task task); |