Kosovo will give you an idea:
Copied and edited from Wikipedia:
Accordance with International Law of the Unilateral Declaration of Independence In Respect of Kosovo was a request for an advisory opinion referred to the International Court of Justice by the United Nations General Assembly regarding the 2008 Kosovo declaration of independence. The territory of Kosovo is the subject of a dispute between Serbia and the Republic of Kosovo established by the declaration. This was the first case regarding a unilateral declaration of independence to be brought before the court.
The court delivered its advisory opinion on 22 July 2010; by a vote of 10 to 4, it declared that “the adoption of the declaration of independence of the 17 February 2008 did not violate general international law because international law contains no ‘prohibition on declarations of independence’”
On 26 March 2008, the Government of Serbia announced its plan to call on the International Court of Justice to rule on the declaration of Kosovo’s secession. Serbia sought to have the court’s opinion on whether the declaration was in breach of international law. Also, an initiative seeking international support was undertaken at the United Nations General Assembly when it gathered again in New York in September 2008.[9]
On 15 August 2008, Serbian Foreign Minister Vuk Jeremić officially filed a request at the United Nations seeking opinion of the International Court of Justice.[10]
The resolution was worded as follows:
The General Assembly,
Mindful of the purposes and principles of the United Nations,
Bearing in mind its functions and powers under the Charter of the United Nations,
Recalling that on 17 February 2008 the Provisional Institutions of Self-Government of Kosovo declared independence from Serbia,
Aware that this act has been received with varied reactions by the Members of the United Nations as to its compatibility with the existing international legal order,
Decides, in accordance with Article 96 of the Charter of the United Nations to request the International Court of Justice, pursuant to Article 65 of the Statute of the Court to render an advisory opinion on the following question:
“Is the unilateral declaration of independence by the Provisional Institutions of Self-Government of Kosovo in accordance with international law?”
On 21 April 2009, the ICJ announced that 35 member states of the United Nations had filed written statements within the time-limit fixed by the court (17 April 2009) on the question of the legality of Kosovo’s UDI.
On 22 July 2010, the court ruled that the declaration of independence was not in violation of international law.[119][120][121] The President of the ICJ Justice Hisashi Owada said that international law contains no “prohibition on declarations of independence.” The court also said while the declaration may not have been illegal, the issue of recognition was a political one.
It is worth pointing out that Spain’s objection was rejected:
“The unilateral Kosovo independence declaration cannot be in accordance with international law because it violated the principle of territorial integrity and sovereignty of Serbia…”
and China’s:
“There is no doubt that after the breakup of the Socialist Federal Republic of Yugoslavia, Kosovo was a part of the Federal Republic of Yugoslavia, that is, Serbia. Integral parts of sovereign states, under international law, do not have a right to unilateral secession … while the principle of protection of territorial integrity is a cornerstone of international legal order.”
And Cyprus:
“The principles of international law do not support the unilateral declaration of independence by Kosovo. Neither the UN Security Council, nor anyone else has the right to amputate part of the territory of a sovereign state.”
and Russia:
“General international law prevents Kosovo from declaring independence, bearing in mind that the people of Kosovo do not enjoy a right to self-determination.
Russia rejects claims coming from those countries who support the unilateral declaration that international law “does not regulate independence declarations”, and reminds that the UN Security Council declared Northern Cyprus and Rhodesia’s independence to be illegal, since secession is forbidden outside the colonial context.”
Which kind of knocks your comments about self determination and UDI into a colonial cocked hat.