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

Adding Quote object and unit test #1611

Merged
merged 9 commits into from Nov 21, 2017

Conversation

Projects
None yet
2 participants
@andreiruse
Member

andreiruse commented Nov 20, 2017

This will be a simple wrapper of a QuoteId and a double value.

A similar example is FxRate wrapping FxRateId and the actual rate.

*
* This represents a single numeric value of a given security, such as the mid point between the buy/sell.
* <p>
* See {@link QuoteId} fot the representation that does not contain a value.

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

fot -> for, although I'm not sure this line is adding anything, so best to remove

/**
* A single value for a given security, represented by a quote, such as 'EUR/GBP 1W FX Opt ATM Straddle' - 10.0.
* <p>
*

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

No blank line

/**
* Obtains an instance from a the scheme ID, quote ID, and value.
*
* @param identifierScheme the identifier of the scheme used to indicate the quote

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

In Strata there are two spaces after the parameter name, so @param xxx<two spaces here>description

* @return an instance of {@link Quote} for the given values
* @throws IllegalArgumentException if the scheme ID, or scheme value are empty
*/
public static Quote of(String identifierScheme, String identifier, Double value) {

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

Should be double, not Double.

* The value applicable for the given {@link QuoteId}.
*/
@PropertyDefinition(validate = "notNull")
private final Double value;

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

Should be double not Double

@Test
public class QuoteTest {
private static final QuoteId quoteId1 = QuoteId.of(StandardId.of("og", "id1"));

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

constants should be upper case quoteId1 -> QUOTE_ID1

public void test_of_EmptyId() throws Exception {
Quote.of("notEmpty", "", 1.2345);
}
}

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

new line EOF

Quote.of("", "notEmpty", 1.2345);
}
@Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "Argument 'value' with value '' must match pattern:.+")

This comment has been minimized.

@jodastephen

jodastephen Nov 21, 2017

Member

Strata uses assertThrowsIllegalArg(lambda, regex) for cases like these. Both error cases can then be in one method

andreiruse and others added some commits Nov 21, 2017

@jodastephen jodastephen merged commit 935304b into master Nov 21, 2017

15 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
security/snyk No new issues
Details
security/snyk - modules/basics/pom.xml No new issues
Details
security/snyk - modules/calc/pom.xml No new issues
Details
security/snyk - modules/collect/pom.xml No new issues
Details
security/snyk - modules/data/pom.xml No new issues
Details
security/snyk - modules/loader/pom.xml No new issues
Details
security/snyk - modules/market/pom.xml No new issues
Details
security/snyk - modules/math/pom.xml No new issues
Details
security/snyk - modules/measure/pom.xml No new issues
Details
security/snyk - modules/pom.xml No new issues
Details
security/snyk - modules/pricer/pom.xml No new issues
Details
security/snyk - modules/product/pom.xml No new issues
Details
security/snyk - modules/report/pom.xml No new issues
Details

@jodastephen jodastephen deleted the topic/add-quote-object-type branch Nov 21, 2017

@jodastephen jodastephen added this to the v1.6 milestone Nov 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment