mirror of
https://github.com/google/nomulus.git
synced 2025-05-19 10:49:35 +02:00
Move test resource files into src/test/resources (#143)
* Move test resource files into src/test/resources * fix a test * Remove references to javatests/ in Java files * fix import order * fix semantic merge conflict
This commit is contained in:
parent
32d5940be3
commit
cf507dad6d
991 changed files with 23 additions and 22 deletions
|
@ -139,7 +139,7 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
assertThat((FullHttpRequest) channel.readInbound()).isEqualTo(makeEppHttpRequest(HELLO_BYTES));
|
||||
|
||||
byte[] inputBytes = readResourceBytes(getClass(), "testdata/login.xml").read();
|
||||
byte[] inputBytes = readResourceBytes(getClass(), "login.xml").read();
|
||||
|
||||
// Verify inbound message is as expected.
|
||||
assertThat(channel.writeInbound(getByteBufFromContent(inputBytes))).isTrue();
|
||||
|
@ -155,8 +155,8 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
channel.readInbound();
|
||||
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "testdata/login.xml").read();
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "testdata/logout.xml").read();
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "login.xml").read();
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "logout.xml").read();
|
||||
|
||||
// Verify inbound messages are as expected.
|
||||
assertThat(
|
||||
|
@ -177,8 +177,8 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
channel.readInbound();
|
||||
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "testdata/login.xml").read();
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "testdata/logout.xml").read();
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "login.xml").read();
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "logout.xml").read();
|
||||
ByteBuf inputBuffer =
|
||||
Unpooled.wrappedBuffer(
|
||||
getByteBufFromContent(inputBytes1), getByteBufFromContent(inputBytes2));
|
||||
|
@ -205,7 +205,7 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
channel.readInbound();
|
||||
|
||||
byte[] outputBytes = readResourceBytes(getClass(), "testdata/login_response.xml").read();
|
||||
byte[] outputBytes = readResourceBytes(getClass(), "login_response.xml").read();
|
||||
|
||||
// Verify outbound message is as expected.
|
||||
assertThat(channel.writeOutbound(makeEppHttpResponse(outputBytes))).isTrue();
|
||||
|
@ -221,7 +221,7 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
channel.readInbound();
|
||||
|
||||
byte[] outputBytes = readResourceBytes(getClass(), "testdata/login_response.xml").read();
|
||||
byte[] outputBytes = readResourceBytes(getClass(), "login_response.xml").read();
|
||||
|
||||
// Verify outbound message is not written to the peer as the response is not OK.
|
||||
EncoderException thrown =
|
||||
|
@ -243,7 +243,7 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
// First inbound message is hello.
|
||||
channel.readInbound();
|
||||
|
||||
byte[] outputBytes1 = readResourceBytes(getClass(), "testdata/login_response.xml").read();
|
||||
byte[] outputBytes1 = readResourceBytes(getClass(), "login_response.xml").read();
|
||||
Cookie cookie1 = new DefaultCookie("name1", "value1");
|
||||
Cookie cookie2 = new DefaultCookie("name2", "value2");
|
||||
|
||||
|
@ -252,13 +252,13 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
assertBufferRepresentsContent(getAllOutboundFrames(channel), outputBytes1);
|
||||
|
||||
// Verify inbound message contains cookies.
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "testdata/logout.xml").read();
|
||||
byte[] inputBytes1 = readResourceBytes(getClass(), "logout.xml").read();
|
||||
assertThat(channel.writeInbound(getByteBufFromContent(inputBytes1))).isTrue();
|
||||
assertThat((FullHttpRequest) channel.readInbound())
|
||||
.isEqualTo(makeEppHttpRequest(inputBytes1, cookie1, cookie2));
|
||||
|
||||
// Second outbound message change cookies.
|
||||
byte[] outputBytes2 = readResourceBytes(getClass(), "testdata/logout_response.xml").read();
|
||||
byte[] outputBytes2 = readResourceBytes(getClass(), "logout_response.xml").read();
|
||||
Cookie cookie3 = new DefaultCookie("name3", "value3");
|
||||
cookie2 = new DefaultCookie("name2", "newValue2");
|
||||
|
||||
|
@ -267,7 +267,7 @@ public class EppProtocolModuleTest extends ProtocolModuleTest {
|
|||
assertBufferRepresentsContent(getAllOutboundFrames(channel), outputBytes2);
|
||||
|
||||
// Verify inbound message contains updated cookies.
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "testdata/login.xml").read();
|
||||
byte[] inputBytes2 = readResourceBytes(getClass(), "login.xml").read();
|
||||
assertThat(channel.writeInbound(getByteBufFromContent(inputBytes2))).isTrue();
|
||||
assertThat((FullHttpRequest) channel.readInbound())
|
||||
.isEqualTo(makeEppHttpRequest(inputBytes2, cookie1, cookie2, cookie3));
|
||||
|
|
|
@ -34,7 +34,7 @@ public class QuotaConfigTest {
|
|||
private static QuotaConfig loadQuotaConfig(String filename) {
|
||||
return new QuotaConfig(
|
||||
new Yaml()
|
||||
.loadAs(readResourceUtf8(QuotaConfigTest.class, "testdata/" + filename), Quota.class),
|
||||
.loadAs(readResourceUtf8(QuotaConfigTest.class, filename), Quota.class),
|
||||
"theProtocol");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
refreshSeconds: 3600
|
||||
|
||||
defaultQuota:
|
||||
userId: []
|
||||
tokenAmount: 100
|
||||
refillSeconds: 60
|
||||
|
||||
customQuota: []
|
|
@ -1,14 +0,0 @@
|
|||
refreshSeconds: 3600
|
||||
|
||||
defaultQuota:
|
||||
userId: []
|
||||
tokenAmount: 100
|
||||
refillSeconds: 60
|
||||
|
||||
customQuota:
|
||||
- userId: ["abc", "def"]
|
||||
tokenAmount: 10
|
||||
refillSeconds: 60
|
||||
- userId: ["xyz123", "def", "luckycat"]
|
||||
tokenAmount: 500
|
||||
refillSeconds: 10
|
|
@ -1,8 +0,0 @@
|
|||
refreshSeconds: 0
|
||||
|
||||
defaultQuota:
|
||||
userId: []
|
||||
tokenAmount: 100
|
||||
refillSeconds: 0
|
||||
|
||||
customQuota: []
|
|
@ -1,14 +0,0 @@
|
|||
refreshSeconds: 3600
|
||||
|
||||
defaultQuota:
|
||||
userId: []
|
||||
tokenAmount: 100
|
||||
refillSeconds: 60
|
||||
|
||||
customQuota:
|
||||
- userId: ["abc", "def"]
|
||||
tokenAmount: 10
|
||||
refillSeconds: 60
|
||||
- userId: ["xyz123", "987lol", "luckycat"]
|
||||
tokenAmount: 500
|
||||
refillSeconds: 10
|
|
@ -1,8 +0,0 @@
|
|||
refreshSeconds: 3600
|
||||
|
||||
defaultQuota:
|
||||
userId: []
|
||||
tokenAmount: -1
|
||||
refillSeconds: 60
|
||||
|
||||
customQuota: []
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<login>
|
||||
<clID>ClientX</clID>
|
||||
<pw>foo-BAR2</pw>
|
||||
<newPW>bar-FOO2</newPW>
|
||||
<options>
|
||||
<version>1.0</version>
|
||||
<lang>en</lang>
|
||||
</options>
|
||||
<svcs>
|
||||
<objURI>urn:ietf:params:xml:ns:obj1</objURI>
|
||||
<objURI>urn:ietf:params:xml:ns:obj2</objURI>
|
||||
<objURI>urn:ietf:params:xml:ns:obj3</objURI>
|
||||
<svcExtension>
|
||||
<extURI>http://custom/obj1ext-1.0</extURI>
|
||||
</svcExtension>
|
||||
</svcs>
|
||||
</login>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<epp xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:fee12="urn:ietf:params:xml:ns:fee-0.12" xmlns:fee11="urn:ietf:params:xml:ns:fee-0.11" xmlns:mark="urn:ietf:params:xml:ns:mark-1.0" xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
|
||||
<response>
|
||||
<result code="1000">
|
||||
<msg>Command completed successfully</msg>
|
||||
</result>
|
||||
<trID>
|
||||
<clTRID>proxy-login</clTRID>
|
||||
<svTRID>inlxipwsQKaXS3VmbKOmBA==-a</svTRID>
|
||||
</trID>
|
||||
</response>
|
||||
</epp>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<logout/>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<epp xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xmlns:host="urn:ietf:params:xml:ns:host-1.0" xmlns:launch="urn:ietf:params:xml:ns:launch-1.0" xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1" xmlns:fee12="urn:ietf:params:xml:ns:fee-0.12" xmlns:fee11="urn:ietf:params:xml:ns:fee-0.11" xmlns:mark="urn:ietf:params:xml:ns:mark-1.0" xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
|
||||
<response>
|
||||
<result code="1500">
|
||||
<msg>Command completed successfully; ending session</msg>
|
||||
</result>
|
||||
<trID>
|
||||
<clTRID>proxy-logout</clTRID>
|
||||
<svTRID>inlxipwsQKaXS3VmbKOmBA==-c</svTRID>
|
||||
</trID>
|
||||
</response>
|
||||
</epp>
|
Loading…
Add table
Add a link
Reference in a new issue