Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/integracao #16

Merged
merged 15 commits into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
geração de banco de dados para testes de integração
  • Loading branch information
gabrielcs23 committed Sep 12, 2021
commit 9eff4b2829fa2985ef02c81d3c09647805b91f8c
2 changes: 1 addition & 1 deletion src/main/java/net/originmobi/pdv/model/Permissoes.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Permissoes implements Serializable {
@Size(max = 45, message = "Tamanho máximo de 45 caracteres")
private String descricao;

@ManyToMany
@ManyToMany(mappedBy = "permissoes")
private List<GrupoUsuario> grupoUsuario;

@ManyToMany
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/originmobi/pdv/model/Usuario.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class Usuario implements Serializable {
inverseJoinColumns = @JoinColumn(name = "grupo_usuario_codigo"))
private List<GrupoUsuario> grupousuario;

@ManyToMany
@ManyToMany(mappedBy = "usuario")
private List<Permissoes> permissoes;

public Usuario() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.servlet.MockMvc;

Expand All @@ -16,6 +17,7 @@
@ExtendWith(SpringExtension.class)
@SpringBootTest
@AutoConfigureMockMvc
@TestPropertySource(locations = "classpath:application-integrationtest.properties")
class CaixaControllerIntegracaoTest {

@Autowired
Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/application-integrationtest.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
spring.datasource.url=jdbc:mysql:https://localhost:3306/pdvtest?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=admin

spring.jpa.hibernate.ddl-auto=create-drop

spring.flyway.enabled=false