Last active
December 26, 2015 22:19
-
-
Save edubriguenti/7222185 to your computer and use it in GitHub Desktop.
Teste de web-service com JUNIT
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
@RunWith(MockitoJUnitRunner.class) | |
public class AcessoDadosCadastroSeguradoTest { | |
protected static URL wsdlURL; | |
protected static QName serviceName; | |
protected static QName portName; | |
static { | |
serviceName = new QName("XX", "XX"); | |
portName = new QName("XX", "XX"); | |
try { | |
wsdlURL = new URL("XXXXX"); | |
} catch (MalformedURLException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} | |
@Before | |
public void setUp() throws Exception { | |
System.out.println("Setup"); | |
} | |
@Test | |
public void testeServicoObter() { | |
AcessoDadosCadastroSeguradoService acessoDadosCadastroSeguradoService = new AcessoDadosCadastroSeguradoService(wsdlURL,serviceName); | |
AcessoDadosCadastroSegurado port = acessoDadosCadastroSeguradoService.getAcessoDadosCadastroSeguradoPort(); | |
List<Restricao> listaRestricao = new ArrayList<Restricao>(); | |
Restricao restricao = new Restricao(); | |
restricao.setNomeAtributo("segurado.numeroDigitoSegurado"); | |
restricao.setOperadorRestricao("="); | |
restricao.setValorRestricao("1"); | |
listaRestricao.add(restricao); | |
List<String> listaAtributos = new ArrayList<String>(); | |
listaAtributos.add("segurado.nomeSegurado"); | |
List<Segurado> obter = port.obter(listaAtributos, listaRestricao); | |
assertNotNull(obter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment