-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edith Soares
committed
May 25, 2021
1 parent
30e45df
commit d5e417e
Showing
8 changed files
with
284 additions
and
236 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
### --------- Configuração banco MySql --------- | ||
# | ||
## | ||
#spring.datasource.url=mysql://b66ed712bc811c:[email protected]/heroku_26b0e4901d71f24?reconnect=true | ||
#spring.datasource.username=b66ed712bc811c | ||
#spring.datasource.password=070eab02 | ||
#spring.jpa.hibernate.ddl-auto=update | ||
# | ||
### Hibernate Properties | ||
## The SQL dialect makes Hibernate generate better SQL for the chosen database | ||
|
||
## Hibernate Properties | ||
# The SQL dialect makes Hibernate generate better SQL for the chosen database | ||
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect | ||
|
||
#spring.h2.console.enabled=true | ||
#spring.h2.console.path=/h2 | ||
#spring.datasource.url=jdbc:h2:mem:teste | ||
#spring.datasource.driver-class-name=org.h2.Driver | ||
#spring.datasource.username=sa | ||
#spring.datasource.password=password | ||
#spring.jpa.database-platform=org.hibernate.dialect.H2Dialect | ||
#server.port=8080 | ||
#spring.jpa.hibernate.ddl-auto=create | ||
#spring.jpa.show-sql=true | ||
spring.h2.console.enabled=true | ||
spring.h2.console.path=/h2 | ||
spring.datasource.url=jdbc:h2:mem:teste | ||
spring.datasource.driver-class-name=org.h2.Driver | ||
spring.datasource.username=sa | ||
spring.datasource.password=password | ||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect | ||
server.port=8080 | ||
spring.jpa.hibernate.ddl-auto=create | ||
spring.jpa.show-sql=true |
134 changes: 67 additions & 67 deletions
134
test/java/spg/finalchallenge/service/ClientServiceTest.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,67 @@ | ||
package spg.finalchallenge.service; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
import spg.finalchallenge.entity.Client; | ||
|
||
|
||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest | ||
public class ClientServiceTest { | ||
|
||
@Autowired | ||
ClientService clientServiceTest; | ||
|
||
private Client instaceClient(String name, String cpf){ | ||
Client client = new Client(); | ||
client.setName(name); | ||
client.setCpf(cpf); | ||
return clientServiceTest.saveClient(client); | ||
} | ||
|
||
|
||
@Test | ||
public void saveClient(){ | ||
Client client = instaceClient("Edith", "123"); | ||
|
||
assertThat(client).isNotNull(); | ||
} | ||
|
||
|
||
@Test | ||
public void checkIdClientSave(){ | ||
Client client = instaceClient("Edith", "123"); | ||
|
||
//Client clientSave = clientServiceTest.saveClient(client); | ||
|
||
assertThat(client.getId()).isEqualTo(1); | ||
} | ||
|
||
@Test | ||
public void getClientById(){ | ||
Client client = instaceClient("Edith", "123"); | ||
|
||
//Client clientSave = clientServiceTest.saveClient(client); | ||
|
||
Client found = clientServiceTest.getId(client.getId()); | ||
|
||
assertThat(found.getName()).isEqualTo(client.getName()); | ||
} | ||
|
||
@Test | ||
public void countClient(){ | ||
Client client = instaceClient("Edith", "123");// | ||
|
||
// Client clientSvae = clientServiceTest.saveClient(client); | ||
|
||
long qtd = clientServiceTest.count(); | ||
|
||
assertThat(qtd).isEqualTo(1); | ||
} | ||
} | ||
//package spg.finalchallenge.service; | ||
// | ||
//import org.junit.Test; | ||
//import org.junit.runner.RunWith; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//import org.springframework.boot.test.context.SpringBootTest; | ||
//import org.springframework.test.context.junit4.SpringRunner; | ||
//import spg.finalchallenge.entity.Client; | ||
// | ||
// | ||
// | ||
//import static org.assertj.core.api.Assertions.assertThat; | ||
// | ||
//@RunWith(SpringRunner.class) | ||
//@SpringBootTest | ||
//public class ClientServiceTest { | ||
// | ||
// @Autowired | ||
// ClientService clientServiceTest; | ||
// | ||
// private Client instaceClient(String name, String cpf){ | ||
// Client client = new Client(); | ||
// client.setName(name); | ||
// client.setCpf(cpf); | ||
// return clientServiceTest.saveClient(client); | ||
// } | ||
// | ||
// | ||
// @Test | ||
// public void saveClient(){ | ||
// Client client = instaceClient("Edith", "123"); | ||
// | ||
// assertThat(client).isNotNull(); | ||
// } | ||
// | ||
// | ||
// @Test | ||
// public void checkIdClientSave(){ | ||
// Client client = instaceClient("Edith", "123"); | ||
// | ||
// //Client clientSave = clientServiceTest.saveClient(client); | ||
// | ||
// assertThat(client.getId()).isEqualTo(1); | ||
// } | ||
// | ||
// @Test | ||
// public void getClientById(){ | ||
// Client client = instaceClient("Edith", "123"); | ||
// | ||
// //Client clientSave = clientServiceTest.saveClient(client); | ||
// | ||
// Client found = clientServiceTest.getId(client.getId()); | ||
// | ||
// assertThat(found.getName()).isEqualTo(client.getName()); | ||
// } | ||
// | ||
// @Test | ||
// public void countClient(){ | ||
// Client client = instaceClient("Edith", "123");// | ||
// | ||
//// Client clientSvae = clientServiceTest.saveClient(client); | ||
// | ||
// long qtd = clientServiceTest.count(); | ||
// | ||
// assertThat(qtd).isEqualTo(1); | ||
// } | ||
//} |
Oops, something went wrong.